Re: Turning off math error checking for a code block [message #28881 is a reply to message #28879] |
Thu, 17 January 2002 13:55   |
Vapuser
Messages: 63 Registered: November 1998
|
Member |
|
|
Paul van Delst <paul.vandelst@noaa.gov> writes:
> 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:
>
Oooopppsss. My error! I guess I just can't read today. For some
reason I thought that Ken's x[3] == 0 too!
mea culpa.
>> IDL> y=[0,!values.f_nan,2,0.]
>
> The where result of the original is one index - the 0th one:
>
Yes.
> 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\
>
True, but setting !except=0 makes that go away.
whd
--
William Daffer: 818-354-0161: William.Daffer@jpl.nasa.gov
|
|
|