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

Home » Public Forums » archive » 3-D positions
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
3-D positions [message #43822] Fri, 29 April 2005 11:24
panblosky is currently offline  panblosky
Messages: 17
Registered: May 2005
Junior Member
Hi, I have the following problem. I have a 3xn array, where n can go
from 32000 to 16.000.000. This array represents positions in space, or
just lets say x,y,z. The numbers go from 0 to 1. I have a cube of sides
1. I divide that cube into a 3-D grid, where my gridsize can go from 32
to 512 in every direction (depends on how big I want the grid). So, in
1-D, the box is going to be divided in:

lon=findgen(n0)/float(n0-1)*float(boxsize)/boxsize

where n0 is the size of the grid (for example, 128) and boxsize is 1.
The same thing goes for the other two dimensions.
Now, I want to find what points (x,y,z) lies in which gridcell
(between lon[i+1] and lon[i] in every direction).
If I do it with a for loop (together with a where), it will take for
ever. I have tried sorting, but I just can't get it right. Does
somebody knows a fast way?
Thanks,

Pablo
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Cannot put an image back to the origin after rotating with T3D.
Next Topic: Re: number formats inputing ascii data

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

Current Time: Thu Oct 09 09:44:09 PDT 2025

Total time taken to generate the page: 0.64099 seconds