zarr-developers / VirtualiZarr

Create virtual Zarr stores from archival data files using xarray syntax
https://virtualizarr.readthedocs.io/en/latest/
Apache License 2.0
67 stars 10 forks source link

Use xarray's encode_cf / decode_cf functions to handle CF conventions #157

Open TomNicholas opened 1 week ago

TomNicholas commented 1 week ago

We might be able to replace some logic (especially that implemented in #156) with a call to xarray.decode_cf. This function can accept a Dataset and return a new dataset with different attributes and encoding etc. I think it's used internally in some of xarray's backends.

Also there is an idea to expose a corresponding xarray.encode_cf function in xarray, which we might also be able to use (see https://github.com/pydata/xarray/issues/4412).