Skip to content

function to count extreme events #556

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

function to count extreme events #556

wants to merge 1 commit into from

Conversation

remicousin
Copy link
Contributor

I tried to think of a vectorial solution but couldn't. Probably because there is a "memory" aspect of the analysis: once a day is part of an extreme event, it can't be part of another one.

@remicousin remicousin self-assigned this Jul 17, 2025
#for following events (t loop) or longer events (w loop)
daily_data[{dim: slice(t, t+w)}] = (
daily_data[{dim: slice(t, t+w)}].where(~new_event)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm that I understood the method... this means that, for example, if the threshold is 100 mm over 3 days and I reach that accumulation on days [1st, 2nd, 3rd] (which would be detected as an extreme), and assuming the event continues, then the next extreme should be detected on [4th, 5th, 6th] instead of [2nd, 3rd, 4th]?

If above is correct, how is [2nd, 3rd, 4th] classified — which also has 100 mm in 3 days but isn't detected because days 2 and 3 are masked? Would this be considered a 'false extreme alert' and therefore discarded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, [2nd, 3rd, 4th] is not an extreme event because [1st, 2nd, 3rd]. Similarly, if all the rain fell in 1st, then [1st, 2nd, 3rd] is not an event, but [2nd, 3rd, 4th] could be. That's why I had to use loops rather than rolling or something alike.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants