Project

General

Profile

python vs cdo - timeseries mean

Added by Sarah O'Keefe over 6 years ago

Hi - I have a mystery. I have a little script that uses python to get the field and time mean of an input file that is on a regular latlon grid (see attached for script and file) . BUT when I run cdo fldmean, timmean I get a very different result. Any ideas what is going on? If it is the result of grid area weighting, is there any way to turn this off? Thanks! Sarah.


Replies (1)

RE: python vs cdo - timeseries mean - Added by Ralf Mueller over 6 years ago

Hi Sarah!
sorry for the delay.

Your assumption is correct - cdo fldmean is an area weighted mean value. np.mean is just a plain mean value

you can do a simple mean with cdo like this

cdo -divc,$(cdo -ngridpoints <ifile>) -fldsum <ifile> <ofile>

hth
ralf

    (1-1/1)