I just discovered that the following line
idx = WHERE(A[WHERE(FINITE(A) EQ 1)] GT 13.0)
does NOT give the expected result:
print, a[ idx ]
looks something like:
11.3799 11.7700 NaN 12.1800
12.3900 NaN NaN
The statement above (idx=where..) is by the way a _*direct*_ copy of an example in the online documentation for the 'where' function... (Hence the capital letters)
An easy workaround is of course to remove all
the Nan's:
nan_idx = where( finite(a) eq 0 )
a[ nan_idx ] = -100
Then, using
idx = where( a ge 13.0 )
I get the correct indices.
Note that I use _*exactly*_ the same method as described in the documentation to solve a simple problem with invalid numbers within the dataset. And yet it gives med bogus results :(
Regards, Jan
|