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

Home » Public Forums » archive » Re: Distance between two sets of datapoints
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: Distance between two sets of datapoints [message #70229 is a reply to message #70228] Fri, 26 March 2010 06:16 Go to previous messageGo to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On Mar 25, 3:38 pm, Maxwell Peck <maxjp...@gmail.com> wrote:
> Thanks Ken, I'll give it a shot. I had tried a similar loop (I
> thought) but it seemed to be very slow that is why i was looking at
> vectorising it similar to distance_measure.
>
> Thanks
> Max
>
> On Mar 26, 6:04 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>
>
>
>> In article <k-bowman-EEB2FB.09554725032...@news.tamu.edu>,
>>  "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>
>>> FOR i = 0, nb-1 DO BEGIN
>>>    d = SQRT((xb[i] - xa)^2 + (yb[i] - ya)^2)
>>>    dist[0,i] = d
>>> ENDFOR
>
>> I just realized this could be simplified to
>
>> FOR i = 0, nb-1 DO dist[0,i] = SQRT((xb[i] - xa)^2 + (yb[i] - ya)^2)
>
>> which removes some unneeded memory access.
>
>> Ken

Take a look at JD Smith's match_2d (http://tir.astro.utoledo.edu/idl/
match_2d.pro), which uses histogram to quickly find distances between
lists of coordinates (and then matches them, which you don't need).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Highlight default button
Next Topic: IDL licensing

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

Current Time: Fri Oct 10 09:27:40 PDT 2025

Total time taken to generate the page: 0.00189 seconds