Skip to main content
Sandbox Physics
Stellar spectra from dark lines to abundance models

AC03 · L3

From emergent intensity to a fitted spectrum

Predict the light leaving the gas, predict how the instrument records it, then compare that prediction with saved samples. Continuum placement, instrumental spreading and wavelength calibration enter before a fitted number acquires a physical meaning.

Write the instrument response before the fit

Let q(λ)q(\lambda) denote the normalized slab intensity. An ideal instrument would record it directly. A real response GG spreads each input across nearby wavelengths; adding those contributions defines a convolution.

The response must integrate to one. A constant continuum then remains constant, and a complete line retains its integrated missing area. The implementation convolves q−1q-1 and extends that deficit by zero outside the domain. This supplies a unit continuum beyond the edges instead of creating artificial dark edge pixels.

qinst(λ)=∫G(λ−λ′)q(λ′)dλ′,∫G(u)du=1q_{\rm inst}(\lambda)=\int G(\lambda-\lambda^\prime)q(\lambda^\prime)d\lambda^\prime,\qquad\int G(u)du=1
The response has inverse-wavelength units. A truncated window can still lose area when the response spreads light beyond its boundaries.

Reading: Condon & Ransom, Essential Radio Astronomy, Appendix E · Krumholz, ASTR 4003/8003 (2019), Class 1, Radiative transfer I

Estimate the continuum with the line

A calibrated spectrum can retain a local slope. Forcing that continuum flat can make a fit move the line or change its depth to compensate. Use C(λ)=a+bxC(\lambda)=a+b x locally, where xx is a dimensionless wavelength coordinate relative to a fixed origin.

The prediction is Mi=C(λi)qinst(λi)M_i=C(\lambda_i)q_{\rm inst}(\lambda_i). At fixed line velocity, width and optical depth, the continuum coefficients remain linear. Solve their two normal equations directly and search only over the nonlinear line parameters.

Set ui=qiu_i=q_i and vi=xiqiv_i=x_iq_i, with qi=qinst(λi)q_i=q_{\rm inst}(\lambda_i) and weights wi=1/σi2w_i=1/\sigma_i^2. The prediction becomes aui+bvia u_i+b v_i. Differentiate the weighted residual sum with respect to each continuum coefficient. Both derivatives vanish at the minimum, giving the two equations below.

The matrix simply groups two simultaneous equations. Compute the five weighted sums and solve for intercept and slope. Its determinant is nonzero only when the two basis columns provide distinct information: a single wavelength cannot determine both continuum height and slope.

χ2=∑i[yi−(a+bxi)qinst(λi)σi]2\chi^2=\sum_i\left[\frac{y_i-(a+b x_i)q_{\rm inst}(\lambda_i)}{\sigma_i}\right]^2
Here y is observed intensity and sigma is its random standard deviation. A familiar chi-square interpretation requires an appropriate model of independent errors.
(∑iwiui2∑iwiuivi∑iwiuivi∑iwivi2)(ab)=(∑iwiuiyi∑iwiviyi)\begin{pmatrix}\sum_i w_i u_i^2&\sum_i w_i u_i v_i\\\sum_i w_i u_i v_i&\sum_i w_i v_i^2\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix}=\begin{pmatrix}\sum_i w_i u_i y_i\\\sum_i w_i v_i y_i\end{pmatrix}
These are the continuum normal equations at a fixed line model. The outer search then compares the next velocity, width and optical depth.

A good residual can hide a wrong velocity

The controlled tutorial injects 18 km s−118\,\mathrm{km\,s^{-1}} into a saved synthetic record at resolving power 6000060000. Fitting continuum, velocity, Doppler parameter and reference optical depth recovers about 18.0 km s−118.0\,\mathrm{km\,s^{-1}} with reduced chi-square near 1.041.04. This checks recovery from those particular saved samples.

Now add 0.002 nm0.002\,\mathrm{nm} to every wavelength without changing intensity or noise. The fitted velocity becomes about 19.2 km s−119.2\,\mathrm{km\,s^{-1}} with almost the same residual. A shared wavelength zero-point error closely imitates common gas motion.

A specified zero-point uncertainty of 0.0002 nm0.0002\,\mathrm{nm} corresponds to 0.120 km s−10.120\,\mathrm{km\,s^{-1}} at five hundred nanometres. More pixels under the same calibration do not average away that common shift.

δv≃cδλ0λ0\delta v\simeq c\frac{\delta\lambda_0}{\lambda_0}
Reducing this common calibration uncertainty requires independent wavelength information.

Let a real spectrum expose model shortcomings

The observed tutorial pins a CALSPEC Vega spectrum and selects only the optical region identified in its header as STIS observations. Its broad hydrogen line has wings. A simple Gaussian leaves a huge weighted residual when compared with the small statistical errors. Changing the window, continuum or profile changes its apparent center and width.

That is a useful transition from a teaching spectrum to astronomical data. A numerical optimizer needs a physical description that survives residual checks before it can yield reliable stellar parameters. First report line-measurement sensitivity. Interpreting abundance then requires a fuller atmospheric calculation.

Reading: STScI CALSPEC, alpha_lyr_stis_011.fits (25 October 2022) · MAST reference atlases and CALSPEC releases · Amarsi, Liljegren & Nissen (2022), 3D non-LTE iron abundances in FG-type dwarfs, arXiv:2209.13449v3

Saved default prediction for the teaching slab

Uniform layer, fixed ion stage and artificial transitions; no random noise. The saved calculation uses 721 wavelengths and a normalized Gaussian instrument response.

Layer temperature4500 K4500\,\mathrm K
Column / referenceN/N0=1N/N_0=1
Receding velocity12 km s−112\,\mathrm{km\,s^{-1}}
Resolving powerR=60000R=60000
Strong-line center500.0200 nm500.0200\,\mathrm{nm}
Total equivalent width11.952 pm11.952\,\mathrm{pm}
Layer / background source ratio0.2010.201

Compare area with central depth

  1. Hold the layer fixed and change resolving power.
  2. Compare central depth with equivalent width and explain why they respond differently.
  3. Export both model spectra so the inputs and samples remain together, then examine the observed tutorial.

Exercises with explanations

  1. Why does a shared wavelength zero point survive averaging many pixels?

    Read the explanation

    All pixels move together, like marks on a ruler with a misplaced origin. Independent positive and negative errors could cancel; this common shift cannot.

  2. Should a huge reduced chi-square be fixed by rescaling the error bars until it equals one?

    Read the explanation

    First inspect residual structure, continuum, instrument response and omitted physics. Arbitrarily enlarging errors hides evidence of a poor model.

Sources and calculation scope

  1. Krumholz, ASTR 4003/8003 (2019), Class 1, Radiative transfer I

    Equations 24–28: integrating factor, formal solution and constant-source slab. Independently derived and checked by numerical transport here.

  2. Condon & Ransom, Essential Radio Astronomy, Appendix E

    Transfer equation 2.27, LTE Kirchhoff relation 2.30 and Planck law 2.86; used at optical wavelengths with the full Planck function.

  3. STScI CALSPEC, alpha_lyr_stis_011.fits (25 October 2022)

    Pinned FITS header and all 82 selected observed STIS rows from 4750 to 4975 vacuum angstroms. File checksum and exact source rows accompany the tutorial.

  4. MAST reference atlases and CALSPEC releases

    Data provenance and release context. The exercise deliberately pins version eleven rather than the changing current directory.

  5. Amarsi, Liljegren & Nissen (2022), 3D non-LTE iron abundances in FG-type dwarfs, arXiv:2209.13449v3

    Version three, 9 December 2022: sections 2.1–2.4 and 3.1, figures 2, 3, 8 and 10. The paper-reading guide checks conventions and sensitivity; it does not rerun the 3D solver.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy