Next Previous Up Contents
Next: Match Criteria
Up: Top
Previous: tosql

## 7 Crossmatching

STILTS offers flexible and efficient facilities for crossmatching tables. Crossmatching is identifying different rows, which may be in the same or different tables, that refer to the same item. In an astronomical context such an item is usually, though not necessarily, an astronomical source or object. This operation corresponds to what in database terminology is called a join.

There are various complexities to specifying such a match. In the first place you have to define what is the condition that must be satisfied for two rows to be considered matching. In the second place you must decide what happens if, for a given row, more than one match can be found. Finally, you have to decide what to do having worked out what the matched rows are; the result will generally be presented as a new output table, but there are various choices about what columns and rows it will consist of. Some of these issues are discussed in this section, and others in the reference sections on the tools themselves in Appendix B.

Matching can in general be a computationally intensive process. The algorithm used by the `tmatch*` tasks in STILTS, except in pathological cases, scales as O(N log(N)) or thereabouts, where N is the total number of rows in all the tables being matched. No preparation (such as sorting) is required on the tables prior to invoking the matching operation. It is reasonably fast; for instance an RA, Dec positional match of two 105-row catalogues takes of the order of 60 seconds on current (2005 laptop) hardware. Attempting matches with large tables can lead to running out of memory; the calculation just mentioned required a java heap size of around 200Mb (`-Xmx200M`).

In the current release of STILTS the following tasks are provided for crossmatching between local tables:

`tmatch2`
  Generic crossmatching between two tables.
`tskymatch2`
  Crossmatching between two tables where the matching criterion is a fixed separation on the sky. This is simply a stripped-down version of `tmatch2` provided for convenience when the full generality is not required.
`tmatch1`
  Generic crossmatching internal to a single table. The basic task this performs is to identify groups of rows within a single table which match each other.
`tmatchn`
  Generic crossmatching between multiple (>2) tables.
`tjoin`
  Trivial join operation between multiple tables in which no row re-ordering is required. This barely warrants the term "crossmatch" and the concepts explained in the rest of this section are not relevant to it.

- 7.1 Match Criteria

- 7.1.1 `sky`: Sky Matching
- 7.1.2 `skyerr`: Sky Matching with Per-Object Errors
- 7.1.3 `skyellipse`: Sky Matching of Elliptical Regions
- 7.1.4 `sky3d`: Spherical Polar Matching
- 7.1.5 `exact`: Exact Matching
- 7.1.6 `1d`, `2d`, ...: Isotropic Cartesian Matching
- 7.1.7 `2d_anisotropic`, ...: Anisotropic Cartesian Matching
- 7.1.8 `2d_cuboid`, ...: Cuboid Cartesian Matching
- 7.1.9 `1d_err`, `2d_err`, ...: Cartesian Matching with Per-Object Errors
- 7.1.10 `2d_ellipse`: Cartesian Matching of Elliptical Regions
- 7.1.11 Custom Matchers
- 7.1.12 Matcher Combinations

- 7.2 Multi-Object Matches

Next Previous Up Contents
Next: Match Criteria
Up: Top
Previous: tosql

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk