cfdm.Data.nc_hdf5_chunksizes¶
-
Data.nc_hdf5_chunksizes(todict=False)[source]¶ Get the HDF5 chunking strategy for the data.
New in version (cfdm): 1.7.2
- Parameters
- Returns
NoneorstrorintordictortupleofintThe current chunking strategy when writing to a netCDF4 file. One of:
None: No HDF5 chunking strategy has been defined. The chunking strategy will be determined at write time bycfdm.write.'contiguous': The data will be written to the file contiguously, i.e. no chunking.intorstr: The size in bytes of the HDF5 chunks. A string represents a quantity of byte units. “Square-like” chunk shapes are preferred, maximising the amount of chunks that are completely filled with data values (see thecfdm.writehdf5_chunks parameter for details). For instance a chunksize of 1024 bytes may be specified with any of1024,'1024','1024 B','1 KiB','0.0009765625 MiB', etc. Recognised byte units are (case insensitive):B,KiB,MiB,GiB,TiB,PiB,KB,MB,GB,TB, andPB.tupleofint: The maximum number of array elements in a chunk along each data axis. This chunking strategy may get automatically modified by methods that change the data shape (such asinsert_dimension).dict: If todict is True, the maximum number of array elements in a chunk along each axis. This chunking strategy may get automatically modified by methods that change the data shape (such asinsert_dimension).
Examples
>>> d.shape (1, 96, 73) >>> d.nc_set_hdf5_chunksizes([1, 35, 73]) >>> d.nc_hdf5_chunksizes() (1, 35, 73) >>> d.nc_hdf5_chunksizes(todict=True) {0: 1, 1: 35, 2: 73} >>> d.nc_clear_hdf5_chunksizes() (1, 35, 73) >>> d.nc_hdf5_chunksizes() None >>> d.nc_set_hdf5_chunksizes('contiguous') >>> d.nc_hdf5_chunksizes() 'contiguous' >>> d.nc_set_hdf5_chunksizes('1 KiB') >>> d.nc_hdf5_chunksizes() 1024 >>> d.nc_set_hdf5_chunksizes(None) >>> d.nc_hdf5_chunksizes() None