Re: nan in dataset

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 10 2011 - 17:59:17 MDT


In addition to what Dave Brown just replied...

 From that particular warning message, I agree that this data set
appears to have an incorrect missing value attribute.

You need to manually coerce the data type of the _FillValue
attribute to the data type of model8Ssh, after reading the array
from the file. Please find out the data types of the original
variable and the missing_value attribute first:

   printVarSummary (in->sea_floor_depth_below_sea_level)
   print (in->sea_floor_depth_below_sea_level@missing_value)

If (and only if) somehow model8Ssh (after reading in) already has a
_FillValue attribute of the wrong type, you must delete it before
doing anything else:

   delete (model8Ssh@_FillValue)

Then, if model8Ssh is type float, do this. Adding 0.0 will coerce
any integer type to float:

   model8Ssh@_FillValue =
in->sea_floor_depth_below_sea_level@missing_value + 0.0

If model8Ssh is type integer, do this:

   model8Ssh@_FillValue = numeric2int

These are the most likely cases. You may have something else that
requires a different type converter. In that case, select the one
that matches from this page.

If Nan's are involved, you will need a different approach. I did
not understand why you mentioned Nan in the message title and then
never in the message. Please clarify. Nan's are not the same thing
as missing values, and should not be confused.

Note: You probably meant to say _FillValue in a couple places. Do
not use these incorrect attribute names from your e-mail, they will
not work:


If you need further advice, then please show the complete output
from the two print statements above. Also show the number of Nan's
in the array, like this:

   print (num (isnan_ieee (model8Ssh)))


On 10/10/2011 4:57 PM, Gerald Creager wrote:
> Looks like a dataset I'm working with is malformed, with a
> 'missing_value' but no __MissingValue provided.. In fact, none of the
> variables have a "normal" __MissingValue and I get some ugly warmings
> such as:
> warning:NetOpenFile: MissingToFillValue option set True, but
> missing_value attribute and data variable
> (sea_floor_depth_below_sea_level) types differ: not adding virtual
> _FillValue attribute
> I'm considering adding model8Ssh@_MissingValue=-9999 to see if this
> resolves the problem but somehow, with this dataset, one never knows.
> Short form, I'm not getting any indication that the values are going to
> plot and I'm stuck again.
> Thanks, Gerry
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Mon Oct 10 17:59:20 2011

This archive was generated by hypermail 2.1.8 : Wed Oct 12 2011 - 15:59:45 MDT