[ncl-talk] two miising values

Mary Haley haley at ucar.edu
Thu Jun 2 15:59:07 MDT 2016


Geeta,

You will need to approach this with two steps.

First, since this data is of type "short" and has scale_factor and
add_offset attributes, you should read the data using "short2flt", which
will apply these attributes for you. Afterwards, use "printVarSummary" and
"printMinMax" to make sure the data looks okay.

Second, whenever your data has multiple missing value values, you can use
the "where" function

First, use "-9999" as your standard missing value:

rf at _FillValue = -9999

Now that "-9999" is a recognized missing value, you can then coerce the
-88.88 value to missing as well:

  rf = where(rf.eq.-88.88,rf at _FillValue,rf)

Note: it's not generally a good idea to do a straight comparison of float
data with "if(x.eq.12.34)" type of comparisons. If you know that all your
data is positive, for example, except for the potential -88.88 value, then
a better way to do this is:

  rf = where(rf.lt.0,rf at _FillValue,rf)

Or, if you feel more comfortable about comparing values that are closer to
-88.88. then use a roundoff of -88:

  rf = where(rf.lt.-88,rf at _FillValue,rf)

This will then catch anything less than -88 and set it to missing.

http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml

--Mary


On Thu, Jun 2, 2016 at 12:37 PM, Geeta Geeta <geetag54 at yahoo.com> wrote:

> I am using TRMM data that has rain rate in vertical up to 20 km from the
> Radar .
> the variable "rain" has data type as short
> Variable: RF
> Type: short
> Total Size: 72496480 bytes
>             36248240 values
> Number of Dimensions: 3
> Dimensions and sizes: [nscan | 9247] x [nray | 49] x [ncell1 | 80]
> Coordinates:
> Number Of Attributes: 9
>   lat2d : <ARRAY of 453103 elements>
>   lon2d : <ARRAY of 453103 elements>
>   scale_factor : 100
>   scale_factor_err :   0
>   add_offset :   0
>   add_offset_err :   0
>   calibrated_nt : 22
>   units : mm/hr
>   hdf_name : rain
> (0)
> (0) min=-9999   max=9783
>
> It has two types of missing values -88.88 (referrred to as the ground
> clutter) and -9999 as the missing value.
> I have to plot this data . ho w should i put two values as miising?
> I am getting a plot like this.
>
> Geeta.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160602/c5e7a7a3/attachment.html 


More information about the ncl-talk mailing list