Project

General

Profile

Properly weighted seasonal means from monthly data

Added by Joe Hamman almost 11 years ago

There is a function to properly weight yearly means from monthly data (yearmonmean) but I can't seem to find one for seasonal means? Has anyone done this using CDO and what's the best way to go about it?

Thanks,

Joe


Replies (8)

RE: Properly weighted seasonal means from monthly data - Added by Matt Thompson almost 11 years ago

Joe,

Does an operator like seasmean or yseasmean do what you want? If not, you could probably use timselmean to do it as there is an example that seems to echo what you want:

Assume an input dataset has monthly means over several years. To compute seasonal means from monthly means the first two month have to be skipped:
  cdo timselmean,3,2 ifile ofile

RE: Properly weighted seasonal means from monthly data - Added by Joe Hamman almost 11 years ago

yseasmean does what I want except it does not take into account the different weights (days per month) of individual months. yearmonmean does do this for yearly averages but I don't think there is a yseasmonmean. I've tried, unsuccessfully to string together yseasmean something like muldpm. I'm sure there is a way to do this but I'm not sure what the right chain of operators would be.

RE: Properly weighted seasonal means from monthly data - Added by François Roberge almost 7 years ago

Hi Joe,

Did you ever find a solution for this? There doesn't seem to be any cdo command that does it.

Thank you,

François Roberge

RE: Properly weighted seasonal means from monthly data - Added by Karin Meier-Fleischer almost 7 years ago

Hi Françoise,

try

cdo -ymonmean infile.nc outfile_ymm.nc

cdo -seasmean outfile_ymm.nc outfile.nc

-Karin

RE: Properly weighted seasonal means from monthly data - Added by François Roberge over 6 years ago

Hi Karin,

Yes but by doing this way, the seasonal means won’t be weighted according to the number of days per each month.

Thank you,

François

RE: Properly weighted seasonal means from monthly data - Added by XR Chua over 4 years ago

Here is one workaround, using DJF as an example:

cdo -ymonmean infile.nc tmp1.nc
cdo -selmon,12,1,2 tmp1.nc tmp2.nc
cdo -timmean tmp2.nc outfile.nc

RE: Properly weighted seasonal means from monthly data - Added by François Roberge over 4 years ago

XR Chua wrote:

Here is one workaround, using DJF as an example:

cdo -ymonmean infile.nc tmp1.nc
cdo -selmon,12,1,2 tmp1.nc tmp2.nc
cdo -timmean tmp2.nc outfile.nc

HI Xr Chua,

tmp1.nc contains only one timestep per month so by doing timmean, you are doing the mean over three time steps which doesn't consider the weights according to the number of days per each month.

Thank you,

François

RE: Properly weighted seasonal means from monthly data - Added by XR Chua over 4 years ago

My bad, I meant yearmonmean instead of timmean:


cdo -ymonmean infile.nc tmp1.nc
cdo -selmon,12,1,2 tmp1.nc tmp2.nc
cdo -yearmonmean tmp2.nc outfile.nc

Thanks for the catch!

    (1-8/8)