[ncl-talk] Could there be a bug

Mary Haley haley at ucar.edu
Tue Aug 28 09:17:24 MDT 2018


Hi Dave,

I started to reply and then saw that Jim had replied.

He's correct that you need to apply the scale_factor and add_offset to your
data. You can use the special "short2flt" function to do this:

sst = short2flt(f->sst)

It's important to note that packed data is not always packed the same way!
short2flt applies this calculation:

     xF = xS*xS at scale_factor + x at add_offset

but we've seen data where the formula was :

    xF = xS at scale_factor * (xS-xS at add_offset)

This is a case where you have to look at your data (i.e. via printMinMax)
after you do the calculation, to make sure the values look right. Sometimes
data will have a "valid_range" attribute that tells you what the expected
range of this particular variable is.

--Mary






On Tue, Aug 28, 2018 at 8:33 AM, dave montgomery <montgomery_dave at yahoo.com>
wrote:

> Dear NCL Users,
> I plotted sst on a local scale using NCL. The result for the sst variable
> are way too high. Plotting the same data with CDO and using ncview, the
> results for the sst variable are in the values to be expected. In CDO, the
> variable sst has a range from 297.274K to 300.189K but in NCL the plotted
> graph showed a range from about 12000 to 16000. Could our most esteem NCL
> experts help me out here? I would be grateful for your help.
> Attached are the file, script and the corresponding plot.
> I am using NCL version 6.4.0
> Data is from ERA5
>
> Best regards
> Dave Montgomery
>
> _______________________________________________
> 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/20180828/b9e9c528/attachment.html>


More information about the ncl-talk mailing list