Re: _FillValue type mismatch

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 18 2010 - 15:24:17 MDT

An easy to do this is:

data@_FillValue = -9999h

This is the way to create a "short" in NCL.

Wei Huang
huangwei@ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Mar 18, 2010, at 3:16 PM, Mary Haley wrote:

> Tong,
>
> NCL will not allow you to take something of a higher precision (an
> integer in this case) and assign it to something of smaller precision
> (a short in this case).
>
> This is because you can potentially lose precision.
>
> NCL has a set of conversion functions that allow you to do this. Try
> using integertoshort:
>
> data@_FillValue = integertoshort(-9999)
>
> In version 5.2.0, we will have a new set of conversion functions
> where you don't have
> to indicate the "from" precision. That is, you'll be able to use:
>
> data@_FillValue = toshort(-9999)
>
> --Mary
>
>
> On Mar 18, 2010, at 9:24 AM, Tong Qi wrote:
>
>> Hello,
>>
>> I am trying to designate a _FillValue for a data field, but when I
>> try data@_FillValue=-9999, I get
>> "fatal:Type Mismatch: The type of missing value could not be
>> converted to type of variable (Cirrus_Reflectance_Mean)"
>>
>> Both _FillValue and the data type are 16-bit integers. Where could
>> the mismatch be?
>>
>> Thanks,
>> -Tong
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 18 15:24:26 2010

This archive was generated by hypermail 2.1.8 : Fri Mar 19 2010 - 16:19:08 MDT