Project

General

Profile

ensmean help

Added by Anna marra about 9 years ago

Hi,
I am using cdo ensmean in order to calculate mean rainfall rates from different radiometer estimates. Ensmean works perfectly and it calculates the mean rainfall rate for each grid point, by taking into account also the missing values. Because I do not have the same number of overpasses of the radiometers on each grid point, I would like to know if it is possible to add, by means of some cdo operator, a new variable to the nc output file, which "counts" the number of meaningful values from which the mean rain rate has been calculated. Can anyone help me?
Thank you.
A C Marra


Replies (5)

RE: ensmean help - Added by Jaison-Thomas Ambadan about 9 years ago

create a mask (ones and zeros) for each radiometer data using the comparison operators, and enssum give you the "count" I guess. For more info regarding comparison operators: https://code.zmaw.de/projects/cdo/embedded/1.6.4/cdo.html#x1-1470002.5

here is an example, assuming that the precipitation rate is +ve and the missing values are properly set

cdo -gtc,0 ifile00 mask_ofile00
cdo -gtc,0 ifile01 mask_ofile01

cdo -enssum mask_ofile00 mask_ofile01 ofile

should give the "count" at each grid point; to create a "count" variable, just rename (use chname) the original variable to "count" and merge to your data

Hope this helps

RE: ensmean help - Added by Anna marra about 9 years ago

Hi,
it works very well! It is just what I was looking for.
Thank you very much for your help.
AC Marra

RE: ensmean help - Added by Anna marra about 9 years ago

Hi, one more question about ensmean. If I have files with two or more variables, is it possible to select one variable (for example rain rate) to calculate the mean and another variable (for example the "count" of the previous question) to be summed by means of enssum? At the moment if I use ensmean, it calculates the mean of all the variables. Maybe I have to split the file in different files, each one containing one variable?
Thank you in advance.
AC Marra

RE: ensmean help - Added by Jaison-Thomas Ambadan about 9 years ago

I don't think it is possible to chain ensmean, enssum operators. Please have a look at the CDO doc section 1.2.4 Operator chaining: https://code.zmaw.de/projects/cdo/embedded/1.6.4/cdo.html#x1-100001.2.4 for more info regarding the same. (you may try with select operator, e.g., cdo -ensmean -select,name=pr_rate 'ifiles*' ofile)

Maybe I have to split the file in different files, each one containing one variable?

the SPLIT operators may be helpful: https://code.zmaw.de/projects/cdo/embedded/1.6.4/cdo.html#x1-880002.2.6

Cheers,
J

RE: ensmean help - Added by Anna marra about 9 years ago

Hi,
I have done by splitting and again merging, after applying ensmean and enssum operators.
Thank you.
AC Marra

    (1-5/5)