h5netcdf.legacyapi.Group
h5netcdf.legacyapi.Group¶
- class h5netcdf.legacyapi.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.
createDimension(name, size)Creates a new dimension with given name and size.
createGroup(name)Create NetCDF4 group.
createVariable(varname, datatype[, ...])Creates a new variable.
create_group(name)Create NetCDF4 group.
create_variable(name[, dimensions, dtype, ...])Creates a new variable.
flush()get(k[,d])getncattr(name)Retrieve a netCDF4 attribute.
items()keys()ncattrs()Return netCDF4 attribute names.
resize_dimension(dim, size)Resize a dimension to a certain size.
setncattr(name, value)Set a netCDF4 attribute.
sync()values()Attributes
attrsdimensionsdimsgroupsnameparentvariables- createDimension(name, size)¶
Creates a new dimension with given name and size.
- Parameters
- Returns
dim (
h5netcdf.legacyapi.Dimension) – Dimension class instance.
- createVariable(varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, chunksizes=None, fill_value=None, endian='native')¶
Creates a new variable.
- Parameters
varname (
str) – Name of the new variable. If given as a path, intermediate groups will be created, if not existent.datatype (
numpy.dtype,str) – Dataype of the new variabledimensions (
tuple) – Tuple containing dimension name strings. Defaults to empty tuple, effectively creating a scalar variable.zlib (
bool, optional) – IfTrue, variable data will be gzip compressed.complevel (
int, optional) – Integer between 1 and 9 defining compression level. Defaults to 4. Ignored ifzlib=False.shuffle (
bool, optional) – IfTrue, HDF5 shuffle filter will be applied. Defaults toTrue. Ignored ifzlib=False.fletcher32 (
bool, optional) – IfTrue, HDF5 Fletcher32 checksum algorithm is applied. Defaults toFalse.chunksizes (
tuple, optional) – Tuple of integers specifying the chunksizes of each variable dimension. Discussion onh5netcdfchunksizes can be found in (GH52) and (PR127).fill_value (scalar, optional) – Specify
_FillValuefor uninitialized parts of the variable. Defaults toNone.endian (
str, optional) – Control on-disk storage format. Can be any oflittle,bigornative(default).
- Returns
var (
h5netcdf.legacyapi.Variable) – Variable class instance