check for infinity [message #90042] |
Tue, 20 January 2015 12:11  |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
Hi
I have a 3D array and I want to check if it contains an infinity. Is that possible? If so, any idea how to check it?
Thanks
|
|
|
|
Re: check for infinity [message #90044 is a reply to message #90042] |
Tue, 20 January 2015 13:56   |
eshaya
Messages: 4 Registered: December 2014
|
Junior Member |
|
|
On Tuesday, January 20, 2015 at 3:11:48 PM UTC-5, g.na...@gmail.com wrote:
> Hi
>
> I have a 3D array and I want to check if it contains an infinity. Is that possible? If so, any idea how to check it?
>
> Thanks
Result = Where(FINITE( Array , /INFINITY[, SIGN=value] EQ 1)
Sign = 1, if you want positive infinities only
Sign = -1, for negative infinities
Sign = 0, for both
|
|
|
|
|
Re: check for infinity [message #90047 is a reply to message #90046] |
Tue, 20 January 2015 15:33   |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
I've got one more question. Because my 3D array has thousands of elements I wanted to check whether Nans or infinity numbers exists but I cannot visualise all the outputs. My code is like this:
DataArray ; contains the 3D data
for i = 0, 199 do begin
for j = 0, 199 do begin
Barray = DataArray[*,i,j] - Array[i,j]
print, where(finite(Barray), /NAN))
endfor
endfor
I got the value -1 a lot of times, one printed after another . When I changed it to print, where(finite(Barray)) I got zeros. But I can only see in the last entries because the first are deleted. There is any other way? And what the -1 and 0 stands for?
|
|
|
|