sample_crs_addition notebook does not preserve global attributes
The sample_crs_addition
notebook provides an example for adding a crs
variable to an existing zarr dataset without having to rewrite the entire dataset. Unfortunately the to_zarr()
call will always remove existing global attributes from the destination dataset. This has been submitted as an issue with the xarray developers (https://github.com/pydata/xarray/issues/8755). A work around is to add the existing global attributes to the dataset containing the new variables and then write the entire new dataset using to_zarr()
. Writing a selection of the new variables will result in existing global attributes being removed and no new global attributes getting written.