-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New Resample-Syntax leading to cancellation of dimensions #2356
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
|
Thank you @dcherian . Do you think, that two times giving the dimension time as argument is useful? OR MAYBE i understand everything wrong: |
The repeated dimension follows pandas syntax. It's nice because the syntax is similar to the usual reduction
|
It means resampling with frequency='M' *along coordinate named 'time'.
It should be data["TOT_PREC"].resample(TIMES="M").sum(dim='TIMES') |
BTW, is this API (repeated dimension names) intended? |
Oh sorry, i was mistaken. Looks like pandas does not require the repeated dimension. https://pandas.pydata.org/pandas-docs/stable/timeseries.html#resampling The current API works like |
Fixed in 0.13.0 |
Example
Starting with the dataset located here: https://swiftbrowser.dkrz.de/public/dkrz_c0725fe8741c474b97f291aac57f268f/GregorMoeller/,
I want to calculate monthly sums of precipitation for each gridpoint in the daily data:
Problem description
The problem is that the dimensions 'rlon' and 'rlat' and the corresponding coordinates have not survived the resample process. Only the time is present in the result.
Expected Output
I expect to have the spatial dimensions still in the output of monthly sums. The surprise is, that this is the case using the old syntax:
What is wrong here?
And maybe I can also ask the question why the new syntax did not consider use cases with high complex scripting? I do not like to use in my programs a hardcoded dimension name, i.e.
time=${freq}
instead ofdim=${dim}; freq=${freq}
.The text was updated successfully, but these errors were encountered: