XMM-Newton Science Analysis System
ommergelists (ommergelists-1.2) [xmmsas_20230412_1735-21.0.0]
The matching algorithm takes into account that more than one source in source-list 1 may have a match
with the same source in source-list 2. This can become important in crowded-fields. For example, sources 1 and 2
in source-list 1 may be matched with source 10 in source-list 2, with separations of 2 and 1 arcsecs, respectively.
In a simple matching algorithm, source 1 could be matched with source 10, when in fact source 2 of source-list 1
is better matched with it..
In the following, a list is a c++ vector that can grow in size as necessary, and each element of the vector is also a vector which can grow in size.
The algorithm works as follows-
- Create an empty list, matchedindex1, that will record the row-number of a source in source-list 1
that has a match with a source in source-list 2.
- Create an empty list, matchedindex2, that will record the corresponding row-number of a source in source-list 2
that has been matched with a source in source-list 1.
- Create an empty list, matcheslist, of size equal to the number of rows in source-list 1,
that will store the row-numbers and distances of the sources in source-list 2 that
are no greater than the distance tolerance from each source in source-list 1.
- Loop through from i=1 to the number of rows in source-list 1 and for each one:
- Find all the sources in source-list 2 that are no more than a distance tolerance arcsecs from
it, and add the source-list 2 row-numbers and distances to matchesList[i].
- Loop through matchesList and for each element sort the list of sources in source-list 2
that have 2 or more matches with a source in source-list 1 into increasing distance order, preserving
the correct source-list 2 row numbers.
- Loop through from i=1 to i=size of source-list 1 and
- If source i has no matches move on to the next i.
- Loop through from j=1 to j=size of matchesList[i] and
- Set l to the index of matchesList[i][j]
- Check to see if this source in source-list 2 has been matched with any other source in source-list 1
- IF NOT then increase the size of matchedIndex1 and matchedIndex2 by 1, and set the former to
i and the latter to l. Move on to the next i.
- If YES Check to see if the distance in matchesList[i][j] is no greater than any of the
other matched distances for this source in source-list 2- if not then increase the size of matchedIndex1 and matchedIndex2 by 1, and set the former to
i and the latter to l. Move on to the next i.
- Using the refined matched-list of sources, compute the mean differences in RAxcos(Dec) and Dec.
- If either of these offsets are more than 0.1 arcsecs then correct the coordinates of the second source-list and repeat
the matching process (a maximum of 3 iterations).
XMM-Newton SOC -- 2023-04-16