Open RondeauG opened 4 years ago
I will try to work on a PR in the coming weeks.
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.
This functionality looks great and is definitely going to be an improvement for my usecases.
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](https://user-images.githubusercontent.com/38501935/80031307-7c72c780-84b7-11ea-8254-fbea40beefc0.png)
and this is my destination grid![image](https://user-images.githubusercontent.com/38501935/80031242-695ff780-84b7-11ea-9d48-1bdc01feb9c5.png)
This is what I obtain with bilinear interpolation using xESMF:![image](https://user-images.githubusercontent.com/38501935/80031376-957b7880-84b7-11ea-96a2-97555f027220.png)
while this is what I can get using ESMPy-compatible masks (on both grids) and "extrap_method":![image](https://user-images.githubusercontent.com/38501935/80031485-bd6adc00-84b7-11ea-8271-5f545fd95842.png)