gaia_tools icon indicating copy to clipboard operation
gaia_tools copied to clipboard

xmatch.cds does not handle duplicates correctly

Open jobovy opened this issue 4 years ago • 0 comments

If an input catalog to xmatch.cds has duplicates, not every duplicate will necessarily get matched, because of this line, which in the cds_matchback function causes every object in the matched CDS catalog to be matched back to the original catalog, and this may lead to different objects being matched to, say, the first of a set of duplicates (rather than matching this object to each duplicate).

Possible fix: swap mc1 and mc2, but then have an index into the wrong array. An argsort can then swap this index into one into the correct array (I think).

jobovy avatar Jul 16 '19 03:07 jobovy