Re: Missing values not recognized

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 19 Jul 2007 10:33:18 -0600

NCL recognizes the Unidata reserved attribute "_FillValue" to
indicate a missing value. The "_FillValue" is also the attribute
recommended by the Climate and Forecast (CF) netCDF convention.

  
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.0/ch02s05.html#missing-data

The attribute "missing_value" is recognized by the netCDF operators
and (I think) ncview. It is part of the COARDS netCDF convention.

If your variable WVAR has a missing_value attribute and does not have
an _FillValue attribute the add
 
          w = nc_file->WVAR(0,:,:,:)
          w@_FillValue = w_at_missing_value ; create _FillValue

D

Anthony C. Didlake, Jr. wrote:
> Hello,
>
> I'm having a problem with missing values in my NCL script. I'm reading
> in a NetCDF file and grabbing variables with them that have their
> missing value set to -999. However, when I apply NCL functions to
> these variables, it does not recognize the number -999 as missing, but
> rather as a data entry value. For instance, when I use the min
> function, it always returns -999 (even though all the values are not
> missing.) I also used the num and ismissing functions to count the
> number of missing values, and it always returns 0 (even though some
> values are missing.) Below is my script. Are there any reasons that
> this could happen?
>
> Thanks,
> Anthony
>
>
>
> load "/usr/local/ncarg/lib/ncarg/nclex/gsun/gsn_code.ncl"
>
> begin
>
> filename = "200508282031.nc"
> nc_file = addfile(filename,"r")
>
> w = nc_file->WVAR(0,:,:,:)
>
> min_w = min(w)
> x = num(ismissing(w(0,0,:)))
>
> print(min_w)
> print(x)
> print(w_at_missing_value)
>
> end
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 19 2007 - 10:33:18 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 19 2007 - 10:40:48 MDT