LAST_DP_PhotometricCalibration - EranOfek/AstroPack GitHub Wiki
1. Overview
The photometry is not calibrated with color terms from standard stars; the instrument-plus-atmosphere transmission of each image is fitted directly, using Gaia DR3 low-resolution spectra as calibrators, and the zero point is defined by integrating a reference spectrum through that fitted transmission.
The steps, per sub-image:
- Match the detected sources to Gaia DR3 sources that have an XP spectrum
(the
GAIADR3speccatalog). - Fit the transmission
T(λ)— the combined throughput of atmosphere and instrument — so that each calibrator's Gaia spectrum, folded throughT(λ), reproduces its observed flux. - Define the zero point by integrating a single reference spectrum
through the fitted
T(λ). The reference spectrum is a power law in frequency flux density with indexα. - Apply that zero point to every source to obtain calibrated magnitudes.
Because the transmission is fit per image, the calibration already accounts for that image's atmosphere (airmass, aerosols, water vapor) and instrument state. What it does not do by itself is account for the fact that real stars are not power laws — that residual, which depends on a star's color, is handled by a separate, optional color-term correction (Section 4).
2. The physical model
The zero point is the integral of a reference spectrum through the fitted transmission; everything a user needs follows from the shape of that reference spectrum.
The reference spectrum is a power law in frequency flux density,
F_ν(λ) = F_ν,AB · (λ / λ_p)^α , λ_p = 5500 Å
where λ_p is a fixed pivot wavelength (header keyword PT_REFPV) and α is
the reference slope (PT_REFSL, default 1.642). The zero point is
ZP = 2.5 · log10( (Aperture / h) · ∫ T(λ) · F_ν(λ) · dλ/λ )
i.e. the photon-weighted band integral of the reference spectrum through the
transmission. A source of observed flux f [counts] gets
mag = -2.5 · log10(f) + ZP .
Two consequences matter to a user:
- The magnitudes are not on the AB scale. AB would require a flat
F_ν(α = 0); LAST integrates a sloped reference (α = 1.642) because that describes a typical field star far better. The offset between the two is recorded per image asPT_DZPAB= ZP(PT_REFSL) − ZP(slope 0), so a user who wants AB can recover it without re-running the integral. - The conversion is exact only for a star whose spectral slope equals
PT_REFSL. A star of a different color carries a color-dependent error, which grows with airmass (because extinction enters asT(λ)^X). Section 4 gives the formulae to remove it.
3. How the fit is done
This section can be skipped by a typical user. The transmission is a product of physical components, a handful of whose parameters are fit per image by matching synthetic to observed calibrator fluxes.
Transmission model. T(λ) is built as a product (DefaultLASTFunList):
T(λ) = Norm · Rayleigh · Aerosol · Ozone · Water · UMG · Instrument · QE
- Atmosphere: Rayleigh scattering, aerosol (Angstrom law, optical depth
TauAod500), ozone, water vapor (precipitable waterPWV), and the uniformly-mixed gases (UMG — O₂, CO₂, CH₄, …). These follow the SMARTS model; each enters with airmass asT(λ)^X. - Instrument: a fixed mirror-plus-corrector throughput and a detector quantum efficiency (a skewed Gaussian).
Only a few parameters are free (a normalization, aerosol optical depth, water vapor, ozone, and the QE shape); the rest are held at their physical values.
Calibrators. Sources are matched to GAIADR3spec within a ~2″ radius, after
propagating the Gaia positions from epoch J2016 to the observation epoch. The
calibrator set is gated to Gaia-G in [12, 16], passed through S/N limits, and
audited (BP−RP excess, neighbor distance, star classification) to drop blends
and non-stellar sources.
Optimization. The default sequence (LAST_Joint_2Iter_AtmosFirst_Split3)
alternates fast linear least-squares steps for the normalization and the 2D
field term with nonlinear steps for the atmospheric parameters, under iterative
sigma-clipping of outlier calibrators.
Position dependence. A low-order 2D polynomial (Tran2D) captures the
smooth variation of the zero point across the field; its normalization is
recorded in PT_P_*.
4. Correcting a magnitude for star color
The calibration integrates one reference spectrum of slope PT_REFSL, so a
star of a different color is mis-calibrated by an amount proportional to how far
its spectral slope sits from PT_REFSL. The correction replaces the single
reference slope with each star's own, read from a fixed color–slope relation.
4.1 The color–spectral slope relation α(BP−RP)
Measured once, globally, from 57 971 Gaia DR3 XP spectra (all-sky, G in
[6, 17], BP−RP excess factor < 2). For each spectrum, F_ν is formed from the
tabulated F_λ, and α is the throughput-weighted least-squares slope of
ln F_ν against ln λ over the LAST bandpass — throughput-weighted because the
zero point responds to the band integral ∫ T(λ) F_ν(λ) dλ/λ, not to the slope
at any single wavelength. The per-color medians are fit with a quadratic over
BP−RP ∈ [0.3, 3.5]:
α(BP−RP) = c₂·(BP−RP)² + c₁·(BP−RP) + c₀
| coefficient | value |
|---|---|
| c₂ | −0.0410 |
| c₁ | 2.4150 |
| c₀ | −0.7320 |
The maximum deviation of the fit from the binned medians over [0.3, 3.5] is
0.020 in α. The intrinsic scatter of α at fixed color is 0.09 (the
SigmaAlpha argument, used to propagate a correction error). The relation is
close to linear, slope ≈ +2.4 per magnitude of BP−RP, and reddening is
sub-dominant (|b| ≥ 25° and |b| < 10° subsamples agree to 0.01–0.05 in α up to
BP−RP ≈ 2).
These coefficients are the same for every image, which is why they are not
written to the header. They are the AlphaPoly default in
imProc.calib.applyColorTerm and PhotCalibTrans.evaluateColorTerm.
Representative values:
| BP−RP | α | roughly |
|---|---|---|
| 0.4 | 0.227 | F2 |
| 0.8 | 1.176 | G2 (solar) |
| 1.0 | 1.642 | K1 — the anchor |
| 1.5 | 2.813 | K5 |
| 2.0 | 3.934 | M0 |
| 3.0 | 6.144 | M4 |
α is large for ordinary stars because of the F_ν convention: flat F_ν
(α = 0) is an A0 star, and at 5500 Å every cooler star is still on the blue
side of its F_ν peak, where F_ν climbs steeply toward the red. For a
blackbody, α = −3 + x/(1 − e^−x) with x = hc/(λ k T) = 26160 K / T at 5500 Å,
giving α = 1.50 at 5880 K and α = 1.93 at 5350 K.
4.2 The correction formula
The per-image sensitivity of the magnitude to the reference slope is stored as a
polynomial in the slope offset d = α − PT_REFSL, with coefficients
PT_CTA … PT_CTA4:
d = α(BP_RP) − PT_REFSL
ΔMag(d) = PT_CTA·d + PT_CTA2·d² + PT_CTA3·d³ + PT_CTA4·d⁴
The correction actually applied to a star is a difference, so that it vanishes at a chosen anchor color:
correction = ΔMag(d_star) − ΔMag(d_anchor)
where d_anchor = α(PT_REFC) − PT_REFSL. This is what
imProc.calib.applyColorTerm computes. The correction is not baked into the
catalog magnitudes — it is measured per image and recorded so a user can apply
it on demand.
4.3 The anchor
The anchor color PT_REFC (default 1.0) is the color left uncorrected — the
constant of integration of a differential correction. Any choice is admissible
provided it is recorded. The defaults are chosen so the anchor and the reference
spectrum describe the same star:
| keyword | default | meaning |
|---|---|---|
PT_REFC |
1.0 | anchor color; the color left uncorrected |
PT_REFSL |
1.642 | reference-spectrum slope = α(1.0) from the relation above |
APCC_REF |
1.0 | anchor of the aperture color terms, pinned to the same value |
so polyval(AlphaPoly, PT_REFC) = PT_REFSL exactly. BP−RP = 1.0 is also the
median color of a typical LAST field, which matters: an anchor far from the
field median makes the correction large and epoch-varying for the bulk of the
stars, injecting an airmass-correlated drift common to all of them. Setting
fitPhotCalibTrans('RefColorPerImage', true) replaces the anchor with the
image's own median color.
4.4 The three "color terms"
Three distinct quantities share the name; they are not interchangeable:
- Transmission color term (
PT_CTA … PT_CTA4, mag per unitα) — from evaluating the magnitude by integrating an assumed spectrum through the throughput. This is the term of Section 4.2. - Image (aperture) color term (
APCC_%s, mag per mag) — from the aperture correction. - Airmass color term (mag per mag per airmass) — the change with airmass of the magnitude of a star offset in color from a fiducial. Not written to the header; derivable from the data.
Neither the transmission nor the image color term is applied to the catalog magnitudes by default; both are recorded for on-demand use.
5. Fit quality and stability
Each image carries a compact record of its own fit quality, and the image-to-image repeatability of bright stars is a few milli-magnitudes.
Per-image quality keywords:
| keyword | meaning |
|---|---|
PT_RMS |
RMS of the calibration fit [mag] |
PT_ARMS |
robust bright-star RMS: sqrt(median(R²)) over the N brightest calibrators [mag] |
PT_CHI2 |
χ² of the fit |
PT_DOF |
degrees of freedom |
PT_NCALI |
number of calibrators used (after sigma-clipping) |
The reduced χ² correlates with the number of calibrators (small-N overfitting plus density-dependent systematics), with a median weighted-RMS of order 1.7; this is an irreducible floor, not a weighting bug.
Stability (representative — confirm against the current run). On repeated visits of the same field, the per-source magnitude repeatability (robust RMS of the light curve of bright, well-measured stars) is ≈ 3.5–4 mmag in the v1 pipeline, versus ≈ 6–7 mmag in the older v0 pipeline. These figures depend on field, airmass range, and the star sample; the numbers here should be replaced with the latest validated run before publication.
6. When the number of calibrators per field is non-sufficient
Two calibration modes. Photometric calibration runs in one of two modes, and the fit flags say which one a crop got. In the regular mode the full transmission model is fitted — normalization, three atmospheric parameters and the position-dependent coefficients — with sigma clipping between stages. When the number of calibrators falls below the minimum needed to constrain that model, at selection or at any clipping step, the fit falls back to the reduced mode: all parameters are returned to their defaults, the position-dependent coefficients are set to zero, so the zero point is flat across the crop, and only the normalization is fitted, as the unweighted median of the per-star zero points, without clipping. The catalogue magnitudes are written as usual; aperture correction is unaffected, having its own calibrator set.
The quickest test is PT_P_F1: 0 means reduced, 1 means regular, and blank means
the crop was not photometrically calibrated at all. Two other cards agree with it —
PT_P_V2…PT_P_V4 are all zero, and PT_DOF = PT_NCALI − 1, as a one-parameter
fit gives. The zero point itself is essentially mode-independent; the accuracy of values
obtained in the reduced mode is naturally worse.
Appendix: dedicated header keyword reference (see https://github.com/EranOfek/AstroPack/wiki/LAST_DP_PipeI_Header for the full list of keywords)
| keyword | meaning |
|---|---|
PT_ZP |
photometric zero point at image center [mag] (1 count, full exposure) |
PT_REFSL |
reference-spectrum F_ν slope α: F_ν ∝ (λ/PT_REFPV)^α |
PT_REFPV |
reference-spectrum pivot wavelength [Å] (5500) |
PT_DZPAB |
AB offset: ZP(PT_REFSL) − ZP(slope 0) [mag] |
PT_DZP |
constant-band delta ZP [mag] |
PT_CTA |
transmission color term, dMag/dα [mag per unit α] |
PT_CTA2 |
quadratic color-term coefficient [mag per α²] |
PT_CTA3 |
cubic color-term coefficient [mag per α³] |
PT_CTA4 |
quartic color-term coefficient [mag per α⁴] |
PT_CTAE |
max model error of the stored color-term curve over BP−RP 0.5–3 [mag] |
PT_REFC |
anchor color BP−RP where the color term vanishes |
PT_RMS |
RMS of the calibration fit [mag] |
PT_ARMS |
robust bright-star RMS [mag] |
PT_CHI2 |
χ² of the calibration fit |
PT_DOF |
degrees of freedom of the calibration fit |
PT_NCALI |
number of photometric calibrators used for the fit |
PT_AREF |
atmospheric-model reference (e.g. SMART v2.9.8) |
PT_SPEC |
calibrator spectra reference (GaiaDR3) |
PT_CO2PP |
CO₂ abundance used [ppm] |
PT_P_* |
parameters of the position-dependent (Tran2D) correction — model type, coordinate normalization, polynomial coefficients and their fit flags (see below) |
PT_<I>_* |
parameters of the fitted transmission functions — per component I, the function reference, parameter values and fit flags (see below) |
Fit-reconstruction keywords
Two families of keywords store the parameters of the fit itself rather than a user-facing result:
PT_P_*— the parameters of the position-dependent correction: theTran2Dmodel type, the coordinate normalization, the polynomial coefficients, and a fit flag per coefficient.PT_<I>_*— the parameters of the transmission functions, one block per component of the transmission model (Normalization, Rayleigh, Aerosol, Ozone, Water, UMG, instrument, QE): the function reference, its parameter values (e.g. aerosol optical depth, precipitable water), and a fit flag per parameter.
Both families exist so that a calibration can be fully reconstructed (or audited) from the header alone; a typical user does not need them.
The α(BP−RP) coefficients (c₂, c₁, c₀) and SigmaAlpha are not in the
header: they are global constants, identical for every image.