-
Notifications
You must be signed in to change notification settings - Fork 48
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
Extrapolation and masking #97
Conversation
Will this deal with #17? I'm curious of how to mask these diluted grids ... |
Once #82 is approved, I will replace my masking with his since I missed that a PR was already in the works for that. Both methods use a similar approach. |
@RondeauG I tried to apply your pull request 97 to the latest version of ESMF to experiment with extrapolation. The regridding to higher resolution works but I do not see that the extrapolation works and the extent of interpolation is limited to the extent of the original grid. Is there a trick to doing the extrapolation or some option I need to enable? My code is a copy of your test that looks like this |
Hi @trondkr . There are indeed a few tips and tricks scattered around the various issues threads. Your issue regarding the extent is very likely linked to #15. This is solved by using the
As for your issue where the extrapolation does not seem to work, I have 2 possible fixes.
Here's the code I use locally to create my masks :
And so, your xESMF code could look something like that :
|
@RondeauG Thank you for the detailed help and explanation. I made a test script where I implemented your suggestions, but alas the extrapolation is still not doing what I hope it will do. I am interpolating and extrapolating (oxygen) from a 1/4 degree resolution grid to a 1/12th degree resolution grid (thetao). But the interpolation is only using the 1/4 degrees grid cells. I assume I am still doing something erroneous with regard to the masking. If you have time would you take a look at the short test script found on my Github here |
@trondkr I believe that I have found the problem.
Alternatively, just to make sure that the extrapolation works (and it does, in my case), I just used Hope this helps! |
@RondeauG Thank you so much! That solved my problem and extrapolation works like a charm! On a side note, I see that xesmf is moving over to pangeo-data but I do not see your pull request #97 in the current list of PR there? I certainly hope #97 will be included perhaps as part of #82 on pangeo-data. Thank you for your help. |
Great! Happy to have been of assistance. As for pangeo-data, I've seen a few of the discussions regarding the move, but I haven't had the time to look it up in details. If there's a need to re-submit a PR, I'll be happy to do so. |
Does pangeo-data/xESMF#1 override this? |
Hi @yuvipanda. I tested the pangeo-data master around a month ago and as far as I can tell, this Issue has indeed been addressed by the pangeo-data fork: https://github.com/pangeo-data/xESMF As development of xESMF will continue through pangeo-data, and since this issue was resolved in the pangeo-data fork, I think this issue can be closed. |
DOC: add conda in README
As discussed in Issue #93 (and earlier in #22), this adds the extrapolation functionalities of ESMPy 8.0.0 to xESMF. I also included masking functionalities that are compatible with ESMPy grids.
The changes are built on top of PR #91, since ESMP_FieldRegridStoreFile is outdated ("deprecated" even, based on a comment in the code) and does not include the new extrapolation functionalities. With #91, weights are kept in memory and the call to ESMF is instead made with ESMP_FieldRegridStore, which is up to date.
Masking is based on an automatic detection of a "mask" DataArray in the dataset.