xbitinfo.save_compressed.get_compress_encoding_nc#
- xbitinfo.save_compressed.get_compress_encoding_nc(ds, compression='zlib', shuffle=True, complevel=9, for_cdo=False, time_dim='time', chunks=None)[source]#
Generate encoding for
xarray.Dataset.to_netcdf()
.Example
>>> ds = xr.Dataset({"Tair": (("time", "x", "y"), np.random.rand(36, 20, 10))}) >>> get_compress_encoding_nc(ds) {'Tair': {'zlib': True, 'shuffle': True, 'complevel': 9, 'chunksizes': (36, 20, 10)}} >>> get_compress_encoding_nc(ds, for_cdo=True) {'Tair': {'zlib': True, 'shuffle': True, 'complevel': 9, 'chunksizes': (1, 20, 10)}}
See also