I'm sure there is probably a drop-dead simple way to do this, but my brain is fried at the moment and I can't think of one. I'm trying to identify and count numbers of events that exceed a certain value in a time series. For example, a plot of the attached file yields:
I'd like to be able to count the number of events that exceed the red line (y=0.13). Sometimes there is 1 point > 0.13 (e.g. the first event above at x=40) and that is easy to count as a single signal. But sometimes there are 2 or more contiguous points > 0.13 (e.g. the second event above, at x=56, 57), yet should be counted as just one "event", not as 2 events.
How can this be done? I've attached a file with the above signal.