Weird Error

Steven C Chan scchan at ATMOS.UMD.EDU
Tue Mar 6 10:43:51 EST 2007


Thanks for all the reply.

Diane, indeed that is what i resorted to do -- using the Land-Sea Mask.
So the problem is resolved now.

Steven Chan

Diane Stokes wrote:
> Steven,
>
> If you have access to the mask that was used to determine land vs ocean
> for the sst file, you can create an appropriate descriptor file and use
> that along with the maskout function to set the land (NaN's) to missing.
>
> Or, you can try to make a mask based on the data values.  Eg:
>
>  define mask=const(const(maskout(sst,sst-999999),-1),0,-u)
>
> That generates a gridded field named mask that has 0's everywhere the
> expression "sst-999999" is negative and -1 elsewhere.  (That expression
> would be chosen to ensure you get a negative result from any expected
> value from your original data field).  So, mask should have -1's where
> you have your NaN's.  Then, you display only the valid ssts using the
> maskout function.  Eg:
>
>  d maskout(sst,mask)
>
>
> Also, I was mistaken about more recent versions giving a more
> informative msg.  The msg I was seeing was generated under different
> circumstances.
>
>     Diane
>
> Steven C Chan wrote:
>> I just checked the data file again.
>>
>> It is indeed a NaN value not a -9999.99 like number. The original file
>> actually is created not for Grads -- it is just some binary file written
>> in a way that is consistent with Grads order of x and y with the NaN
>> inserted in.
>>
>> I am not sure if you can set a control file in a way to ignore NaN.
>>
>> About using set gxout grfill: It did shaded the SST correctly. But Grads
>> now is also shading the NaN values (i.e. land) together with the
>> correctly shaded SST.
>>
>> Steven Chan
>>
>> Mary Jo Nath wrote:
>>> Steven,
>>>
>>> For SST data values over land should by set equal to the missing value,
>>> which is not the same thing as "NaN". "NaN" means "not a number", some
>>> value that isn't able to be interpreted as a number. These usually are
>>> produced as the result of an invalid operation on floating point values
>>> (like trying to take the square root of a negative number, for
>>> example.)
>>>
>>> MJ
>>>
>>> Steven C Chan wrote:
>>>> Sorry for the slow response. I thank you everyone who had replied.
>>>>
>>>> The set ccols command is basically a cut and paste of a repeated color
>>>> setting I have used over a lot of plots.
>>>>
>>>> The Grads built that is installed is 1.94b4. About the issues with NAN
>>>> values, it is SST data, so there are a lot of undefined data points
>>>> (obviously, over land).
>>>>
>>>> What would be the best solution for the problem?
>>>>
>>>> Steven Chan
>>>>
>>>> Diane Stokes wrote:
>>>>> BTW, it would help if you include your build info with this type of
>>>>> question.  In this case, I /think/ you are using an older build and a
>>>>> more recent version might give you a more informative error msg.
>>>>
>>



More information about the gradsusr mailing list