Finding the 20 day periods with values above a specific threshold, before the start date of flash drought

Hi! I need some help as I am stuck in a google spiral… I have a dataset of soil moisture values which represent possible start dates for a flash drought, and the rest of the soil moisture values are NaN. I need to find the 20 day time periods before each of these dates, that are not NaN, which have an evapotranspiration rate of 4/5 of the climatological ET average, so I can filter out the dates which don’t match that criteria. Any tips as to how I can find these 20 day periods before each day of soil moisture values which are not NaN? The data is daily.

1 Like

I am sure I remember a problem like this coming up before on the CMS help, but I no longer have access to that system. Can one of the CMS team search and see if there was a prior solution? @holger ?

A non-specific answer: check out this blog post written by @Scott about event detection:

It is a good place to start with this problem.

1 Like

Hi @aidanheerdegen

I’m quite busy at the moment, but I did a quick search through the ticketing system, and I found this old ticket in which you point towards one of your own github repos, specifically here:

Is that what you were looking for?


Hey thanks @holger! Yes I think it is. I searched in my gists, but didn’t think of looking through repos.

Is that code of any use @aklj1997?

I’ll have a look! But I also got some help with it from my supervisor, so should be on track either way. Thank you!

1 Like