xarray-contrib / cf-xarray

an accessor for xarray objects that interprets CF attributes
https://cf-xarray.readthedocs.io/
Apache License 2.0
159 stars 41 forks source link

sgrid use cases & API #220

Open dcherian opened 3 years ago

dcherian commented 3 years ago

Our homework was to write down use cases to come up with a useful API.

I would like to eventually see a xesmf.to_uniform_grid(dataset, method="conservative") that would work on staggered grid datasets. This requires automatic inference of corner points given a set of dimension names.

malmans2 commented 3 years ago

I'd like a method to subsample a dataset preserving the native grid. I.e., after subsampling a dataset, the relative size/position of all axes does not change, and therefore all SGRID attributes are still valid.

Something like, .isel(X=slice(10, 20), Y=slice(10, 20), preserve_padding=True).

malmans2 commented 3 years ago

If preserve_padding=False, it would be nice to update the SGRID attributes accordingly.

aulemahal commented 3 years ago

In addition to the first suggestion above, I think a way to infer missing "paddings" would be nice. Say if only padding: none is available, corner inference could include inference of the two outer elements to come up with padding: both.