gaia_tools
gaia_tools copied to clipboard
xmatch.cds does not handle duplicates correctly
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).