Re: Turning off math error checking for a code block [message #28888 is a reply to message #28883] |
Thu, 17 January 2002 12:54   |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Vapuser wrote:
>
> k-bowman@null.com (Kenneth Bowman) writes:
>
>> I have an array x that is likely to have missing values in it, indicated by NaN's. I would like to search the array for values less than x_min. Because of the NaN's, WHERE generates a floating point error, e.g.,
>>
>> IDL> print, x
>> 0.00000 NaN 2.00000 3.00000
>> IDL> print, where(x lt 2.0)
>> 0
>> % Program caused arithmetic error: Floating illegal operand
>>
>
> Hmmmm..... I don't get this result.
Sure you do - you just have a 0 instead of a 3 as the 4th element of y:
> IDL> y=[0,!values.f_nan,2,0.]
The where result of the original is one index - the 0th one:
IDL> x=[0,!values.f_nan,2,3.]
IDL> print,where( x LT 2,nx),nx
0
1
% Program caused arithmetic error: Floating illegal operand
paulv
p.s. After trying the simple example above, it sure is annoying to get that error message. :o\
--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
|
|
|