Determining the number of samples used in fldavg
Added by Brendan DeTracey about 2 years ago
Hi Everyone,
I need to find the number of valid samples used by the fldavg
command. (Background: I am running the selregion
command on CMIP6 ocean model data and need to know the total number of valid data points within the boundary.)
I have uploaded a sample file. Do we need a fldcount
command? I have looked through the cdo documentation and can't find a suitable command. I thought one of the info
commands might report this, but I do not see it.
Thanks!
Replies (2)
RE: Determining the number of samples used in fldavg - Added by Estanislao Gavilan about 2 years ago
Hi Brendan,
I do not know how to do it in cdo, but you can do this easily with pandas. If you load the data in python and transform you deta into a single column dataframe, you can use the command groupby to select the data, and then count it. I know it is not what you are looking for, but you can use it until you get a proper cdo solution.
Regards,
Estanislao
RE: Determining the number of samples used in fldavg - Added by Uwe Schulzweida about 2 years ago
Hi Brendan,
In the next CDO bugfix relase 2.1.1 there will be the operator fldcount. This operator counts the number of non-missing values of the field. This is not necessarily the number of valid values of a statistical operation. The fldavg operator is very special when it comes to missing values (see: https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-510001.9.1).
Usually rather fldmean is used when missing values are present.
Cheers,
Uwe