You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 forxESMF
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 apyproj
object. I'm not sure ifcf_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
The text was updated successfully, but these errors were encountered: