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

Home » Public Forums » archive » quickly totaling sections of an array
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
quickly totaling sections of an array [message #52558] Tue, 13 February 2007 07:05
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
Hey Everyone,
I'm essentially trying to add together separate sections of an
array, and I need to do it in a very speedy fashion. Here's the
breakdown in IDL. I would want to take an array like this:

vals = [10, 15, 13, 12, 11, 14]

and imagine I have a mask (which I can easily make) like this:

mask = [ 0, 0, 0, 1, 1, 1 ]

I would then want to add together everything with the same mask value
and put it in a new array. So the result would be:

sums = [38, 37]

I'm generating images, and for each image I generate this will be done
1000 times, and there will be 1000 different mask values each time it
is done. I'll be generating a couple hundred images, so I'll be
running this task a couple hundred thounsand times - i.e. execution
speed is very important. Any suggestions on how to speed things up
would be highly appreciated.
Thanks in advanced,
Conor
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: handling zero size file
Next Topic: Re: quickly totaling sections of an array

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

Current Time: Sat Oct 11 05:46:03 PDT 2025

Total time taken to generate the page: 2.32184 seconds