XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


ommergelists (ommergelists-1.2) [xmmsas_20230412_1735-21.0.0]

Source-matching algorithm

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-

  1. 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.
  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.
  3. 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.

  4. Loop through from i=1 to the number of rows in source-list 1 and for each one:

  5. 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.
  6. Loop through from i=1 to i=size of source-list 1 and

  7. Using the refined matched-list of sources, compute the mean differences in RAxcos(Dec) and Dec.
  8. 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