comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » check for infinity
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
check for infinity [message #90042] Tue, 20 January 2015 12:11 Go to next message
g.nacarts is currently offline  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 #90043 is a reply to message #90042] Tue, 20 January 2015 13:52 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
See http://www.exelisvis.com/docs/FINITE.html

On 01/20/15 15:11, g.nacarts@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
>
Re: check for infinity [message #90044 is a reply to message #90042] Tue, 20 January 2015 13:56 Go to previous messageGo to next message
eshaya is currently offline  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 #90045 is a reply to message #90044] Tue, 20 January 2015 15:06 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Thanks a lot
Re: check for infinity [message #90046 is a reply to message #90042] Tue, 20 January 2015 15:29 Go to previous messageGo to next message
g.nacarts is currently offline  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
Re: check for infinity [message #90047 is a reply to message #90046] Tue, 20 January 2015 15:33 Go to previous messageGo to next message
g.nacarts is currently offline  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?
Re: check for infinity [message #90071 is a reply to message #90047] Thu, 22 January 2015 13:57 Go to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
See http://exelisvis.com/docs/WHERE.html

You might not want to use the Where() function. Just Finite().

Also, you can save yourself a for loop:

for i = 0, 199
print, finite(DataArray[i,*,*] - Array)
endfor


p.s. There are also ways of doing this without using a loop.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: help with IF statement
Next Topic: GOES_GeoTiff_Plot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:27:20 PDT 2025

Total time taken to generate the page: 0.07324 seconds