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

Home » Public Forums » archive » Summing 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
Summing an array. [message #61688] Mon, 28 July 2008 08:36
crazywhiteboy311@gmai is currently offline  crazywhiteboy311@gmai
Messages: 2
Registered: May 2008
Junior Member
Hello all,

I've got a little problem I've been stuck on for a few days now, and I
was hoping to get at least a little guidance to a viable solution. My
issue involves the summation of an array in two ways. The array is the
used as the output of model plasma measurement device to express the
number of particle strikes at a specific position at a certain energy-
per-charge value:

X-Coordinate Y-Coordinate Count Energy-per-Charge

X and Y are both integers that range from 0 to 63, Count is a floating
point value, and Energy-per-Charge is a floating point value
logarithmically spaced from 0.1 to ~13 in 64 bins.

The goal is to produce two arrays from this (that need to be used for
two pre-made plotting programs). The first array is a 64x64 element
array that contains the sum of all counts at a certain coordinate.
Ie :

Counts at (1,1) Counts at (1,2) Counts at (1,3) ....
Counts at (2,1)
...

The second is to produce an array that is simply a list of all the
counts at a single Energy-per-Chage value. ie:
Energy-per-Charge Counts

Now I have been able to do this in the past with loop operations, but
considering IDL's 'penalty' for using loops, it runs quite a bit
slower then needed. Specifically, it has to deal with arrays that have
at max 1.5 million pairs of XY coordinate, count, and Energy-per-
Charge value, and it needs to do this operation between 20 and 50
times per execution (number of time steps used). Where I've been
getting stuck is switching this to an array based method which I hope
to be significantly faster (hopeing for an order of magnitude, but
cutting it down by a factor of just 3 would be great). Any advice that
can be offered would be appreciated. Thanks for your time, and for
reading this lengthy post.

Aron
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: eps output with xplot or fsc_surface
Next Topic: Re: Array has a corrupted discriptor, reliable?

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

Current Time: Sat Oct 11 06:44:57 PDT 2025

Total time taken to generate the page: 0.88243 seconds