xbitinfo.save_compressed.ToCompressed_Zarr#
- class xbitinfo.save_compressed.ToCompressed_Zarr(xarray_obj)[source]#
Save to compressed
zarr
wrappingxarray.Dataset.to_zarr()
withxbitinfo.save_compressed.get_compress_encoding_zarr()
.- Parameters:
path (
str
,path-like
orfile-like
) – Output location of compressed datasetcompressor (
numcodecs
) – Compressor used for encoding. Defaults to zstd with bit-shuffling.kwargs (
dict
) – Arguments to be passed toxarray.Dataset.to_zarr()
Example
>>> ds = xr.tutorial.load_dataset("rasm") >>> path = "compressed_rasm.zarr" >>> ds.to_compressed_zarr(path, mode="w") >>> ds.to_compressed_zarr(path, compressor=numcodecs.Blosc("zlib"), mode="w") >>> ds.to_compressed_zarr( ... path, compressor={"Tair": numcodecs.Blosc("zstd")}, mode="w" ... )
See also
Methods
__init__
(xarray_obj)