APOGEE Spectrum Models¶
Module: astra.models.apogee
APOGEE spectra are infrared spectra (H-band, ~1.5–1.7 micron) with 8575 pixels on a log-lambda wavelength grid. There are three APOGEE spectrum models in Astra, each corresponding to a different stage of processing.
ApogeeVisitSpectrum¶
An individual visit spectrum from the APOGEE data reduction pipeline, stored in an apVisit file. A “visit” is a single observation of a source (possibly combining multiple dithered exposures within the same night).
Key Fields¶
Field |
Type |
Description |
|---|---|---|
|
ForeignKeyField |
Unique spectrum identifier, links to the |
|
ForeignKeyField |
Foreign key to the |
|
TextField |
Data release (e.g., |
|
TextField |
APOGEE reduction pipeline version |
|
TextField |
Telescope used (e.g., |
|
TextField |
Plate identifier |
|
TextField |
Field identifier |
|
IntegerField |
Fiber number |
|
IntegerField |
Modified Julian Date of observation |
|
TextField |
Object name (computed per-spectrum from input RA/Dec) |
|
FloatField |
Signal-to-noise ratio |
|
PixelArray |
Wavelength array (vacuum, observed frame) |
|
PixelArray |
Flux array |
|
PixelArray |
Inverse variance array |
|
PixelArray |
Per-pixel quality flags |
Radial velocity fields:
Field |
Type |
Description |
|---|---|---|
|
FloatField |
Absolute radial velocity (km/s) |
|
FloatField |
Relative radial velocity (km/s) |
|
FloatField |
Uncertainty on relative radial velocity (km/s) |
|
FloatField |
Barycentric correction (km/s) |
|
FloatField |
Effective temperature from Doppler RV code |
|
FloatField |
Surface gravity from Doppler RV code |
|
FloatField |
Metallicity from Doppler RV code |
Quality flags:
Field |
Type |
Description |
|---|---|---|
|
BitField |
Bit field encoding quality warnings |
|
bit 0 |
Spectrum has many bad pixels |
|
bit 2 |
Star has a neighbor more than 10x brighter |
|
bit 3 |
Star has a neighbor more than 100x brighter |
|
bit 4 |
Low S/N spectrum |
|
bit 22 |
RV failure |
Methods and Properties¶
path (property)¶
Returns the file path to the apVisit FITS file for this spectrum. The path template depends on release and telescope.
visit = ApogeeVisitSpectrum.get_by_id(1)
print(visit.path)
# e.g., "$SAS_BASE_DIR/ipl-4/spectro/apogee/redux/1.3/visit/apo25m/..."
get_path_template(release, telescope) (classmethod)¶
Returns the file path template string for a given release and telescope combination.
flag_bad (hybrid property)¶
Returns True if any of the critical quality flags are set (flag_bad_pixels, flag_very_bright_neighbor, flag_bad_rv_combination, flag_rv_failure). Can be used in database queries.
flag_warn (hybrid property)¶
Returns True if any spectrum flag is set. Can be used in database queries.
ApogeeVisitSpectrumInApStar¶
A visit spectrum as stored within an apStar file. Unlike the raw apVisit, these spectra have been resampled onto a common log-lambda wavelength grid and shifted to the source rest frame.
Key Fields¶
Fields are similar to ApogeeVisitSpectrum, with these additions:
Field |
Type |
Description |
|---|---|---|
|
ForeignKeyField |
Links back to the original |
|
TextField |
apStar version (default: |
|
IntegerField |
HEALPix index (may differ from Source due to APOGEE DRP computation) |
Spectral data arrays:
Field |
Type |
Description |
|---|---|---|
|
PixelArray |
Log-lambda wavelength grid (8575 pixels, crval=4.179, cdelt=6e-6) |
|
PixelArray |
Flux on the common grid |
|
PixelArray |
Inverse variance on the common grid |
|
PixelArray |
Per-pixel quality flags |
Methods and Properties¶
path (property)¶
Returns the file path to the apStar FITS file. Path templates differ between "sdss5" and "dr17" releases.
ApogeeCoaddedSpectrumInApStar¶
A co-added (stacked) APOGEE spectrum from an apStar file, created by combining all good visit spectra for a source. This represents the highest signal-to-noise APOGEE spectrum available for a given source.
Key Fields¶
Field |
Type |
Description |
|---|---|---|
|
ForeignKeyField |
Unique spectrum identifier |
|
ForeignKeyField |
Foreign key to the |
|
BigIntegerField |
APOGEE DRP star primary key |
|
TextField |
Data release |
|
TextField |
APOGEE reduction pipeline version |
|
TextField |
Object name |
|
TextField |
Telescope used |
Observation summary:
Field |
Type |
Description |
|---|---|---|
|
IntegerField |
Number of entries in apStar file |
|
IntegerField |
Number of visits |
|
IntegerField |
Number of good visits |
|
IntegerField |
Number of good RV measurements |
|
IntegerField |
Minimum MJD of contributing visits |
|
IntegerField |
Maximum MJD of contributing visits |
Summary statistics and radial velocity:
Field |
Type |
Description |
|---|---|---|
|
FloatField |
Signal-to-noise ratio of co-added spectrum |
|
FloatField |
S/N-weighted mean fiber number |
|
FloatField |
Standard deviation of fiber numbers |
|
FloatField |
Mean radial velocity (km/s) |
|
FloatField |
Uncertainty on mean radial velocity (km/s) |
|
FloatField |
Scatter in radial velocity across visits (km/s) |
|
FloatField |
Effective temperature from Doppler |
|
FloatField |
Surface gravity from Doppler |
|
FloatField |
Metallicity from Doppler |
Spectral data:
Field |
Type |
Description |
|---|---|---|
|
PixelArray |
Log-lambda wavelength grid (8575 pixels, crval=4.179, cdelt=6e-6) |
|
PixelArray |
Co-added flux |
|
PixelArray |
Co-added inverse variance |
|
PixelArray |
Per-pixel quality flags |
Methods and Properties¶
path (property)¶
Returns the file path to the apStar FITS file containing this co-added spectrum.
coadd = ApogeeCoaddedSpectrumInApStar.get_by_id(1)
print(coadd.path)