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

Extrapolation seems to only work if input mask is set? #263

Open
axelschweiger opened this issue May 9, 2023 · 3 comments
Open

Extrapolation seems to only work if input mask is set? #263

axelschweiger opened this issue May 9, 2023 · 3 comments
Assignees

Comments

@axelschweiger
Copy link

I'm regridding some 2D grids (time,lat,lon) that requires some extrapolation. It works fine when I specify a mask for both input and output for each time. However, since my input mask varies slightly over time that doesn't work. The documentation suggests that an input mask isn't necessary if the data to be regridded that correspond to the mask are already set to "nan". Since it is a pretty large grid/time recomputing weights doesn't work. I'm a bit confused if I can use adaptive masking for this and how?

Since the input data are sizable, creating a working sample is a bit hard so I'm trying to see if somebody has maybe found a solution already.
Thanks
Axel

@aulemahal
Copy link
Collaborator

aulemahal commented May 10, 2023

Sadly, extrapolation indeed only works if the mask is set. This is a consequence on how adaptive masking is an addition from xESMF whereas extrapolation is a feature from ESMF itself.

Regridding in xESMF is two step process : compute the regridding weights first and then apply them to the data. The adaptive masking occurs in the latter step, while the extrapolation occurs in the former. Extrapolation needs to know which points are "unmapped", which is done through masking. at weight compuation time. Adaptive masking is implemented as an on-the-fly modification of the pre-computed weights at regridding time.

I fear that making extrapolation work with adaptive masking would either necessitate to reimplement extrapolation within xESMF OR implement adaptative masking within ESMF. Both solutions are out-of-scope for xESMF, as far as I understand...

@axelschweiger
Copy link
Author

axelschweiger commented May 10, 2023 via email

@aulemahal
Copy link
Collaborator

Ah true, this can be reasonable solution depending on the data!

I'll keep this issue open as a reminder that this should be explained in the doc. For example, the "extrapolation" section could mention that this is requires a mask and is unavailable with adaptive masking.

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

3 participants