Peter Szabo a écrit :
Hi Patrick,Not at all.
try something like this in the beginning of your script (the leftover is not necessary):
let b = If a le 0.45 then 1
!i changed it intentionally. you will have missing values instead of 1 at the right points
let conseq=b[i=@cda:1] !with @cda you will have the data in a format like ,,5,4,3,2,1,,,, instead of ,,1,1,1,1,1,,,,
let whereis5=conseq[i=@loc:5]
!the @loc finds the start of the consecutive events. in this case 5.
Is this what you wanted?
I would like the result as followsOk thank you anyway.
5 events of 1 consecutive values at 1
4 events of 2 consecutive values at 1
1 event of 3 consecutive values at 1
3 events of 4 consecutive values at 1
Good try.
Patrick
--
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
IPSL Global Climate Modelling Group
--