healpix_convert.finalize_healpix_dataset#
- healpix_convert.finalize_healpix_dataset(cache, settings, output_path, *, output_storage_options=None)[source]#
Finalize the converted output dataset.
The last stage of the conversion, run once every group of the output dataset has been written (the pyramids included). It consolidates the Zarr metadata of the output dataset: the metadata of all the descendants of a group is copied into its own metadata document, so that a reader opens the whole hierarchy below it with a single read. The
consolidatemetadata settings select the groups it is written for (seemetadata).No other stage writes consolidated metadata, since such a copy is stale as soon as a node is written next to it. Converting the data does not make it stale, though: it only writes array chunks.
- Parameters:
cache (
ConvertStagingCache) – A data cache containing information extracted from the input dataset(s) and/or pre-computed for the output dataset, as returned bycreate_staging_cache()for the samesettings.output_path (
str) – Path to the converted HEALPix output Zarr dataset, updated in place.output_storage_options (
dict, optional) – Storage options passed to Zarr for reading the converted dataset and writing its consolidated metadata (useful for, e.g., writing on S3 object store).
- Returns:
xarray.DataTree– The finalized output Zarr dataset, returned as an Xarray DataTree object.