h5netcdf.File.create_variable#
- File.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
,UserType (Enum
,VL
,Compound)
, optional) – Datatype 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 ofh5py
orh5netcdf
. Defaults toh5netcdf
. Discussion onh5netcdf
chunking can be found in (GH52) and (PR127).compression (
str
, optional) – Compression filter to apply, defaults togzip
compression_opts (
int
) – Parameter for compression filter. Forcompression="gzip"
Integer from 1 to 9 specifying the compression level. Defaults to 4.fletcher32 (
bool
) – IfTrue
, HDF5 Fletcher32 checksum algorithm is applied. Defaults toFalse
.shuffle (
bool
, optional) – IfTrue
, HDF5 shuffle filter will be applied. Defaults toTrue
.
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 withinvalid_netcdf=True
,- Returns:
var (
h5netcdf.Variable
) – Variable class instance