cngi.dio.write_vis

write_vis(mxds, outfile, chunks_on_disk=None, partition=None, consolidated=True, compressor=None, graph_name='write_zarr')[source]

Write xarray dataset to zarr format on disk. When chunks_on_disk is not specified the chunking in the input dataset is used. When chunks_on_disk is specified that dataset is saved using that chunking.

Parameters
  • mxds (xarray.core.dataset.Dataset) – Dataset of dataset to write to disk

  • outfile (str) – outfile filename, generally ends in .zarr

  • chunks_on_disk (dict of int) – A dictionary with the chunk size that will be used when writing to disk. For example {‘time’: 20, ‘chan’: 6}. If chunks_on_disk is not specified the chunking of dataset will be used.

  • partition (str or list) – Name of partition xds to write into outfile (from the mxds attributes section). Overwrites existing partition of same name. Default None writes entire mxds

  • compressor (numcodecs.blosc.Blosc) – The blosc compressor to use when saving the converted data to disk using zarr. If None the zstd compression algorithm used with compression level 2.

  • graph_name (string) – The time taken to execute the graph and save the dataset is measured and saved as an attribute in the zarr file. The graph_name is the label for this timing information.