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

Home » Public Forums » archive » summing mulit-D array along 1 dimension, at an angle to the rows
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
summing mulit-D array along 1 dimension, at an angle to the rows [message #73396] Thu, 04 November 2010 12:22
rrs is currently offline  rrs
Messages: 2
Registered: November 2010
Junior Member
Suppose you have a 2d or 3d array that contains some information (in
my case, density) with a relatively complex geometry, and you want to
collapse this to 1d or 2d by summing (to obtain a column density).
This is simple if you want to sum along an axis, but I'm having
problems finding an efficient way to sum along an angle (i.e. if the
observer is at a 30 degree angle to the x-axis). The best I've been
able to do is rotate the array by the desired angle, and then perform
the sum. Example:
density = transform_volume(TEMPORARY(density), ROTATION=[0,angle,0]);
column_density = REVERSE(TOTAL(REVERSE(density*voxel_size), 1, /
CUMULATIVE));
All the reversing is so that I get a column density from each voxel to
the observer along the row.

The problem is that I'm working with large arrays, and I need to do
this for several angles, which makes the whole process both memory-
intensive and slow.

Am I missing some more sensible way to do this?
[Message index]
 
Read Message
Previous Topic: Re: how to clear error message
Next Topic: Re: summing mulit-D array along 1 dimension, at an angle to the rows

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

Current Time: Wed Oct 08 15:18:43 PDT 2025

Total time taken to generate the page: 0.00227 seconds