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

Home » Public Forums » archive » array operations
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
array operations [message #55816] Wed, 12 September 2007 01:13
payon is currently offline  payon
Messages: 11
Registered: July 2007
Junior Member
Hello,
I have a small question to an array operation.

I have a 3-dimensional array. 10x10x100 ... the first 2 dimensions
10x10 are spatial dimensions (so one image with 10 width with and 10
pix height). The third dimension is the time dimension. So every
images was acquired 100 times.

What I wanted to do is now to compute the the mean of every pixel in
time dimension.

So for one special pixel (e.g. [3,3]) i would write

meanpixel = mean(myarray[3,3,*])

but how is it, if i would like to do this operation for every pixel in
the spatial dimensions? I just saw a possibility with a for loop.

like
FOR j = 0, 9 DO BEGIN

FOR k = 0, 9 DO BEGIN

meanarray[i,j]=mean(myarray[i,j,*])

ENDFOR

ENDFOR

This isn't a very fast possibility especially when the array goes big,
and i have to do that operation for a full image frame which is
1024x1024 pixel.

Is there maybe another way how to act with it? I know that IDL is very
strong with array operations, so maybe there is any another solution,
which maybe doesn't need the two loops. Thanks a lot for your kind
responses.

greetings

martin
[Message index]
 
Read Message
Previous Topic: Re: Call IDL (Virtual Machine) Save file from Java
Next Topic: Re: array operations

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

Current Time: Fri Oct 10 06:44:07 PDT 2025

Total time taken to generate the page: 1.27482 seconds