Operator to count periods
Added by Becky Nibbs over 4 years ago
Hello,
I have daily mean files of ocean pH stored by year, which I have converted to a 0,1 mask where the pH falls below a certain threshold – is there an operator available to count the number of periods (not days) in each year where the mask = 1, with 0 marking the end of each period? I would like the outcome to be an annual file which has the total number of periods in each grid cell.
I have had a look at consects and consecsum but I don’t think they are right for what I am trying to achieve.
Thanks,
Becky
Replies (1)
RE: Operator to count periods - Added by Karin Meier-Fleischer over 4 years ago
Hi Becky,
I would guess that consecsum is what you are looking for. It counts the number of periods.
See https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#page.97
For example if the threshold is 5
cdo -consecsum -gtc,5 infile outfile
-Karin