cf.CellMeasure.nc_dataset_chunksizes

CellMeasure.nc_dataset_chunksizes(todict=False)[source]

Get the dataset chunking strategy for the data.

Added in version (cfdm): 1.12.2.0

Parameters:
todict: bool, optional

If True then the dataset chunk sizes are returned in a dict keyed by their axis positions. If False (the default) then the dataset chunking strategy is returned in the same form that it was set (i.e. as None, int, str, or tuple).

Returns:
None or str or int or dict or tuple of int

The current chunking strategy when writing to a netCDF4 file. One of:

  • None: No dataset chunking strategy has been defined. The chunking strategy will be determined at write time by cf.write.

  • 'contiguous': The data will be written to the file contiguously, i.e. no chunking.

  • int or str: The size in bytes of the dataset 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 the cf.write dataset_chunks parameter for details). For instance a chunksize of 1024 bytes may be specified with any of 1024, '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, and PB.

  • tuple of int: 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 as insert_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 as insert_dimension).