Re: _FillValue type mismatch

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 18 2010 - 15:16:02 MDT

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
Received on Thu Mar 18 15:17:04 2010

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