healpix_convert.prepare_healpix_dataset#
- healpix_convert.prepare_healpix_dataset(cache, settings, output_path, *, output_storage_options=None, dry_run=False)[source]#
Create a new Zarr dataset without any data resampled on the HEALPix grid (yet).
All output groups and arrays are created along with their metadata. Arrays having a HEALPix cell dimension are still empty.
The groups of the derived levels of the pyramids and the multiscales metadata describing them are created as well; their arrays are written by
generate_pyramids().Useful for multi-stage conversion workflows:
Use
create_staging_cache()first to create the conversion staging cache.Use
convert_group_to_healpix()later (maybe multiple times) to resample data on HEALPix and write it to the output dataset (fill arrays with data values).Use
generate_pyramids()then to aggregate the converted data onto the coarser levels of the pyramids.Use
finalize_healpix_dataset()last to consolidate the Zarr metadata of the output dataset.
- 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().output_path (
str) – Path to the HEALPix output Zarr dataset.output_storage_options (
dict, optional) – Storage options passed to Zarr for the dataset creation (useful for, e.g., writing on S3 object store).dry_run (
bool, optional) – If True, only display what would have been done. The output dataset also won’t be written to a persistent storage but instead will be created in-memory. No data conversion will happen (convert_data set to False). Default: False.
- Returns:
xarray.DataTree– The output Zarr dataset with HEALPix metadata and empty data, returned as an Xarray DataTree object.