-
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
Better degree_days_exceedance_date and ensemble stats #1647
Conversation
Would it be better to mark the value of |
Indeed, that could be an option. Then if we want to implement "put the last doy" we need to find how to specify that with |
I am not sure I understand what you mean by "last doy of the period" ? Is it the last day that it was reached on other years ? the day before |
Oh I meant the last day of the period. Like with freq='YS', that would be 365 or 366 according to the calendar. So when the sum is never reached, the indicator would return the largest "doy" possible. I'm not sure if this makes sense at all though. |
As a GIS person, I'm not a fan of a having a dynamic value acting as a |
I see. I guess it could make sense in some cases, but may not make a lot a sense depending on the Also, it is not that hard for the user to put "12-31" (in the case of YS). I guess the advantage of "last" is that is works even if "12-31" doesn't exist like for a 360_day calendar ? |
For context, the goal of having a "never_reached" value was not only to be able to filter it like a different NaN, but to include it in the ensemble mean in a way that made sense for the context (in climatedata.ca, only the ensemble mean is given). In my case study, where I was looking at the beginning of the ice road season, the |
Ah, that helps clarifies things. It also leaves me feeling like this problem is even more complicated. What values could we accept in
If we offered these options, would we want to provide a default value? I feel like we wouldn't. |
ah! Well in that case, indeed making it possible to pass a "DayOfYearStr" makes sense. I'll abandon the idea of "last". So the options are now:
(in reality, any non-none and non-string input is directly assigned, so floats are also possible) |
Yes, but would also covers cases where |
Can we cast/demand an |
Side note: We're waiting on comments from the PCIC and Climatedata.ca collaborators. This PR should not be merged before Friday (February 16th) to give them a chance to weigh in. |
We already return day-of-year as float because of that. We have the I put |
I'm guessing that Pandas' nullable int is still far from being supported. Makes sense. |
No additional comments from ECCC - thanks! |
Pull Request Checklist:
degree_days_exceedance_date
nans cause issue on climatedata.ca #1459number
) and pull request (:pull:number
) has been addedWhat kind of change does this PR introduce?
Implements two solutions for #1459.
min_members
argument to ensemble stats functions. Simply mask elements when there are fewer valid (non-nan) members than this threshold. Similar tomin_periods
of xarray'srolling
, but with a different default value.never_reached
argument todegree_days_exceedance_date
. A value (int, doy) to assign when thesum_thresh
is not reached at the end of the period, to differentiate from missing values.Does this PR introduce a breaking change?
No. Both default options preserve the previous behaviour (which means
min_members
doesn't have the same default as it's inspirationmin_periods
).Other information:
Both solutions are distinct. For
climatedata.ca
, I think onlymin_members
would be useful ?Another option for
never_reached
would be to assign the last doy of the period, would that be interesting ? @juliettelavoieTo keep the annotation simple, we could do that if -1 is passed ?