-
Notifications
You must be signed in to change notification settings - Fork 8
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
Regridding to larger grid not resulting in NaNs where no starting data #31
Comments
Similar to #14 |
This would be a good issue to fix. I think that the best way to implement this for the conservative regridder would be to compute a mask (only if the data cannot cover the target grid), and replace all values under that mask with np.nan Doing this inside the actual routines is challenging, as we have to mask NaNs out some way to avoid the entire matrix becoming NaN. |
Yeah, the masking could work. Were you thinking that this would be something that occurs after the regridding? Like a final step? |
I think it's the most simple solution. It would be possible to reduce the target grid for regridding (so it fits the data) and then pad NaNs after regridding, but that's a bit more complex and possibly not worth the effort. |
When regridding from a smaller spatial extent to a larger spatial extent, I would expect
NaN
s to be the resulting values in regions of the target grid where no data was present in the original data. This is the result when regridding using the methods that utilizedxarray.interp
(i.e.,linear
,cubic
,nearest
). However, this is not the case forconservative
andmost_common
. I have included an example below.The text was updated successfully, but these errors were encountered: