Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute bounds for curvilinear grids #96

Closed
aulemahal opened this issue Sep 29, 2022 · 2 comments · Fixed by #174
Closed

Compute bounds for curvilinear grids #96

aulemahal opened this issue Sep 29, 2022 · 2 comments · Fixed by #174
Assignees
Labels
enhancement New feature or request

Comments

@aulemahal
Copy link
Collaborator

Generic Issue

Conservative methods of xESMF (and thus the SpatialAverager) need the longitude and latitude bounds to compute. This is trivial to compute on rectilinear grids: cf_xarray does it for xESMF automatically.

It is non-trivial for curvilinear grids, but possible as such a grid is the projection of a rectilinear grid (at least I think this is the definition of "curvilinear"...). Thus, it is doable by trivially generating the bounds from the original rectilinear grid and then projecting them to a PlateCarree reference system.

I once did this, using cartopy to parse the CF grid mappings into a pyproj object. I'm not sure if cf_xarray would be ok with adding the code there since it would mean having these two package as dependencies (and they aren't light). However, I think we could implement something here first and move it upstream someday.

Part of my old solution lies here : https://gist.github.com/aulemahal/4873db65992369420a96834026b33470

@aulemahal aulemahal added the enhancement New feature or request label Sep 29, 2022
@aulemahal aulemahal self-assigned this Sep 29, 2022
@aulemahal
Copy link
Collaborator Author

@aulemahal
Copy link
Collaborator Author

Finally simple interpolation seems to do the job quite well : xarray-contrib/cf-xarray#370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants