Project

General

Profile

Yearly statistics on a period over two calendar years

Added by Pauline Millet over 2 years ago

Hello all,

I'm computing yearly statistics on my data with sometimes a month selection. Up to now the selected period was stretched over the same calendar year (ex: from March to June). I'm now facing the issue where I have to deal with period that are not on the same calendar year, let's say from November to February.

Can I still apply a command like the following one to get my statistics?

cdo -yearsum -select,month=11/2 infile outfile

Or should I proceed twice my yearly stat: first on November and December, then on January and February, and combine them to get the wanted result?

What is the best way to achieve this?

Thanks for your help,
Pauline


Replies (4)

RE: Yearly statistics on a period over two calendar years - Added by Karin Meier-Fleischer over 2 years ago

Hi Pauline,

your selection is the 'season' NDJF and you can use the Seasonal statistical values operators (https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#subsection.2.8.27) after selecting, as you did or with season=NDJF, compute the sum of the season.

cdo -seassum -select,season=NDJF infile outfile

RE: Yearly statistics on a period over two calendar years - Added by Pauline Millet over 2 years ago

Thanks for your answer Karin! I didn't know about seasstats operators.

How would you process with a period being from 7th of december to 23rd of April?
Something in 2 steps like:

cdo -mergetime -selday,7/31 -selmonth,12 infile -selmonth,1/3 infile -selday,1/23 -selmonth,4 infile tempfile
cdo -seassum tempfile outfile

? Or is there a simpler way to do it?

Cheers,
Pauline

RE: Yearly statistics on a period over two calendar years - Added by Pauline Millet over 2 years ago

Karin Meier-Fleischer wrote in RE: Yearly statistics on a period over two calendar years:

Hi Pauline,

your selection is the 'season' NDJF and you can use the Seasonal statistical values operators (https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#subsection.2.8.27) after selecting, as you did or with season=NDJF, compute the sum of the season.

[...]

Hi Karin,

After trying your solution, it seems like it's not working like I expected.
By applying :

cdo -seassum -select,season=NDJF infile outfile

CDO returns a value per year for November, and another one for December-January-February. I would expect to have one single value returned over November to February.

Any idea on how I could achieve this result?

Cheers,
Pauline

RE: Yearly statistics on a period over two calendar years - Added by Karin Meier-Fleischer over 2 years ago

Hi Pauline,

ah, CDO uses the default season start month which is December. You can change it to November by setting the environment variable CDO_SEASON_START to NOV or just use the following command

cdo -timselsum,4,2 -select,season=NDJF infile.nc outfile.nc

-Karin

    (1-4/4)