Project

General

Profile

How change NaN values?

Added by Guilherme Martins almost 3 years ago

Hi all,

I'm trying to change the NaN values in my file but I'm not capable. I tried the setmissval (cdo setmissval,-999.9 if.nc of.nc) but it doesn't work.

When I type cdo infon the result is:

-1 :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter name
1 : 2008-01-01 00:00:00 0 27216 0 : -nan -nan -nan : prec
2 : 2008-01-02 00:00:00 0 27216 0 : -nan -nan -nan : prec
3 : 2008-01-03 00:00:00 0 27216 0 : -nan -nan -nan : prec
4 : 2008-01-04 00:00:00 0 27216 0 : -nan -nan -nan : prec
5 : 2008-01-05 00:00:00 0 27216 0 : -nan -nan -nan : prec
6 : 2008-01-06 00:00:00 0 27216 0 : -nan -nan -nan : prec
7 : 2008-01-07 00:00:00 0 27216 0 : -nan -nan -nan : prec
8 : 2008-01-08 00:00:00 0 27216 0 : -nan -nan -nan : prec
9 : 2008-01-09 00:00:00 0 27216 0 : -nan -nan -nan : prec
10 : 2008-01-10 00:00:00 0 27216 0 : -nan -nan -nan : prec

I'm sending a piece of my file (tmp.nc) and the ncdump file (ncdump.txt).

Any help is very appreciated.

Thanks,

Guilherme.

tmp.nc (5.06 MB) tmp.nc
ncdump.txt (2 MB) ncdump.txt

Replies (2)

RE: How change NaN values? - Added by Uwe Schulzweida almost 3 years ago

The _FillValue attribute is missing in the netCDF File. In this case you need to set it e.g. with

cdo setmissval,nan ifile ofile
Then you can change it to -999.9:
cdo setmissval,-999.9 -setmissval,nan ifile ofile

RE: How change NaN values? - Added by Guilherme Martins almost 3 years ago

Dear Uwe,

Thank you for your help.

Guilherme.

    (1-2/2)