-
Notifications
You must be signed in to change notification settings - Fork 59
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
Dynamic time subset selection #1987
Comments
Hi @baptistehamon thanks for the question: This seems similar but not identical to In this case there is an obligatory aggregation operation applied to the date ranges but the dynamic indexing ideas seem close. From memory this was implemented to sum values (e.g.degrees days or precipitation) within a growing season which can have different start end dates every year as well as varying spatially |
That would be cool! My intuition tells me that a basic implementation of this wouldn't be to difficult, but that it would start to get tough when the full 3D mask (spatial x time) begins to be large and requires dask. A non-dask implementation could be a good first shot.
I think xclim-style would be |
Indeed, |
Hmm, yes we do tend to have a northern hemisphere bias... It might be possible to have this work with a more flexible use xclim/xclim/indices/generic.py Line 1253 in 4198e8b
Right now there is no user parameter for the @aulemahal do you see any major flaws in my thinking? Right now with the hard coded default |
Not exactly, in the case of yearly data, it uses the timestamp. The idea of the default is that So. If you compute start and end dates based on xclim indicators with freq |
I had a quick look and |
I implemented this option based on |
Seems good to me! |
I'm ready to do the PR but haven't done one before so I'm not familiar with this, especially the tests mentioned in the contributing documentation. Should I do that before the PR ? I've only done the pre-commit check so far |
Addressing a Problem?
Currently, the
xclim.indices.generic.select_time()
supports several indexers types. However, all of them are statics and compute indicators using the same bounds over space while computing them between "dynamic" bounds can be powerful. For example, in agroclimatology is often useful to compute indicators between two phenological stages that change across space (and time).I think it would be really interesting to have this option implemented.
Potential Solution
I'm thinking of providing
doy_bounds
as a tuple ofnp.ndarray
orxr.DataArray
but I'm not sure about the feasibility and the complexity of such implementation.Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: