-
Notifications
You must be signed in to change notification settings - Fork 6
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
Adding NaN thresholding #32
Comments
I am not sure how easy this will be for the conservative method. To make computations fast, we reduce the coordinates one at a time. So we can only define a nan threshold per reduction. For example, a 3x3 grid is reduced to 1x1: 0, 1, 0 First reduce first dim: 0.33, Then reduce second dim: NaN (or 0.16) I guess the NaN threshold here can be 1/9. Which means that for 2 dimensions being reduced the NaN threshold is 1/3 per dimension 🤔 This also means that the for the second reduction the weights have to be adjusted. Currently if you'd not mask the NaNs out, the result would be 0.11 (as the NaN counts for value of 0). |
Yeah, I thought it may complicate the process, especially given the current methodology. I am having trouble thinking of a way to implement this efficiently. Tracking the NaN fraction and adjusting the threshold as you move across dimensions is likely no more efficient that utilizing the traditional methodology of conservative regridding... |
I think it is possible, but not easy to do, especially if NaNs appear over time on one lat/lon location. There would be additional overhead in the computation too. If there are just a few NaN values in your data then interpolating those before regridding is probably the best solution. |
It would be cool to add the ability to set the NaN thresholding similar to what is done in xESMF. Currently
most_common
andconservative
have a NaN thresholding of 1, but it would be nice if a user could specify this value.The text was updated successfully, but these errors were encountered: