Skip to content

Calculating indicators for winter months #1793

Closed Answered by coxipi
TarekAMZ asked this question in Questions
Discussion options

You must be logged in to vote

Hmm, it seems that resample in the indicator reintroduces times that were cut off, e.g. here is a minimal code showing this:

sub_pr  = xclim.core.calendar.select_time(pr, month=[1,2,12], drop=True)
sub_pr.resample(time="QS-DEC").mean().time

times outside the winters are also present.

Since all times are masked outside the winter season, you can also use YS-DEC, now I think about it, it's really what you asked for in the beginning haha, should have thought of that directly! :

xclim.atmos.dry_spell_total_length(pr, freq="YS-DEC", month=[1,2,12])
>>> [nan, 31., 22., 30., nan]

that gives the appropriate output.

Cheers!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@TarekAMZ
Comment options

@coxipi
Comment options

Answer selected by TarekAMZ
@TarekAMZ
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions and help for users/developers
2 participants