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

Home » Public Forums » archive » Re: the fastest way to find number of points in sphere(radius r)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: the fastest way to find number of points in sphere(radius r) [message #46407 is a reply to message #46406] Tue, 22 November 2005 07:29 Go to previous messageGo to previous message
Xavier Llobet is currently offline  Xavier Llobet
Messages: 7
Registered: April 2005
Junior Member
In article <1132665267.676156.221240@g49g2000cwa.googlegroups.com>,
"PYJ" <snfinder@naver.com> wrote:

> Thank you, Xavier Llobet~^^
>
> Actually, I expect a vectorizing method. (finding number of points
> about all centers at a time.)
>
> By the way,
> The points that I have are about 5*10^5.
> The number of centers is about 3*10^6.
> These are quite large.

In that case, use ix = lindgen(n_elements(X))

> Anyway, I can't understand your way exactly.
> Can you explain it more ?
>
> So sph(2,*) is the array of distances.
> -> distances? Whose distances?

The only obscure point is

>> ; Shift points' coordinates to the j-th sphere's center
>> blas_axpy, t1, -1, [XC(j), YC(j), ZC(j)], 1, [0,0], 2, ix

It is a fast way of doing X1 = X-XC(j), Y1 = Y-YC(j), Z1 = Z-ZC(j)


> ***I need a number of points. ***
> Do I use a where function about every centers again?

Quoting myself:
>> ; Histogram it, or treat as you please.

> I want to avoid loops if possible.

Well, given that you have 5E5 points and 3E6 centers, you have 1.5E12
distances to consider. It might be difficult to do it without loops...

--
_xavier
--
Only one "o" in my e-mail address
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: image display with different pixel size in x & y
Next Topic: Re: 3d space set up and plotting data on maps

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

Current Time: Sun Oct 12 00:21:29 PDT 2025

Total time taken to generate the page: 0.16258 seconds