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

Home » Public Forums » archive » Finding NaNs in arrays - Strange outcome
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Finding NaNs in arrays - Strange outcome [message #92389 is a reply to message #92382] Sat, 05 December 2015 13:24 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Saturday, December 5, 2015 at 7:02:49 AM UTC-5, dmfl...@gmail.com wrote:
> Hello
>
> I have a 3D array A ( A FLOAT = Array[480, 480, 160]). I wanted to check for NaNs so I had split one 2D array as follows:
>
> A1 = total(A[0:79, 0:79,25])
> A2 = total(A[80:159,80:159,25])

You are not "splitting" the array, but selecting disjoint square regions. For example, suppose an NaN value is present in the pixel [75,100,25]. This pixel is not included in either A1 or A2. But it will be included in your total

print, 'total',total(A[*,*,25])

so it is very plausible that total(A[*,*,25]) gives an NaN while A1+A2+A3+A4+A5+A6 does not.

--Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ROI of 3D volumes (multiple 2D slices)
Next Topic: Re: IDL_IDLBRIDGE undefined procedure problem

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

Current Time: Wed Oct 08 18:29:12 PDT 2025

Total time taken to generate the page: 0.00692 seconds