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

Implement ESMPy.Regrid extrapolation and ESMPy masking functionalities #93

Open
RondeauG opened this issue Apr 22, 2020 · 3 comments
Open

Comments

@RondeauG
Copy link

RondeauG commented Apr 22, 2020

Related to Issue #22.

As of ESMPy 8.0.0, multiple new parameters have been added to ESMPy.Regrid (doc). I am mostly interested in regridding while avoiding NaNs, which is now possible with "extrap_method", "extrap_num_src_pnts" and "extrap_dist_exponent".

If this is my source
image

and this is my destination grid
image

This is what I obtain with bilinear interpolation using xESMF:
image

while this is what I can get using ESMPy-compatible masks (on both grids) and "extrap_method":
image

@RondeauG
Copy link
Author

I will try to work on a PR in the coming weeks.

@RondeauG
Copy link
Author

RondeauG commented Apr 27, 2020

I've managed to implement masks, but extrapolation is impossible if the weights are written on disk, as the function ESMP_FieldRegridStoreFile in ESMPy is deprecated and does not include the latest extrapolation options.

I will explore further by keeping the weights in memory (PR #91)

Edit: It immediately worked with PR #91. I will try to submit a PR in a couple days once I've cleaned up my edits.

@Plantain
Copy link

This functionality looks great and is definitely going to be an improvement for my usecases.

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

No branches or pull requests

2 participants