Spectroscopy: reading the barcode in light
Split light into its colours and it stops being just "light". It becomes a measurement. The dark and bright lines in a spectrum tell you what something is made of, how hot it is, how fast it moves and how long ago the light set off.
Each chapter below is a small lab with real physics behind the sliders. They run from a candle flame and an old sodium street lamp to a single unexplained line found by JWST in 2023.
Where light comes from
Anything warm glows, and the hotter it is the bluer the glow. This thermal light is a smooth rainbow whose peak slides with temperature (Wien's law, λpeak = 2898 µm·K / T). A candle peaks in the infrared and only its blue-starved tail is visible, so it looks orange. The Sun peaks in the green and looks white.
A thin glowing gas is different: it only emits at a few exact colours. That is why street lamps make such a good spectroscopy lesson. Low-pressure sodium lamps, the orange lights of many roads from the 1930s until the 2000s and 2010s, put almost all their light into two lines near 589 nm. That made them the most efficient lamps of the 20th century, and also useless for telling a red car from a blue one. Astronomers loved them: one narrow filter removed their glow from the night sky. Turn up the pressure and the lines smear into a broad peach band with a dark notch in the middle, where cooler sodium at the edge of the arc tube absorbs its own light. Modern white LEDs are a blue chip plus a yellow phosphor, and they spill light across the whole spectrum, which no single filter can remove.
- Slide the sodium pressure from 0 to 1 and watch the doublet turn into a broad band with the self-reversed dip.
- Switch on the sky filter. It removes nearly all low-pressure sodium light, very little high-pressure sodium and almost none of an LED.
- Compare how the fruit looks under each lamp. Under low-pressure sodium every object becomes a shade of the same orange.
Inside the orange street lamp
If you grew up under low-pressure sodium lights you probably remember three things: the eerie orange world, the faint buzz, and the dim pink glow when a lamp first came on. Each has a physical cause.
Why only one colour
Sodium has a single outer electron, and its easiest jump is from the ground state (3s) to the next level up (3p). Falling back releases a 589 nm photon. The electron's spin interacting with its orbit splits that level in two, giving the famous doublet at 589.0 and 589.6 nm. In a low-pressure lamp almost every collision ends in that one jump.
Why everything turned grey
With a single wavelength your eye has nothing to compare. A red car and a blue car only differ in how much 589 nm light they reflect, so they become lighter or darker shades of the same orange. Your brain normally adjusts to the colour of the light, but here there is nothing to adjust, and the street looks like an old monochrome photo. Faces looked bloodless because skin's redness was simply not in the light. Compare the fruit row above.
Why they were everywhere
By luck, 589 nm sits near the peak of human vision: the eye is about 76 % as sensitive there as at its best colour, near 555 nm. The bench above computes about 480 lumens per watt of emitted light (some of it is infrared). The best real lamps reached about 200 lm/W (a little less once the ballast is counted), the most efficient lamps until LEDs. For half a century that made them the cheapest way to light a road.
The pink start
Sodium is a solid metal at room temperature, so the tube also holds neon with a trace of argon to strike the arc. That is the dim pink-red glow at switch-on. Over about ten minutes the discharge heats the tube to around 260 °C, the sodium evaporates and takes over, and the colour turns to sodium orange.
The buzz
Old lamps ran on a magnetic ballast, a heavy coil in the lamp head that limits the current. Its iron sheets change length slightly with every half-cycle of the current (magnetostriction), so they hummed at twice the mains frequency: 100 Hz in Europe, 120 Hz in North America. The light flickered at that rate too: too fast to see directly, but it could make spinning wheels and waving hands look jerky.
Engineering tricks
Hot sodium attacks ordinary glass, so the U-shaped tube is lined with sodium-resistant glass, and its small dimples give liquid sodium cool spots to collect in. The outer jacket carries a thin coating that reflects infrared back onto the tube, like a thermos, so the lamp stays hot on little power.
High pressure: broad, with a notch
The peachy high-pressure sodium lamps that followed run far hotter, in a tube of translucent alumina ceramic because no glass survives. The atoms collide so often that the doublet smears into a broad band. Cooler sodium near the tube wall then absorbs the very centre, leaving a dark notch at 589 nm (slide the pressure to 1 above). Colours improve, efficiency drops, and the astronomers' simple filter stops working.
Sodium in the sky
About 90 km up there is a thin natural layer of sodium atoms, left behind by burning meteors. Large telescopes shine 589 nm lasers into it to make an artificial "guide star", measure how the air blurs it, and bend a flexible mirror to undo the blur. The colour of old street lights now helps take some of the sharpest images made from the ground.
Splitting light: prism or grating
Isaac Newton spread sunlight with a glass prism in 1666 and coined the word spectrum. A prism works because glass slows blue light a little more than red (its refractive index depends on wavelength), so each colour bends by a different amount. The spread is uneven: blue is fanned out widely and red is squeezed together.
In 1821 Fraunhofer built the first precise diffraction grating: 260 fine parallel wires, soon followed by glass plates ruled with a diamond. Each groove re-radiates the light, and the waves add up only in directions where d·sin θ = m·λ. The result is an almost linear spectrum, repeated in several orders m. More grooves under the beam give sharper lines: the resolving power is R = λ/Δλ = m·N. Higher orders spread the colours further but start to overlap: second-order violet lands on top of first-order red.
- Pick the sodium lamp and find the grating settings where the two D lines (0.6 nm apart) split.
- Open the slit wide: the lines get brighter but blur. Real spectrographs trade light against sharpness.
- Switch to a prism and try diamond: its huge dispersion is the "fire" of a cut diamond.
Fingerprints of the elements
In 1859 Gustav Kirchhoff and Robert Bunsen held salts in Bunsen's new, nearly invisible gas flame and looked through a prism. Every element painted its own pattern of bright lines, the same every time. Sodium was always the yellow pair, lithium a crimson line, potassium a deep red one. Within two years they had found two elements nobody knew existed: caesium, named for its sky-blue lines, and rubidium for its dark red ones.
Kirchhoff then shone strong sunlight through a sodium flame and saw the yellow lines turn darker than the background. The dark D lines in sunlight were sodium, absorbing. His three rules come out of one equation: a cloud of gas in front of a light source adds its own glow and dims what comes from behind, at exactly the colours it can absorb.
- A hot dense body gives a continuous spectrum (no gas, or a lamp behind thin gas).
- Hot thin gas on a dark background gives bright lines.
- Cooler gas in front of a hotter source gives dark lines at the same places. Make the gas exactly as hot as the lamp and the lines vanish completely.
Reference barcodes
The hydrogen ladder
In 1885 a Swiss school teacher, Johann Balmer, found a formula that fitted the four visible hydrogen lines to about one part in 40 000. Nobody knew why it worked. In 1913 Niels Bohr explained it: the electron can only sit on certain rungs with energy En = −13.6 eV / n², and a jump between rungs releases one photon whose energy is the difference. Jumps that end on rung 2 give the visible Balmer series, jumps to rung 1 the ultraviolet Lyman series, and jumps to rungs 3 and 4 the infrared Paschen and Brackett series. Spectral lines were among the first hard evidence for quantum mechanics.
- Click any arrow (or two rungs) to emit that photon. Lyman α at 121.6 nm is the line in this page's mystery chapter.
- Toggle the energy axis between linear and log. The real ladder crowds toward the top, where the electron leaves the atom.
Why hot stars show the strongest hydrogen lines
In the 1910s Annie Jump Cannon sorted hundreds of thousands of stellar spectra into the classes O B A F G K M, and A stars like Sirius have by far the deepest Balmer lines. That looked like "A stars have the most hydrogen". In 1925 Cecilia Payne showed the opposite. Balmer absorption needs atoms sitting on rung 2. Cool stars have almost none there, and in the hottest stars the hydrogen is ionised. Only near 10 000 K is the balance just right. Correcting for this, she found stars are made mostly of hydrogen and helium, a result so surprising that she was talked into calling it "almost certainly not real". It was real.
Doppler shifts and the stretched universe
A source moving away from you has its lines shifted to longer wavelengths, and one moving toward you to shorter. In 1912 Vesto Slipher found the Andromeda galaxy approaching at about 300 km/s. Over the next decade nearly every other galaxy he measured turned out to be receding. Edwin Hubble (1929) tied the shift to distance, and today we read it as space itself stretching while the light is in flight. Astronomers write the stretch as redshift z: every wavelength arrives (1 + z) times longer.
That is why the James Webb Space Telescope works in the infrared. The ultraviolet and visible light of the first galaxies arrives stretched by a factor of 10 or more.
- Drag z and watch the galaxy's lines march out of the visible and through JWST's window.
- Above z ≈ 6 everything bluer than Lyman α is erased by intergalactic hydrogen: the Lyman break that betrays the most distant galaxies in images.
- The four "mystery?" presets put each candidate line of Chapter 7 at 1.60 µm.
What the instrument actually sees
A real spectrum is never the perfect one. The spectrograph blurs every line to a width λ/R. The detector chops the spectrum into pixels, and light arrives as countable photons with random (Poisson) noise, plus readout noise and the glow of the sky. Whether two lines can be told apart, and how well a ratio can be measured, depends on all of this together.
Two doublets on this bench carry real physics. The [O II] pair at 3726 and 3729 Å changes its brightness ratio with gas density, so resolving it gives a density meter for galaxies billions of light years away. Hα and Dα are 0.18 nm apart because deuterium is twice as heavy as hydrogen; the same small shift in the Balmer lines is how Harold Urey discovered deuterium in 1931.
- Lower R until the sodium doublet blends into one line.
- Under-sample (fewer than 2 pixels per resolution element) and see the line shapes become unreliable.
- Change the [O II] gas density and see how long an exposure you need to measure it.
A single mystery line
Usually a spectrum shows several lines, and their spacing gives the redshift right away. But sometimes there is only one. One emission line is a wavelength with no label. Is it hydrogen Hα from a galaxy 9 billion light years away, Lyman α from one of the first galaxies, or something closer and stranger?
In 2023 JWST pointed its NIRSpec spectrograph at the Hubble Ultra Deep Field in a new way. It opened almost all of its quarter of a million micro-shutters and closed only those over known foreground galaxies, which made a wide slitless survey. Huberty et al. (ApJ 1009, 117, 2026) found one line at 1.6004 µm with no galaxy behind it, even in some of the deepest images ever taken. This lab lets you follow their reasoning, or test yourself on random galaxies.
How you work it out
- Is it real? They saw it in four dither positions and two telescope orientations. A cosmic-ray hit or detector glitch does not move with the sky.
- Where is it? In slitless spectroscopy a pixel's wavelength depends on where the source sits. Two orientations about 90° apart pin down both the position and the wavelength (see the small figure below the lab).
- Guess an identity and predict. Each guess fixes z, and that tells you exactly where its partner lines must appear and how bright some of them must be. Some ratios are fixed by atomic physics ([O III] 5007/4959 = 2.98). Some are fixed by recombination (Hα/Hβ ≈ 2.86 before dust). Some only "usually" hold.
- Check the brightness budget. No galaxy shows up in deep imaging, so almost all the light is in the line. Its equivalent width (EW) is enormous, and each identity has a known ceiling.
Where is it? Two orientations
With no slit, a source's light is spread sideways along the dispersion direction, so a line at detector position x could come from any spot along a track on the sky, each with a different wavelength. Rotating the telescope by about 90° gives a second track. Only where the tracks cross do both orientations agree on the wavelength. Huberty et al. required agreement within 6 Å. Slide the candidate along the first track.
What the paper concluded
Each everyday identity fails somewhere. As [O III] 5007 its fixed partner at 4959 Å should have been seen at about 3σ. As Hα it needs Hβ (about 3σ, unless dust hides it) and an EW right at the theoretical ceiling for a newborn starburst. As [O II] the EW is far beyond anything known. As Lyman α at z = 12.2 it needs a nearly neutral universe to let the line through, and an EW above 580 Å. A flaring star would show its neighbouring Brackett lines, and a supernova shining in Paβ should show Paγ. The authors suggest it might be transient, perhaps a tidal disruption event or an unusual supernova, which switched on after the 2022 imaging. That removes the EW problem. Tick "transient" above to see how the verdicts loosen. The honest answer, for now, is we don't know. Follow-up spectroscopy should settle it.
Who invented it, and how it got better
No single person invented spectroscopy. It grew from a prism experiment into the main way we learn what the universe is made of. Some milestones (the "lab" links jump to the matching experiment):
- 1666Isaac Newton splits sunlight with a prism and recombines it, showing that white light is a mixture. He names it the spectrum (first in print in 1672; Opticks followed in 1704). lab →
- 1752Thomas Melvill sees that a flame with table salt in it glows a very particular yellow: the sodium D lines, a century before anyone knew why. lab →
- 1800–01William Herschel finds a thermometer heats up beyond the red end of a spectrum (infrared). Johann Ritter finds invisible rays beyond the violet that darken silver chloride (ultraviolet).
- 1802William Wollaston sees a few dark gaps in sunlight through a slit and a prism, and takes them for boundaries between colours.
- 1814Joseph von Fraunhofer, an optician making better glass, maps 574 dark lines in sunlight and letters the strongest A to K. In 1821 he builds the first diffraction gratings good enough to measure the wavelengths of the lines (David Rittenhouse had strung a simple hair grating in 1785). see the hero strip →
- 1835Auguste Comte declares that we will never know the chemical composition of the stars.
- 1859–61Gustav Kirchhoff & Robert Bunsen show each element has its own lines, identify sodium, iron and others in the Sun, and discover caesium (1860) and rubidium (1861). Comte is proved wrong within a quarter-century. lab →
- 1864William Huggins points a spectroscope at the Cat's Eye nebula and sees bright lines. Some nebulae are glowing gas, not unresolved stars.
- 1868Jules Janssen & Norman Lockyer see an unknown yellow line (587.6 nm) in the Sun's edge. Lockyer names the element helium after the Sun. It is found on Earth in 1895.
- 1885–88Johann Balmer finds the formula for the visible hydrogen lines. Johannes Rydberg generalises it. lab →
- 1890s–1920sThe Harvard computers: Williamina Fleming, Antonia Maury and Annie Jump Cannon build the Henry Draper Catalogue (225 000 stars, 1918–24). Cannon's O B A F G K M sequence becomes the standard, and over her career she alone classifies about 350 000 stars.
- 1900–13Max Planck explains the blackbody curve with energy quanta (1900). Niels Bohr explains hydrogen's lines with quantised orbits (1913). lab →
- 1912–29Vesto Slipher measures the first galaxy velocities. Edwin Hubble links redshift to distance (Georges Lemaître had argued for it in 1927). lab →
- 1925Cecilia Payne shows that stars are mostly hydrogen and helium. lab →
- 1928C. V. Raman finds that a little scattered light comes back shifted by molecular vibrations (Nobel Prize 1930).
- 1931Harold Urey discovers deuterium from a faint companion to the Balmer lines. lab →
- 1930sLow-pressure sodium street lamps appear, first in the Netherlands. The first lit a road near Geleen in 1932. High-pressure sodium in ceramic tubes follows in 1965, and LEDs replace both from the 2010s; the last low-pressure lamps were made in 2019. lab →
- 1946Felix Bloch & Edward Purcell detect nuclear magnetic resonance in ordinary liquids and solids (Isidor Rabi had first seen it in molecular beams in 1938), turning it into spectroscopy of atomic nuclei in a magnet. It later becomes MRI.
- 1960sThe laser (1960) and the computer-driven Fourier-transform spectrometer transform laboratory spectroscopy.
- 1963Maarten Schmidt recognises the odd lines of the "star" 3C 273 as hydrogen redshifted by z = 0.158: the first quasar to be understood. lab →
- 1970s–80sCCD detectors replace photographic plates, counting most photons instead of a few percent.
- 1995Michel Mayor & Didier Queloz find the first planet around a Sun-like star (51 Pegasi b) from a wobble of about 60 m/s in its lines (Nobel Prize 2019).
- 2005John Hall & Theodor Hänsch: Nobel Prize for the optical frequency comb, a laser "ruler" of evenly spaced colours.
- 2022–26JWST takes infrared spectra of galaxies seen 13+ billion years ago and of exoplanet atmospheres (CO₂ in WASP-39b, 2022). Its micro-shutter spectrograph is used for the slitless search behind Chapter 7. lab →
Is it still state of the art?
Yes. If anything, spectroscopy has never been more central. Images tell you where things are and roughly how bright. Spectra tell you composition, temperature, density, motion and distance, so almost every big new telescope is built around a spectrograph. What keeps improving is the how:
Many objects at once
Fibre-fed spectrographs such as DESI on Kitt Peak take 5000 spectra per pointing to map tens of millions of galaxies. Integral-field units such as MUSE take a spectrum at every pixel of an image.
Extreme precision
HARPS-class spectrographs measure stellar wobbles near 1 m/s and ESPRESSO aims for 10 cm/s, calibrated with frequency combs. The Earth tugs the Sun by only about 9 cm/s.
Clocks
The best clocks are spectroscopy: lasers locked to one narrow atomic transition (strontium, ytterbium) keep time to about a second in the age of the universe.
Is there something better?
For some questions, yes, or rather complementary. Photometric redshifts (colours from images) are far cheaper for huge samples, but less precise. Gravitational waves and neutrinos carry information light cannot. Mass spectrometry, a cousin that sorts by mass instead of colour, beats optical methods for many chemistry jobs.
Where it branched out
The idea of "measure how something responds, colour by colour" spread far beyond astronomy:
Medicine
Your pulse oximeter is a two-colour spectrometer: oxygenated blood absorbs red and infrared light differently. MRI grew out of NMR spectroscopy, and police breath-alcohol instruments use infrared absorption.
Chemistry & industry
Infrared and Raman spectra are fingerprints of molecules, used to check medicines, sort plastics for recycling, grade food and catch art forgeries by their pigments.
Earth from space
Hyperspectral satellites map minerals, crop health and algae. Dedicated instruments spot methane and CO₂ plumes from individual facilities.
Other worlds
Mars rovers zap rocks with a laser and read the flash (ChemCam, SuperCam). JWST reads exoplanet atmospheres in starlight filtered through them during transits.
Physics itself
Quantum mechanics was built to explain spectral lines. The Lamb shift in hydrogen spurred modern quantum electrodynamics, and today spectroscopy tests whether the constants of nature drift.
Cosmology
Redshift surveys measure the expansion history of the universe and dark energy. The cosmic microwave background's blackbody spectrum is the most perfect one ever measured.
What is computed and what is simplified
- Computed exactly: Planck curves, Wien's law, hydrogen wavelengths (Rydberg), the grating equation, prism refraction with Sellmeier glass data, the vacuum-to-air conversion (Morton 2000), flat ΛCDM ages and distances (Planck 2018 parameters), Saha–Boltzmann populations, the [O II] density relation (Sanders et al. 2016) and colours via the CIE 1931 observer (multi-lobe fit). The built-in tests check these against known values.
- Approximate: line lists keep only the strongest lines with rough relative intensities (real ratios change with temperature and lamp). Lamp spectra (sodium pressure, LEDs, fluorescent phosphors) are hand-built models with the right shapes, not measured spectra. The gas cell uses a single Gaussian line width and ignores excitation changes. Colour rendering uses partial chromatic adaptation. The grating's order brightnesses are illustrative.
- The mystery line: the spectrum is regenerated from the paper's published numbers (1.6004 µm, 2.5×10⁻¹⁸ erg s⁻¹ cm⁻², FWHM 13.2 Å, noise tuned to its ~9×10⁻¹⁹ 3σ limits, imaging EW limit 7620 Å). It is not the real data. Expected companion ratios and EW ceilings are rounded literature values. The detective reasons from the paper's own measurements (Table 2). Partner wavelengths are scaled from the exact redshift; the paper quotes some from rounded redshifts (z = 1.44, 2.20), so a few differ by ~10 Å (for example [O III] 4959 at 1.5851 µm here, 15 864 Å in the paper). The verdicts are a teaching aid, not a re-analysis. The random galaxies use typical line ratios, a Calzetti dust law and a rough IGM transmission.
- History and facts: dates, names and numbers in the prose, timeline and "Today" cards were checked against encyclopaedias, original papers and manufacturer data in November 2026. Rounded figures (lamp efficacy, wobble sizes, clock precision) are given as "about".
- Galaxy at redshift z: a schematic young-galaxy spectrum displayed at low resolution so the lines are visible on a log axis. Its "velocity" readout is the special-relativistic Doppler equivalent. Cosmological redshift is not really a velocity.