astrocook.core.telluric module#

The telluric transmission of a spectrum (phase 7-ter, PR T1).

The transmission is the auxiliary column telluric (dimensionless, 1 where there is no telluric absorption): the name of design/identification.md (section 7) and of phase 7, 7b. The core reads it in one place, telluric_transmission(): the normalization (Spectrum.norm) is cont × telluric, unless the flux is already corrected for the tellurics, which the spectrum says with the flag TELLURIC_CORRECTED of its metadata (then the normalization is cont; the column stays, for the identification).

migrate_telluric() is applied when a spectrum is built (as the resolution, core/resolution.py), so that every source (archives, files, scripts) gives the same column:

  • telluric_model, the name read by the core before 2.8.0, becomes telluric;

  • a boolean telluric is the mask of V1’s telluric_mask (True in the bands), not a transmission: it becomes telluric_mask;

  • a telluric already there when telluric_model is renamed (written by the ASCII telluric loader and read by nothing before 2.8.0) is kept as telluric_unused: the normalization stays the one of telluric_model.

astrocook.core.telluric.TELLURIC_COLUMN = 'telluric'#

The column of the transmission

astrocook.core.telluric.LEGACY_TELLURIC_COLUMN = 'telluric_model'#

Its name before 2.8.0, renamed when a spectrum is built

astrocook.core.telluric.V1_MASK_COLUMN = 'telluric_mask'#

The V1 mask of the telluric bands (a boolean telluric column of V1)

astrocook.core.telluric.UNUSED_TELLURIC_COLUMN = 'telluric_unused'#

A telluric column met with telluric_model, kept under this name

astrocook.core.telluric.TELLURIC_CORRECTED = 'TELLURIC_CORRECTED'#

the flux is already corrected for the tellurics

Type:

The flag of the metadata

astrocook.core.telluric.TELLURIC_NAMES = ('telluric', 'telluric_model', 'trans_molecfit', 'mtrans')#

The names of a column of a telluric transmission in the files, in order of preference (matched ignoring the case): Astrocook, before 2.8.0, the Molecfit outputs (trans_molecfit of the ASCII files of the request of 7-ter, mtrans of its FITS tables), PypeIt (TELLURIC); T2

astrocook.core.telluric.is_telluric_corrected(meta: Mapping) → bool[source]#

Whether the metadata say that the flux is already corrected for the tellurics (the flag TELLURIC_CORRECTED: a bool, or T/F and the like as a FITS header or a user may write it); False without it.

astrocook.core.telluric.telluric_transmission(data) → ndarray | None[source]#

The transmission that enters the normalization of a spectrum (its SpectrumData): the values of the telluric column, or None without it or when the flux is already corrected (TELLURIC_CORRECTED).

astrocook.core.telluric.migrate_telluric(data)[source]#

data with the telluric columns under their names (module docstring); the same object when there is nothing to rename. The order of the columns is kept.