Observation Models

This appendix details the observation-layer models that project the intrinsic SED into observable space.

Photometry

Observed flux densities are computed by convolving the redshifted SED through filter transmission curves in the AB system: $$f_\nu^{\rm obs}(b) = \frac{1+z}{4\pi d_L^2} \cdot \frac{\int L_\nu\bigl(\lambda/(1+z)\bigr), T_b(\lambda), w(\lambda), d\lambda}{\int T_b(\lambda), w(\lambda), d\lambda},

(1)\[\]

where \(T_b(\lambda)\) is the filter transmission, \(d_L\) is the luminosity distance, the factor \((1+z)\) converts the rest-frame \(L_\nu\) to the observed frame, and \(w(\lambda) = 1/\lambda\) is the photon-counting weight of the default bessell convention (the energy convention uses \(w = 1/\lambda^2\); the units page lists both). AB magnitudes follow as \(m_{\rm AB} = -2.5\,\log_{10}(f_\nu) - 48.6\).

Spectroscopy

Pixel-level model.

The model spectrum at observed pixel wavelengths \(\lambda_j\) is $\(f(\lambda_j) = \frac{1+z}{4\pi d_L^2} \cdot L_\nu\!\left(\frac{\lambda_j}{1+z}\right).\)$

Velocity broadening.

Stellar velocity dispersion \(\sigma_v\) is applied via FFT convolution in log-wavelength space (equivalent to velocity space, \(\Delta v/c = \Delta\ln\lambda\)). The kernel is a Gaussian with width \(\sigma_{\rm pix} = (\sigma_v/c) / \Delta\ln\lambda\) pixels.

Line spread function (LSF).

The effective LSF subtracts the SSP library resolution in quadrature: $\(\sigma_{\rm eff}(\lambda) = \sqrt{\sigma_{\rm inst}(\lambda)^2 - \sigma_{\rm lib}^2},\)\( where \)\sigma_{\rm inst} = c/(2.355, R(\lambda))\( in km s\)^{-1}\(. For constant \)R\( (e.g., a grating), a single FFT convolution suffices. For wavelength-dependent \)R\( (e.g., JWST NIRSpec PRISM, \)R \approx 30\(--\)330\(), a piecewise-constant approximation splits the wavelength range into \)\mathord{\sim}16\( segments with smooth raised-cosine blending, yielding \)\mathord{\sim}1%$ accuracy.

Order of the stages and the spectrum lookup table.

The spectrum is built in three stages: (1) the stellar piece is broadened by \(\sigma_v\) on the model wavelength grid; (2) the IGM transmission multiplies it; (3) the instrument kernel is applied on the pixel grid, with width \(\sqrt{\sigma_{\rm inst}^2 s^2 - \sigma_{\rm lib}^2}\) for the stellar piece and \(\sigma_{\rm inst}\, s\) for the nebular piece (\(s\) is lsf_scale). approx=SpectrumPrecomp() runs the same three stages. Stage 1 stays on the model grid because point sampling at the pixels aliases sharp stellar features: broadening after sampling differs from the exact result by up to 40 % at the Ca II K core. For a fixed redshift and a fixed \(\sigma_v\) the templates are broadened once at build; otherwise the stellar sum is broadened per draw. With a fixed \(\sigma_v\) and a free redshift the SSP cube is broadened once at build (the velocity kernel does not depend on redshift), unless a 4-D alpha grid or a free AGB weight modifies the cube per draw. With a free \(\sigma_v\) an explicit SpectrumPrecomp() stays on the table and warns once about the cost, while approx="auto" (and a joint fit with approx=WavePrecomp()) keeps the spectrum channel exact and says so once; with a fixed \(\sigma_v\), point-sampled or model-grid-fine pixels and no resolution matrix, approx="auto" selects the table. A banded resolution matrix is not carried by the table and falls back to the exact path.

Chebyshev calibration polynomial.

A multiplicative polynomial absorbs flux-calibration uncertainties (Johnson 2021): $$C(\lambda) = \sum_{k=0}^{K} c_k, T_k(u), \quad u \equiv \frac{2\lambda - \lambda_{\min} - \lambda_{\max}}{\lambda_{\max} - \lambda_{\min}},

(2)\[\]

where \(T_k\) are Chebyshev polynomials of the first kind, \(c_0 = 1\) (fixed), and \(c_1, \ldots, c_K\) are free parameters with priors \(c_k \sim \mathcal{N}(0, \sigma_c)\). The default is \(K = 0\), i.e. calibration is disabled and the predicted spectrum is returned unmodified; \(K = 3\) with \(\sigma_c = 0.1\) is the recommended configuration when continuum systematics are expected, and both \(K\) and \(\sigma_c\) are configurable via Parameters. The model spectrum is \(f_{\rm obs}(\lambda) = C(\lambda) \cdot f_{\rm model}(\lambda)\).

Equivalent-Width Conventions

Three implementations of an equivalent width (EW) coexist. They differ in sign and in the continuum they subtract:

Implementation

Sign

Continuum

SpectralIndexDef with index_type="EW" (Lick form)

absorption positive: \(W\,(F_{\rm cont} - F_{\rm line})/F_{\rm cont}\) over the feature width \(W\)

mean of the two sideband mean fluxes

equivalent_width (analysis diagnostics)

emission positive

mean flux of two symmetric sidebands

CIGALE restframe_parameters (EW)

emission positive in the returned value (its parameter help states the opposite)

linear, interpolated between the centers of the two sidebands

: Equivalent-width conventions.

The three agree only on a flat continuum. For a Gaussian emission line (\(\sigma = 1.5\,\)Å, unit amplitude, at 6563 Å) on a continuum \(L_\lambda \propto \lambda^{-4}\) the analytic EW is 3.76 Å. Measured on the \(L_\lambda\) array with sidebands 6500–6525 Å and 6610–6635 Å and the feature window 6535–6600 Å, CIGALE returns 3.73 Å and SpectralIndexDef \(-3.73\) Å; equivalent_width with a line window of \(\pm 20\,\)Å and sidebands 50 Å wide returns 3.74 Å (3.75 Å and 3.70 Å for sidebands 20 Å and 100 Å wide). SpectralIndexDef takes ratios of window means of the array it is given, and the forward model passes \(L_\nu\): on the \(L_\nu\) array the same line gives \(-3.75\) Å. On a continuum that is flat in \(L_\lambda\) CIGALE and equivalent_width give 3.76 Å (equivalent_width converts its input to \(f_\lambda\); on a continuum flat in \(L_\nu\) it gives 3.75 Å), and SpectralIndexDef gives \(-3.76\) Å on a continuum that is flat in the unit of the array it is given. The mean-of-sidebands continuum equals the linear one at the center of the line window only when the two sidebands are symmetric about it. To compare with CIGALE, flip the sign of the SpectralIndexDef value, measure on \(L_\lambda\) and use the same windows.

Which to use. Measure absorption features with SpectralIndexDef (index_type="EW"), whose value is absorption-positive in the Lick convention. Measure emission lines with equivalent_width in tengri.analysis.diagnostics.spectral, whose value is emission-positive. Do not place both kinds of value in one table without flipping the sign of one of them.

Joint Fitting

Photometry and spectroscopy can be fit simultaneously by concatenating their data vectors and noise vectors. Each data type uses its own forward model (Equations (1) and (2)) but shares the same physical parameters.

References

Johnson, Benjamin D. 2021. bd-j/sedpy: sedpy v0.2.0. Version v0.2.0. Zenodo. https://doi.org/10.5281/zenodo.4582723.