Project

General

Profile

cdo histcount does not recognize missing values

Added by Malcolm Mistry over 9 years ago

Hello All,
I am trying to create bins of temperature (i.e. count of number of days of temp between 0-2.5, 2.5-5.0, 5.0-7.5 deg C...and so on, in 1971). The input file is 'daily mean temp in deg C for year 1971'. The file is global gridded at 0.5 x 0.5 deg, CDF compliant .nc4, with missing and fill values in attributes.

When I use the operator 'histcount', I expected that those grid points with missing values for all 365 days would be automatically flagged by 'histcount' as "NA" or "missing value" in the output file. Instead, 'histcount' gives me '0' which is not technically correct.

I was wondering if there is a way to instruct 'histcount' or another operator to only count over gridpoints with non-missing values. Or is 'histcount' suppose to do that and this is a bug? Note that 'histcount' works correctly over those grid points which have a value for all 365 days.

CDO Version: 1.6.3

Many thanks
Malcolm


Replies (3)

RE: cdo histcount does not recognize missing values - Added by Uwe Schulzweida over 9 years ago

Hello Malcolm,

Yes this is a bug, thanks for the information! We will fix this bug in the next release.

Cheers,
Uwe

RE: cdo histcount does not recognize missing values - Added by Malcolm Mistry over 9 years ago

Many thanks for your clarification. I was going crazy trying to figure out why.

Cheers
Malcolm

RE: cdo histcount does not recognize missing values - Added by joao ferreira over 2 years ago

Hi

I'm trying to use histcount to know what is the dominant wind direction (8 directions...) for each grid point on each 24 hours day (i have 24 hourly directions each day...)

I'm doing:

cdo -histcount,0,45,90,135,180,225,270,315,+inf -selday,1 -selmonth,1 -selyear,2010 hourly_DIR_mercator.nc count.nc

This gives me the number of ocurrences on each direction bin, but now I want to choose the highest one to be the unique direction for the day...

For example, if I have 13 ocurrences for the bin between 0 and 45, I want to assign 0 to this day, because no other bin can have more than 13, since the total is 24...

Also, I have a unique file with all timesteps and I wanted to avoid the -selday,$day -selmonth,$month -selyear,$year stuff... Can it be done?

    (1-3/3)