Re: NCEP data missing values

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 04 2012 - 14:16:05 MDT

Yes I did. Sorry it was a holiday weekend here.
If the data in your file appears as type short, then it usually has an offset and scale factor as attributes for converting it to float. The NCL function "short2flt" will perform this conversion for you and hopefully will put the wind data values into a range that makes more sense.

Although NCL has some limited recognition of the attribute "missing_value", for most purposes NCL only understands the attribute "_FillValue". The line:
a30@missing_value = doubletoshort(-99)

does not do what you want. You need to change it to:

a30@_FillValue = doubletoshort(-99)

However, note that if you first call "short2flt" as:

 a30 = short2flt(a100->uwnd(0,0,:,:))

then a30 will be a float not a float and you will need to adjust your script accordingly.

Note for the record, that you can "accumulate" fill values in a data set, so supposing that a30 has 2 values that you want to be ignored by the plotting routines: -99 and 32766. You can say
a30@_FillValue = -99 ; _FillValue set to -99 and all values currently equal to -99 become fill values
a30@_FillValue = 32766 ; _FillValue becomes 32766; all values equal to the current fill value (-99) are changed to 32766, and all values currently equal to 32766 become fill values.

I note that although you convert your missing value to "short", you also speak of a value, 32766, that is out of the range of "short". It is in the range of "unsigned short". Recent versions of NCL have improved the handling of signed vs unsigned short, so if that seems to be an issue for you, you may want to upgrade your version of NCL.
 -dave

On Sep 4, 2012, at 12:58 PM, waqar younas wrote:

> Hi
> did u get my last email with code attached?
> Thanks.
>
> On Sat, Sep 1, 2012 at 12:41 AM, waqar younas <vickyqau@gmail.com> wrote:
> Hi
> Please find attached the code.
> Thanks.
>
>
> On Fri, Aug 31, 2012 at 4:56 PM, David Brown <dbrown@ucar.edu> wrote:
> Can you attach your script? NCL should be able to understand missing values of that magnitude going all the way back to the earliest versions.
> -dave
>
> On Aug 31, 2012, at 5:51 PM, waqar younas wrote:
>
> > Hi to all.
> > I am using NCEP observation data for u850 in NCL version 5.2.0-beta2. It is not able to accommodate or ignore the missing values (32766) and plotting these values whenever i plot the spatial pattern on a single time. Please find attached the figure.
> > I even set the missing value to -99 and delete the Fill value but still problem is same.
> > Can anyone help me how to deal with missing or Fill values in this version?
> > Thanks.
> >
> >
> > --
> > Best Regards
> >
> > Waqar Younas
> > PhD Candidate
> > Natural Resources and Environmental Studies (NRES)
> > University of Northern British Columbia (UNBC)
> > Canada
> >
> > <eof.ps>_______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> --
> Best Regards
>
> Waqar Younas
> PhD Candidate
> Natural Resources and Environmental Studies (NRES)
> University of Northern British Columbia (UNBC)
> Canada
>
>
>
>
> --
> Best Regards
>
> Waqar Younas
> PhD Candidate
> Natural Resources and Environmental Studies (NRES)
> University of Northern British Columbia (UNBC)
> Canada
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Sep 4 14:16:14 2012

This archive was generated by hypermail 2.1.8 : Tue Sep 11 2012 - 15:30:42 MDT