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.
createCompoundType(datatype, datatype_name)Create CompoundType.
createDimension(name, size)Creates a new dimension with given name and size.
createEnumType(datatype, datatype_name, ...)Create EnumType.
createGroup(name)Create NetCDF4 group.
createVLType(datatype, datatype_name)Create VLType.
createVariable(varname, datatype[, ...])Creates a new variable.
create_cmptype(datatype, datatype_name)Create CompoundType.
create_enumtype(datatype, datatype_name, ...)Create EnumType.
create_group(name)Create NetCDF4 group.
create_variable(name[, dimensions, dtype, ...])Creates a new variable.
create_vltype(datatype, datatype_name)Create VLType.
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
attrscmptypesReturn group defined compound types.
dimensionsdimsenumtypesReturn group defined enum types.
groupsnameparentvariablesvltypesReturn group defined vlen types.
- createCompoundType(datatype, datatype_name)#
Create CompoundType.
- datatype: np.dtype
A numpy dtype object describing the structured type.
- datatype_name: string
A Python string containing a description of the compound data type.
- createDimension(name, size)#
Creates a new dimension with given name and size.
- Parameters:
- Returns:
dim (
h5netcdf.legacyapi.Dimension) – Dimension class instance.
- createEnumType(datatype, datatype_name, enum_dict)#
Create EnumType.
- datatype: np.dtype
A numpy integer dtype object describing the base type for the Enum.
- datatype_name: string
A Python string containing a description of the Enum data type.
- enum_dict: dict
A Python dictionary containing the Enum field/value pairs.
- createVLType(datatype, datatype_name)#
Create VLType.
- datatype: np.dtype
A numpy dtype object describing the base type.
- datatype_name: string
A Python string containing a description of the VL data type.
- 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,UserType (Enum,VL,Compound)) – Datatype of the new variable.dimensions (
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