On Apr 21, 12:23 pm, vino <astrocr...@gmail.com> wrote:
> Hi Jerely Ballin,
>
> I even tried reforming them before input like this :
>
> DL> match=match_2d(reform(star_radec1(0,*)),reform(star_radec1
> (1,*)),reform(star_radec2
> (0,*)),reform(star_radec2(1,*)),.02,MATCH_DISTANCE=md)
>
> Even this doesnt seem to work.... :(
>
> Eventhough in this eg, we need to do a one-to-one match, in my
> original data, it has to be one-to-many as well...Will the routine
> work for that as well??
>
> Thanks and regards,
>
> Vino
>
> On Apr 21, 4:47 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
>
>> On Apr 20, 9:40 am, vino <astrocr...@gmail.com> wrote:
>
>>> Hello everyone,
>
>>> I am using match_2d from J.D.Smith's library (http://
>>> tir.astro.utoledo.edu/idl/match_2d.pro) to match between two
>>> catalogues. Below is what i am doing :
>
>>> IDL> print,star_radec1
>>> 242.759 -29.4162
>>> 252.666 -31.6364
>>> 250.523 -30.5292
>>> 244.782 -20.2181
>>> IDL> print,star_radec2
>>> 252.666 -31.6364
>>> 250.523 -30.5292
>>> 267.782 -22.9120
>>> IDL> match=match_2d(star_radec1(0,*),star_radec1(1,*),star_radec2
>>> (0,*),star_radec2(1,*),.02,MATCH_DISTANCE=md)
>>> IDL> print,match
>>> -1 -1 -1 -1
>>> IDL> print,md
>>> 5.98943e-22 3.62562 2.23579e-17 2.62037e-22
>
>>> Eventhough there are 3 objects matching, why is it that match_2d is
>>> not finding them?? I shall be very grateful for any pointers...
>
>>> Thanks and regards,
>
>>> Vino
>
>> It looks like MATCH_2D requires that its inputs be flat vectors, but
>> instead you're feeding it [1,N] arrays.
>
>> -Jeremy.
Aha... I've looked at it in gory detail, and it turns out that the
routine implicitly assumes that the minimum value of both x2 and y2
are 0. So you can get it to work if you do the following:
minra = min(star_radec2[0,*])
mindec = min(star_radec2[1,*])
match = match_2d(star_radec1[0,*]-minra, star_radec1[1,*]-mindec,
star_radec2[0,*]-minra, $
star_radec2[1,*]-mindec, 0.02, match_distance=md)
IDL> print, match
-1 0 1 -1
IDL> print, md
1.53332e-19 0.00000 0.00000 5.90697e-22
Also, it looks like it will only return 1 match per input coordinate.
If you need "all matches within a given distance", take a look at
WITHINSPHRAD (http://web.astroconst.org/jbiu/jbiu-doc/astro/
withinsphrad.html) from JBIU (http://web.astroconst.org/jbiu).
-Jeremy.
|