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

Home » Public Forums » archive » matching coordinates
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
matching coordinates [message #55077] Sun, 29 July 2007 02:01
jradavenport is currently offline  jradavenport
Messages: 6
Registered: July 2007
Junior Member
Hello, I'm a long time lurker of this group, and finally have a
problem I can't solve efficiently enough! I have coordinates for stars
(RA and DEC for us astronomers out there), from two sources. i.e.
(x1,y1) and (x2,y2). These lists are huge, like 150k for one and
5million in the other (a lot of stars!). I need to find the matches
from these catalogs within a tolerance. I've tried a few programs
I've found online (close_match_radec for instance) and they have not
given me results I believe (multiple matches and such). Here is some
horrible code I wrote just now which solves the problem VERY slowly:

sep=0.0008
m1=[-1]
m2=[-1]
for i=0L,n_elements(ra1)-1 do begin
dra=ra2-ra1[i]
ddec=dec2-dec1[i]
m=where(abs(dra) le sep and abs(ddec) le sep) ;find the star
within the separation, sep
if m[0] ne -1 then begin
m1=[m1,i]
m2=[m2,m[0]]
end
dra=0
ddec=0
endfor

if n_elements(m1) gt 1 then begin
m1=m1[1:*]
m2=m2[1:*]
print,n_elements(m1),' matches found.'
endif

if n_elements(m1) eq 1 then print,'No matches found!'


I have the idea of concatenating the arrays, sorting them, then
subtracting the n+1 element from the n element, and finding where the
result is less than the separation tolerance, but this only works well
for me in 1-D... Any thoughts or help would be very welcomed.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: C.H.E.A.P....C.I.G.A.R.E.T.T.E.S....D.E.L.I.V.E.R.Y...T.O...A.L.L...C.O.U.N.T.R.Y.E.S...martha
Next Topic: Re: Derivative along one dimension of a data cube?

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

Current Time: Fri Oct 10 12:06:09 PDT 2025

Total time taken to generate the page: 0.23837 seconds