[Thread Prev][Thread Next][Index]

Re: nan



Hi Frank,

one way is to use sed under unix; 
you write 
1,$s/nan/ -1.e+34/g
into a file called, say, xx. Then

ncdump levitus94_temp.cdf | sed -f xx

will dump the netcdf file and replace all nan with
 -1.e+34 and write it to stdout for checking. Now you only 
should only have to recreate a netCDF file from there.

You might want to consider to avoid the nan in the
first place - put the missing value in your output
variable before you write into it.

Good luck,
Joerg



Frank and Michele Schenk wrote:
> 
> Hello all,
> 
> I have 'nan' inside of my netcdf data file.  This
> causes strange results when plotting.  What can I do
> to get rid of or change the nan values.  I'd like to
> change them to missing values or make them equal to
> good data values surrounding them.
> 
> DATA SET: ./levitus94_temp.cdf
>                131.5W 130.5W 129.5W 128.5W 127.5W
> 126.5W 125.5W 124.5W 123.5W 122.5W 121.5W 120.5W
>                229    230    231    232    233    234
>   235    236    237    238    239    240
>  47.5N / 138:   8.68   8.76   8.80   8.81   8.80
> 8.81   8.84   8.96nan    nan    nan    nan
> 
> Thanks,
> 
> Frank Schenk
> Naval Postgraduate School
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com

--
Jörg Kaduk                            Tel.: 1 650 325 1521 x 416
Carnegie Institution of Washington    FAX: 1 650 325 6857
Dept. of Plant Biology
260 Panama Street                     joerg@jasper.stanford.edu
Stanford, CA 94305-1297               http://Jasper.Stanford.EDU/joerg/


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement