Re: Problem with the _FillValue

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 09 Nov 2007 09:36:27 -0700

Hi Jee-Hoon,

I think Michael's suggestion is a good one. You could do:
obs=mask(obs,obs.ge.500.,False)
obs@_FillValue = 1.e20
Then all the missing data is set to 1.e20.

Just to be sure though, a colleague here suggested that 1.e36 (as type
double) actually prints as 9.999999616903162e+35, but is really 1e36.

You could check if this is the case by running something like this:

obs = addfiles_GetVar(flist, files, variable)
nMsg = num( ismissing( obs ) )
print("initial number of _FillValue="+nMsg)

obs@_FillValue = 1e+36
print("========================")
nMsg = num( ismissing( obs ) )
print("new number of _FillValue="+nMsg)
printVarSummary( obs )
printMinMax(obs, True)

Good luck,
Adam

Michael Notaro wrote:
> Both 1e+36 and 9.999e+35 would become missing values
> if you used the command I sent you.
> Is the data "double" or "float"? Looks like double to me
> since there are so many digits.
> I normally use _FillValue, not missing_value.
>
> You can define anything as a fillvalue, not just 1e+36.
>
> Mike
>
>
> On Nov 9, 2007, at 9:33 AM, Jee-Hoon Jeong wrote:
>
>> Dear Michael,
>>
>> Thanks! It works very well for NCL functions.
>>
>> But in that case, also the 9.999999616903162e+35 value is assigned for
>> the
>> _FillValue, isn't it?
>> Because I'm processing nc files which will be used for model initial
>> data,
>> Still I feel uncomfortable about 9.999999616903162e+35 instead of 1e+36.
>>
>> One strange thing I found is;
>> I've tested to add the "missing_value" attribute (of course, NCL
>> doesn't use
>> it though),
>> "obs_at_missing_value = 1e+36",
>> In this case, printVarSummary(obs) returns; "_missing_value : 1e+36"
>> well.
>>
>> Is there any restriction of 1e+36 for _FillValue?
>>
>> Jee-Hoon
>>
>> -----Original Message-----
>> From: Michael Notaro [mailto:mnotaro_at_wisc.edu]
>> Sent: Saturday, November 10, 2007 12:02 AM
>> To: Jee-Hoon Jeong
>> Cc: ncl-talk_at_ucar.edu
>> Subject: Re: Problem with the _FillValue
>>
>> You could try to mask anything over, say, 500.
>>
>> obs=mask(obs,obs.ge.500.,False)
>>
>>
>> On Nov 9, 2007, at 9:00 AM, Jee-Hoon Jeong wrote:
>>
>>> Dear NCL users,
>>>
>>>
>>>
>>> I've faced a problem with _FillValue during processing initial
>>> files of CLM3 (*.i.*.nc files).
>>>
>>> There are many missing values (1e+36) in those file without
>>> _FillValue attribute, so I added
>>>
>>> "obs_at_FillValue = 1e+36" command in my NCL script.
>>>
>>> But I found that a value, 9.999999616903162e+35, is set for the
>>> _FillValue instead of 1e+36.
>>>
>>> Thus the NCL functions seem not to be able to recognize _FillValue
>>> correctly.
>>>
>>>
>>>
>>> Here are part of my NCL scripts and the results related with.
>>>
>>> ;--- NCL
>>>
>>> obs = addfiles_GetVar(flist, files, variable)
>>>
>>> obs@_FillValue = 1e+36
>>>
>>> printVarSummary(obs)
>>>
>>> printMinMax(obs,True)
>>>
>>>
>>>
>>> ;Results are;
>>>
>>>
>>>
>>> Variable: obs
>>>
>>> Type: double
>>>
>>> Total Size: 7639320 bytes
>>>
>>> 954915 values
>>>
>>> Number of Dimensions: 3
>>>
>>> Dimensions and sizes: [case | 13] x [column | 4897] x [levtot | 15]
>>>
>>> Coordinates:
>>>
>>> case: [0..12]
>>>
>>> Number Of Attributes: 3
>>>
>>> _FillValue : 9.999999616903162e+35
>>>
>>> units : K
>>>
>>> long_name : soil-snow temperature
>>>
>>> (0)
>>>
>>> (0) soil-snow temperature: min=0 max=1e+36
>>>
>>> ---
>>>
>>>
>>>
>>> I guess the "max" value should be around 250~300K if NCL recognizes
>>> the _FillValue correctly.
>>>
>>> Is there any way to resolve this problem?
>>>
>>>
>>>
>>> Thanks!
>>>
>>> Jee-Hoon
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>> __________ NOD32 2649 (20071109) Information __________
>>
>> This message was checked by NOD32 antivirus system.
>> http://www.eset.com
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 09 2007 - 09:36:27 MST

This archive was generated by hypermail 2.2.0 : Mon Nov 12 2007 - 09:17:55 MST