You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xarray supports a very simple form of seasonal grouping: groupby("time.season") which has a fixed definition of seasons: DJF, MAM, JJA, SON, and doesn't enforce proper ordering of the output (the seasons get sorted as a string to give : DJF, JJA, MAM, SON :/ )
We support a little more complex resampling using Pandas syntax .resample(time="QS-Jan") for example, but I think this is limited to seasons of 3 months long.
User Requests
A quick scan of issues, discussions, and StackOverflow shows that our users want more control over how seasons are specified.
Don't include "incomplete" seasons in output.
allow custom season definitions (e.g. of varying length, overlapping seasons).
The problem of custom seasons is simply that of converting the seasons to proper integer codes. Our relatively new Grouper objects provide this extension point.
I have implemented this in #9524 (docs). The code isn't pretty and probably doesn't scale well for very long time vectors, but I focused on correctness and tests.
Describe alternatives you've considered
This could live outside Xarray, but is such a common ask from our userbase, that it seems worth of inclusion.
The text was updated successfully, but these errors were encountered:
TLDR
I propose merging #8524 (docs) to provide this new API (after review).
Is your feature request related to a problem?
Current Status
Xarray supports a very simple form of seasonal grouping:
groupby("time.season")
which has a fixed definition of seasons:DJF, MAM, JJA, SON
, and doesn't enforce proper ordering of the output (the seasons get sorted as a string to give :DJF, JJA, MAM, SON
:/ )We support a little more complex resampling using Pandas syntax
.resample(time="QS-Jan")
for example, but I think this is limited to seasons of 3 months long.User Requests
A quick scan of issues, discussions, and StackOverflow shows that our users want more control over how seasons are specified.
Here is a list of user requests:
Describe the solution you'd like
The problem of custom seasons is simply that of converting the seasons to proper integer codes. Our relatively new Grouper objects provide this extension point.
I have implemented this in #9524 (docs). The code isn't pretty and probably doesn't scale well for very long time vectors, but I focused on correctness and tests.
Describe alternatives you've considered
This could live outside Xarray, but is such a common ask from our userbase, that it seems worth of inclusion.
The text was updated successfully, but these errors were encountered: