![](https://csdnimg.cn/release/download_crawler_static/78305982/bg1.jpg)
NWAY - The versatile
catalogue matching tool
User Manual, version 1.0
Written by Johannes Buchner
22. August 2016
![](https://csdnimg.cn/release/download_crawler_static/78305982/bg2.jpg)
Contents
1 Why NWAY? 3
2 User Manual 5
2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Citing NWAY correctly . . . . . . . . . . . . . . . . . . . . 5
2.3 Development, questions and issues . . . . . . . . . . . . . . 6
2.4 Best practice matching . . . . . . . . . . . . . . . . . . . . . 6
2.5 Simple distance-based matching . . . . . . . . . . . . . . . 7
2.5.1 Example - Preparing input files . . . . . . . . . . . 8
2.5.2 Example - Matching two catalogues . . . . . . . . 9
2.5.3 Example - Output of matching two catalogues . . . 13
2.6 Matching with additional information . . . . . . . . . . . . 15
2.6.1 Example - Using magnitude information . . . . . . 15
3 Program Arguments 19
4 Input file specifications and units 20
5 Mathematical details and Implementation 21
5.1 Distance-based matching . . . . . . . . . . . . . . . . . . . 21
5.2 Magnitudes, Colors and other additional information . . . 23
5.3 Auto-calibration . . . . . . . . . . . . . . . . . . . . . . . . 24
5.4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . 25
2
![](https://csdnimg.cn/release/download_crawler_static/78305982/bg3.jpg)
1 Why NWAY?
In astrophysics, a common task is to assemble multi-wavelength informa-
tion about individual sources. This is done by taking the detections of
sources in the sky (positions, errors, and fluxes/magnitudes) from a cata-
logue of one wavelength and matching it to another from another wave-
length, or multiple such catalogues. Care has to be taken to consider all
possible matches and also the possibility that the source does not have a
counterpart in a catalogue of a given depth. For many classes of sources,
the Spectral Energy Distribution (SED) provides additional hints, which
associations are likely real. For instance, the color distribution of stars in
the WISE bands is different than that of quasars or galaxies.
NWAY is a generic solution to these tasks:
1. Matching of N catalogues simultaneously.
2. Consideration of all combinatorically possible matches.
3. Consideration of partial matches across catalogues, i.e. the absence
of counterparts in some catalogues.
4. Taking into account the positional uncertainty.
5. Computation of a probability for each possible match.
6. Computation of a probability that there is no match.
7. Incorporating magnitude, color or other information about the sources
of interest, refining the match probabilities.
Contributors
• Mara Salvato – idea and leading the science case.
• Tamás Budavári – shared basic implementation of his formulae.
• Sotiria Fotopoulou – initial implementation for matching three cat-
alogues.
3
![](https://csdnimg.cn/release/download_crawler_static/78305982/bg4.jpg)
• Johannes Buchner – complete code rewrite for the general case, doc-
umentation, manual and adding features.
The code is the results of many discussion among colleagues and friends.
We thank in particular: Tamás Budavári, Sotiria Fotopoulou, Fabrizia
Guglielmetti, Arne Rau, Tom Dwelly, Andrea Merloni and Kirpal Nan-
dra.
How to read this manual
This manual walks you through the installation and usage. It is best to try
out the examples as you read, because they illustrate how NWAY works.
Yellow boxes indicate text about the illustrative examples and their ex-
planations.
Useful explanation for users on how to prepare files or how to run
NWAY are found in blue boxes.
Light blue boxes indicate examples you can run yourself to learn NWAY.
Sometimes there are commands you can copy-paste.
If you are interested in the rigorous mathematical details, go to Chap-
ter 5.
Terminology
Source A detection in a certain wavelength significant enough to be
recorded in a catalogue with sky position.
Counterpart The corresponding source in another catalogue.
Association A specific combination of entries from the various cata-
logues, i.e. a tuple of detections associated with each other.
Match Same as association, used interchangeably.
Object A physical entity in the real universe, emitting radiation.
4
![](https://csdnimg.cn/release/download_crawler_static/78305982/bg5.jpg)
2 User Manual
2.1 Installation
NWAY is a pure Python program. Install NWAY through
$ sudo pip install nway
This will give you the tool nway.py.
Or if you do not have root access:
$ pip install nway --user
The tool nway.py is installed for you as ~/.local/bin/nway.py.
If that directory is in your $PATH, you can run $ nway.py --help.
Development version To get the latest development version, fetch
NWAY from
https://github.com/JohannesBuchner/nway
and run in the directory
$ python setup.py install --user.
You need to install these python packages:
scipy, astropy, matplotlib, progressbar-latest, argparse,
joblib, healpy.
Upgrading from older NWAY versions To upgrade, uninstall the
older NWAY version first:
$ pip uninstall nway
Repeat until it says that NWAY is not installed. Then follow the instal-
lation instructions above.
2.2 Citing NWAY correctly
Please cite Salvato et al., MNRAS, 2018 (ArXiV: https://arxiv.
org/abs/1705.10711, ADS: http://adsabs.harvard.edu/
abs/2018MNRAS.473.4937S).
5