h5netcdf.File#

class h5netcdf.File(path, mode='r', invalid_netcdf=False, phony_dims=None, **kwargs)#
__init__(path, mode='r', invalid_netcdf=False, phony_dims=None, **kwargs)#

NetCDF4 file constructor.

Parameters:
  • path (path-like) – Location of the netCDF4 file to be accessed.

  • mode ("r", "r+", "a", "w") – A valid file access mode. Defaults to “r”.

  • invalid_netcdf (bool) – Allow writing netCDF4 with data types and attributes that would otherwise not generate netCDF4 files that can be read by other applications. See Invalid netCDF files for more details.

  • phony_dims ('sort', 'access') – See Datasets with missing dimension scales for more details.

  • track_order (bool) – Corresponds to the h5py.File track_order parameter. Unless specified, the library will choose a default that enhances compatibility with netCDF4-c. If h5py version 3.7.0 or greater is installed, this parameter will be set to True by default. track_order is required to be true to for netCDF4-c libraries to append to a file. If an older version of h5py is detected, this parameter will be set to False by default to work around a bug in h5py limiting the number of attributes for a given variable.

  • **kwargs – Additional keyword arguments to be passed to the h5py.File constructor.

Notes

In h5netcdf version 0.12.0 and earlier, order tracking was disabled in HDF5 file. As this is a requirement for the current netCDF4 standard, it has been enabled without deprecation as of version 0.13.0 (GH128).

Datasets created with h5netcdf version 0.12.0 that are opened with newer versions of h5netcdf will continue to disable order tracker.

Methods

__init__(path[, mode, invalid_netcdf, ...])

NetCDF4 file constructor.

close()

create_group(name)

Create NetCDF4 group.

create_variable(name[, dimensions, dtype, ...])

Creates a new variable.

flush()

get(k[,d])

items()

keys()

resize_dimension(dim, size)

Resize a dimension to a certain size.

sync()

values()

Attributes

attrs

dimensions

dims

filename

groups

mode

name

parent

variables

close()#
property filename#
flush()#
property mode#
property parent#
sync()#