h5netcdf.Group#

class h5netcdf.Group(parent, name)#
__init__(parent, name)#

Create netCDF4 group.

Groups are containers by which the netCDF4 (HDF5) files are organized. Each group is like a Dataset itself.

Methods

__init__(parent, name)

Create netCDF4 group.

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

groups

name

parent

variables

property attrs#
create_group(name)#

Create NetCDF4 group.

Parameters

name (str) – Name of new group.

create_variable(name, dimensions=(), dtype=None, data=None, fillvalue=None, chunks=None, chunking_heuristic=None, **kwargs)#

Creates a new variable.

Parameters
  • name (str) – Name of the new variable. If given as a path, intermediate groups will be created, if not existent.

  • dimensions (tuple) – Tuple containing dimension name strings. Defaults to empty tuple, effectively creating a scalar variable.

  • dtype (numpy.dtype, str, optional) – Dataype of the new variable. Defaults to None.

  • fillvalue (scalar, optional) – Specify fillvalue for uninitialized parts of the variable. Defaults to None.

  • chunks (tuple, optional) – Tuple of integers specifying the chunksizes of each variable dimension.

  • chunking_heuristic (str, optional) – Specify auto-chunking approach. Can be either of h5py or h5netcdf. Defaults to h5netcdf. Discussion on h5netcdf chunking can be found in (GH52) and (PR127).

  • compression (str, optional) – Compression filter to apply, defaults to gzip

  • compression_opts (int) – Parameter for compression filter. For compression="gzip" Integer from 1 to 9 specifying the compression level. Defaults to 4.

  • fletcher32 (bool) – If True, HDF5 Fletcher32 checksum algorithm is applied. Defaults to False.

  • shuffle (bool, optional) – If True, HDF5 shuffle filter will be applied. Defaults to True.

Note

Please refer to h5py documentation for further parameters via keyword arguments. Any parameterizations which do not adhere to netCDF4 standard will only work on files created with invalid_netcdf=True,

Returns

var (h5netcdf.Variable) – Variable class instance

property dimensions#
property dims#
flush()#
property groups#
property name#
property parent#
resize_dimension(dim, size)#

Resize a dimension to a certain size.

It will pad with the underlying HDF5 data sets’ fill values (usually zero) where necessary.

sync()#
property variables#