-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Resample interpolate failing on tutorial dataset #1605
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
Comments
(sorry, originally commented from my work account) The tutorial dataset is ~6-hourly, so your operation is a downsampling operation. We don't actually support interpolation on downsampling operations - just aggregations/reductions. Upsampling supports interpolation since there is no implicit way to estimate data between the gaps at the lower temporal frequency. If you just want to estimate a given field at 15-day intervals, for 00Z on those days, then I think you should use |
@darothen - Thanks and interesting. I'm getting the above error in a real world resample operation so I figured they were the same issue. I'll dig into this and add some more detail in a bit. |
Okay, I got it now. Consider this example dates = pd.date_range('2016-01-01', '2016-12-31', freq='D')
# orig = dates[dates != '2016-02-29'] # drop feb 29 and this example will work
orig = dates
da = xr.DataArray(np.random.random((len(orig), 2, 3)), dims=('time', 'x', 'y'), coords={'time': orig})
print(da)
da.resample(time='1D').interpolate('linear')
The application here is that I'm doing a QC check on a dataset that is sometimes missing Feb 29. It is sufficient for my application to always resample and fill Feb 29 when its missing. The pandas equivalent works: s = pd.Series(np.random.random((len(orig))), index=orig)
new = s.resample('1D').interpolate('linear')
new.equals(s)
I think I have a fix for this which I'll push up quickly. |
I'm getting some unexpected behavior/errors from the new resample/interpolate methods.
@darothen - any idea what's going on here?
The text was updated successfully, but these errors were encountered: