xarray-contrib/cf-xarray

sgrid use cases & API

dcherian opened this issue · 3 comments

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.

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).

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

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.