`tgmatchsrc' attempts to reconcile two source lists: an input
source list, and a reference source list. It is assumed that there
will not be multiple matches between the lists, so once a match is
found, no further matches are searched for, and both sources are
removed from future match searches. A match is determined by
comparing the distance between the sources with the threshold
separation parameter (in arcsec).
All reference sources are written to the output with the same ID,
but if there is a match, the output data will be for the highest
SNR of the two. Unmatched input sources are appended to
the output with new sequential IDs. Then any unmatched new
sources are appended to the end of the file; they also have
new source ids assigned to them.
It should be noted that if refsrcfile is set to none, NONE, or
"", then a copy of the infile will be made.
This tool is used by tgdetect for determining zero-order sources over
multiple observation intervals. It is not normally run
independently.
Both of the input files should share the same format. This is
important in that the output file is going to be defined to have the
same structure as the infile, and rows are going to be written to the
outfile from both the infile and the refsrcfile. In
particular though,
the following columns are required, and if they cannot be found in
both source files, the task will exit with an error:
DEC
|
in decimal degrees
|
SNR
|
|
TG_SRCID
|
|
The output file name will have an extension name of SRCLIST.
If there are any errors the task will return -1 and print the errors
that occurred to the screen. Otherwise zero will be returned.
The Source Matching algorithm works as follows:
if source_separation <= separation threshold then the sources match,
where source_separation is determined as follows:
sqrt((ref_src_RA - new_src_RA)**2 + (ref_src_DEC - new_src_DEC)**2)
Note that the RA and DEC are in decimal degrees while the
input separation threshold is in arcsec. The later is converted to
decimal degrees within the code.