Pin the file and identify which part was observed
The observed input is CALSPEC alpha_lyr_stis_011.fits, version eleven. The complete file combines observations and model spectra. This exercise selects only its header-identified STIS optical portion: eighty-two good-quality rows between 4750 and 4975 vacuum angstroms, without resampling. The original FITS remains beside the extracted CSV so the header can be checked.
Its columns contain wavelength, absolute flux, statistical error, systematic error, spectral-resolution width, quality and exposure time. The header names G430L observations o8i105060, o8i106010 and o8i106040 and records the 2022 charge-transfer-efficiency update. Both original and excerpt have SHA-256 checksums.
The script verifies the original checksum before decoding the frozen table layout. It writes the excerpt with original row numbers. This deliberately limited decoder reads one known file; a different release needs a fresh header and schema check. Run both commands from the unzipped exercise folder.
python3 calspec-tutorial.py
python3 spectrum-tutorial.pyReading: STScI CALSPEC, alpha_lyr_stis_011.fits (25 October 2022) · MAST reference atlases and CALSPEC releases
Recover a known motion first
The controlled record has 721 wavelength-calibrated samples and random seed . It contains the artificial two-line slab, a sloping continuum and a known Gaussian instrument response. The injected velocity is and the per-sample random standard deviation is . It is a separate synthetic record, not Vega data.
For trial velocity, Doppler width and central optical depth, compute the normalized profile. Solve the two linear continuum coefficients, then evaluate the standardized residual sum. A coordinate search progressively reduces its step sizes. The saved result recovers approximately , Doppler parameter and reference optical depth .
Noise and parameter correlations prevent exact recovery of every injected number. Reduced chi-square is about , consistent with this particular generated record. The output preserves sample count, degrees of freedom, continuum coefficients and residual scale so the comparison can be checked.
Make two deliberate mistakes
First add to every synthetic wavelength. The fitted velocity becomes about with almost unchanged goodness of fit. The velocity absorbs a common wavelength error. The prescribed zero-point uncertainty of corresponds to about at this wavelength.
Next omit instrumental spreading. The fitted Doppler parameter increases to about , optical depth falls to about and reduced chi-square rises to about . The gas model broadens and shallows to compensate for the missing instrument. Compare these failures: one retains an attractive residual, the other produces visible model mismatch.
Measure the observed hydrogen feature
The observed script uses a chosen approximate vacuum reference near hydrogen Balmer-beta. It first fits a linear continuum plus a Gaussian absorption notch within on either side. This defines an apparent displacement; it does not resolve hydrogen fine structure, pressure shifts or the velocity reference frame.
The frozen fit gives an apparent center near , an apparent Doppler value near and Gaussian full width near . A wider fit window changes the Gaussian width to about . The profile measurement depends on which part of the real wings the model attempts to explain.
Force the broad-window continuum flat and the apparent velocity becomes about . A winged Lorentz profile improves the residual but still leaves structure much larger than the statistical errors. Its enormous weighted sum is useful evidence that this empirical line shape is inadequate.
Reading: STScI CALSPEC, alpha_lyr_stis_011.fits (25 October 2022)
Write the uncertainty that the data actually support
The observed fit uses STATERROR for weights and retains SYSERROR separately. A calibration systematic can correlate wavelengths. Treating it as an independent Gaussian draw at every pixel would invent an error model absent from the file. Neither error column removes continuum or profile ambiguity.
Report the apparent center, empirical width and sensitivity to window, continuum and profile. These exercise values are not a precision systemic velocity of Vega. They do not infer temperature or elemental abundance. The STIS handbook ties wavelength accuracy to the dispersion solution, zero point and centering in the slit; a precision analysis must use the appropriate calibration for its mode and exposures.
For another star, record the release, observational provenance, wavelength medium and reference frame, selected rows, continuum, response and residual structure before interpreting physical parameters. Keep the failed fits with the successful one. A future fit with a convincing residual and wrong motion then has a concrete comparison.
Reading: STIS Data Handbook, section 4.3, Factors Limiting Flux and Wavelength Accuracy · MAST reference atlases and CALSPEC releases