cngi.dio.append_xds

append_xds(list_xarray_data_variables, outfile, chunks_return={}, compressor=None, graph_name='append_zarr')[source]

Append a list of dask arrays to a zarr file on disk. If a data variable with the same name is found it will be overwritten. Data will probably be corrupted if append_zarr overwrites the data variable from which the dask array gets its data. All data variables that share dimensions and coordinates with data variables already on disk must have the same values (chunking can be different).

Parameters
  • list_xarray_data_variables (list of dask arrays) – List of xarray datavariables to append.

  • outfile (str) – The file name of the dataset on disk, generally ends in .zarr

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

  • 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.