The catalogue / How the catalogue is built
How the catalogue is built¶
scripts/build_catalogue_v2.py builds the super-catalogue from cross-matched
FITS files of spectra and labels. This page lists the input
files, gives the steps to build the file, and explains how the builder chooses
between repeated entries of a star.
Input files¶
Each input file pairs one survey with one label source. Its rows are the stars that both observed, after the cuts in Upstream selection.
Survey |
APOGEE file |
GALAH file |
|---|---|---|
BOSS |
|
|
DESI |
|
|
LAMOST LRS |
|
|
LAMOST MRS |
|
|
If a DESI file with _dr1 is missing, the builder reads the same name without
_dr1. Each file holds these table extensions, with one row per spectrum:
Extension |
Columns |
|---|---|
|
the Gaia DR3 source ID, in |
|
|
|
|
|
|
|
|
|
the label source’s catalogue columns, such as |
|
|
Step 1: Place the input files¶
Put the FITS files in data/raw_catalogues/. The builder skips a missing
file, so a subset of the eight files also works. It prints a warning for each
missing file, except with --quiet. A survey without
input files has no group in the output.
Step 2: Check the counts¶
python scripts/build_catalogue_v2.py --dry-run
This prints the number of unique stars and the number of rows in each input file. It writes no file.
Step 3: Build the file¶
python scripts/build_catalogue_v2.py
This writes data/super_catalogue.h5, with the 11 default parameters as
[X/Fe]. A build with the extended set of elements and [X/H] abundances is:
python scripts/build_catalogue_v2.py \
--elements extended --abundance-scale x_h
This writes data/super_catalogue_xh_extended.h5.
Step 4: Check the file¶
from dorothy.data import CatalogueLoader
CatalogueLoader("data/super_catalogue.h5").info()
This prints the number of stars with data for each survey and label source, and the parameter names.
Builder options¶
Option |
Effect |
Default |
|---|---|---|
|
directory of the input files |
|
|
path of the HDF5 file |
|
|
|
|
|
|
|
|
the same as |
|
|
print the counts and write no file |
|
|
print less progress for each file, and no warning for a missing file |
Labels and quality flags describes the parameters of each choice.
One row per Gaia ID¶
The builder reads the Gaia DR3 source IDs of all input files. It drops IDs of 0 or less, and gives each remaining ID one row, sorted by ID. A star then gets its spectrum from each survey and its labels from each label source, wherever an input file has them.
RA and Dec come from the RVTAB extension of the first input file that stores
a spectrum for the star. They stay when a later file replaces that spectrum.
The builder reads the files survey by survey, in the order BOSS, DESI, LAMOST
LRS, LAMOST MRS, with the APOGEE file before the GALAH file. A star without
RA and Dec has 0 for both.
Repeat observations¶
A star can have several spectra from one survey. They are repeat observations in one file, or rows in both the APOGEE and the GALAH file of that survey. The builder keeps the spectrum with the highest signal-to-noise ratio (S/N):
where \(f_i\) is the flux and \(\mathrm{ivar}_i\) the inverse variance (ivar) of pixel \(i\). For LAMOST MRS the median runs over the pixels of both arms. On a tie, the builder keeps the earlier spectrum, with the APOGEE file read before the GALAH file.
Before this, the builder sets the flux and inverse variance of a pixel to 0 where either is not finite. An inverse variance of 0 marks the pixel as missing. The builder never stores a spectrum without a valid pixel. The wavelength grid of each survey comes from its first input file.
Repeated labels¶
A star can have several label rows from one label source. It has one in the file of each survey that observed it, or several in one file. The builder keeps the row with the most valid labels. On a tie, it keeps the earlier row, with files read in the order BOSS, DESI, LAMOST LRS, LAMOST MRS. A row with no valid labels is still stored when it is the star’s only row.
Upstream selection¶
The input files are made before the builder, outside this repository. Each survey and label source was cut on quality and S/N:
Source |
Quality cut |
S/N cut |
|---|---|---|
APOGEE |
|
|
GALAH |
|
|
DESI |
|
|
BOSS |
|
|
LAMOST LRS |
|
|
LAMOST MRS |
|
|
Each survey’s stars were matched to APOGEE and to GALAH within 0.5 arcsec. A star is kept if it matches either label source. BOSS gives Gaia DR3 source IDs directly, and DESI through a join with its Gaia table. LAMOST, APOGEE and GALAH stars get them from a positional match to Gaia DR3.