Module 5: Doing real research · Lesson 5.4 · about 25 min
From raw spectrum to science: a spectroscopy pipeline
A spectrum on the detector is just a smear of counts. Calibrate it, trace and extract it, put a wavelength scale on it with a lamp, correct for the instrument's response, and only then measure lines and velocities.
Module 5 · about 25 minutes · read first: 1.3 Spectral lines: fingerprints of atoms, 1.4 The Doppler shift, Sky watching 6.3 Calibration frames: darks, flats and bias · maths: straight-line fits. You’ll be able to list the steps that turn a raw spectrum into a calibrated one, put a wavelength scale on it, and see how calibration errors become velocity errors.
1. Why this matters
Spectra give compositions, temperatures and velocities (Module 1), but only after careful reduction. Small, affordable spectrographs now let amateurs measure star types, Doppler shifts of bright binaries and even nova spectra, and archives hold millions of already-reduced spectra. Knowing the pipeline tells you what can go wrong.
2. The steps
- Calibrate the image: bias, dark, flat, as for any image (Sky watching 6.3).
- Trace: find where the star’s spectrum runs across the detector (a curved line, usually).
- Extract: add up the counts across the trace at each position, subtracting the sky beside it.
- Wavelength calibrate: take a lamp spectrum through the same setup; match its lines to their lab wavelengths; fit pixel → wavelength.
- Response correction: divide by the shape seen in a standard star to remove the instrument’s colour bias.
- Measure: identify lines, fit their centres, convert shifts to velocities.
Things to notice:
- Both the starting wavelength and the scale (nm per pixel) must be right; one alone leaves misses at the ends.
- The velocity only means something once the lamp lines sit on their ticks.
Turn a raw spectrum image into a velocity:
Maths and principle
Dispersion solution (simplest form, a straight line from pixel to wavelength):
Real pipelines fit a polynomial of order 3 to 5 to many lamp lines by least squares (Lesson 5.7).
Resolution: a spectrograph’s resolving power is . With at 656 nm, nm, and velocities can be measured to a small fraction of km/s.
Velocity error from a wavelength error: .
3. What it means physically
The grating in a spectrograph spreads light into its colours like a prism, but each instrument spreads it a little differently, and the setup flexes with temperature. The lamp, taken right before or after the star, is a ruler laid alongside your spectrum, made of atoms whose line positions are known exactly. Everything you later claim, such as a planet’s tug of a few m/s, depends on how well that ruler is held still.
- λ(x) = λ₀ + D x
- Dispersion solution: wavelength at pixel x.
- R = λ / Δλ
- Resolving power: how finely the spectrograph separates wavelengths.
- σv = c σλ / λ
- Velocity uncertainty from a wavelength uncertainty.
- Physical meaning
- The lamp is a ruler laid beside the starlight. Without it, a spectrum is a strip of brightness with no numbers on it; with it, each pixel gets a wavelength, and any shift of a line from its laboratory place becomes a speed.
“A spectrograph shows the true colours of a star.” Raw spectra are tilted by the instrument and the atmosphere: some wavelengths are recorded more efficiently than others. Only after dividing by the response does the shape mean anything physical.
4. Worked example
Two neon lines, 585.25 nm and 640.22 nm, fall on pixels 172 and 744. What is the dispersion solution, and what wavelength is pixel 760?
5. Practice
More practice (answers below):
- With nm/px, how many pixels does a 30 km/s shift of H-alpha move?
- Why is the lamp taken through the same slit and grating as the star?
- What is the resolving power of a spectrograph that just separates lines 0.5 nm apart at 500 nm?
Answers
- nm, so 0.66 pixels. Line centres are fitted to small fractions of a pixel.
- So the light follows the identical path and lands where the star’s light of the same wavelength would.
- .
- Steps: calibrate, trace, extract, wavelength-calibrate, flux-calibrate, measure.
- Arc lamps with known lines give the pixel-to-wavelength fit.
- Resolving power R = λ/Δλ sets what can be measured.
- Line centres give radial velocities: σv = c σλ/λ.
Try it with real numbers: identify lines with the spectral line identifier, and turn shifts into speeds with the redshift calculator.
New words: spectral reduction, trace, extraction, wavelength calibration, arc lamp, dispersion, resolving power.
Check yourself
Sources
- Neon line wavelengths in air: NIST Atomic Spectra Database (lab values, used in the figure)
Your ticks stay in this browser. Save them as a file on the course home.
Updated 2026-11-22. Numbers in the examples are made up to show the idea unless a source is given. Simulations run in your browser on made-up data; nothing you type is sent anywhere. Astronomy only: nothing here is astrology.