[ncl-talk] two miising values

Mary Haley haley at ucar.edu
Fri Jun 3 08:52:43 MDT 2016


Geeta,

Are the -999900 and -888800 values correct? They seem a bit odd.  Perhaps
you are supposed to divide the data by the scale_factor rather than
multiple by it.  I think the "short2flt" function does a multiply.

Try this (UNTESTED):

   RF_short  =  hdf4_file->rain
   printVarSummary(RF_short)
   printMinMax(RF_short,0)

   Rf_fnl  = tofloat(RF_short) / RF_short at scale_factor
   copyVarMeta(RF_short,Rf_fnl)

   printVarSummary(Rf_fnl)
   printMinMax(Rf_fnl,0)

   Rf_fnl  =  where(Rf_fnl.eq.-88.88,Rf_fnl at _FillValue,Rf_fnl)
   printMinMax(Rf_fnl,0)

   Rf_fnl at lon2d      =  longitude
   Rf_fnl at lat2d      =  latitude

I added several "printVarSummary" and "prinMinMax" calls to make sure that
the conversions are working at every step.

If this continues to fail, it would help if I could have access to your
latest script and data.

--Mary

On Fri, Jun 3, 2016 at 2:04 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:

> thanks Mary for your suggestions..
> I was able to get the plot but I am getting a band like structure in the
> plot that is middle part is white. Dont know why???
>
> can u pls suggest.
>
> Geeta.
>
>
> On Friday, 3 June 2016 3:29 AM, Mary Haley <haley at ucar.edu> wrote:
>
>
>
> 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/20160603/3237c620/attachment.html 


More information about the ncl-talk mailing list