Eighteen Hundred Spectra and Not One Photograph of the Sun
Spectroheliography 🎮 Play: Slit & SweepThe scan finished at 10:41 this morning and left me with 1,847 files, each a narrow grey rectangle crossed by dark vertical lines, not one of which looked remotely like the Sun. This is the part nobody puts on the box: at the end of a good session you have not taken a photograph. You have recorded eighteen hundred spectra, and the photograph is something you compute afterward, one pixel-column at a time.
Here is how that actually works, because the reconstruction is the whole craft and the hardware is almost an afterthought once you understand it.
One frame is a spectrum, not a picture
Sunlight enters through a slit about 7 micrometres wide, hits a collimating lens, bounces off a diffraction grating, and refocuses onto the sensor. What lands there is a short stretch of the solar spectrum: a bright band ruled through with the Sun’s absorption lines. The grating equation sets the geometry — d(sin α + sin β) = mλ — and with a 2400 line/mm grating the groove spacing d is 1/2400 mm, or 416.7 nm. For the calcium K line at 393.4 nm in first order, λ/d works out to 0.944: a steep diffraction angle and, more to the point, enormous dispersion. Neighbouring wavelengths land far apart on the sensor, somewhere around 0.01–0.04 nm per pixel depending on your focal length.
That dispersion is the entire reason to bother. When I was ruling my own grating, twenty grooves bent light but resolved nothing; you need hundreds of illuminated lines before adjacent wavelengths separate at all, and thousands before you can peel the K-line core away from its wings. I stopped ruling and bought the 2400. Some open threads close by admitting defeat.
The clever bit is the second axis. One direction across the frame is dispersion — wavelength. The perpendicular direction runs along the slit, which means every frame already holds a full north–south slice of the solar disk, one pixel wide, at every wavelength at once.
Stacking strips into a disk
As the Sun drifts west, successive frames sample successive slices. To build a monochromatic image, you pull from each frame the single column of pixels sitting on your chosen wavelength, and set those columns down side by side:
import glob
import numpy as np
from astropy.io import fits
frames = sorted(glob.glob("scan_*.fits"))
core_col = 928 # sensor column of the Ca K core
disk = np.empty((len(frames), 1200)) # (scan steps, slit height)
for i, path in enumerate(frames):
spec = fits.getdata(path).astype(np.float32) # rows: sky, cols: wavelength
disk[i] = spec[:, core_col] # one wavelength, whole slit
Change core_col by three pixels and you are no longer looking at the high chromosphere but at the photosphere a few hundred kilometres deeper. One dataset, many altitudes, chosen after the fact.
The line refuses to be a straight column
Run that code verbatim and your Sun comes out as a slanted, faintly warped ellipse. Gratings curve spectral lines into a shallow parabola — the smile — so the K-line core sits a few pixels further along the dispersion axis at the top of the slit than at the middle. Sampling a fixed column slices diagonally through the line and the disk smears. The fix is to follow the curve:
rows = np.arange(1200)
# core wanders ~4 px top-to-bottom; fit a2 and r0 once from a bright frame
col = np.rint(core_col + a2 * (rows - r0)**2).astype(int)
for i, path in enumerate(frames):
spec = fits.getdata(path).astype(np.float32)
disk[i] = spec[rows, col] # track the curved line
Two coefficients, measured once, and the ellipse resolves into something round.
A word on focus, since it cost me the first hour. An ordinary achromatic refractor is corrected for green and yellow; at 393 nm it is badly, visibly soft, and you must rack the focuser well inward past where your eye says it should be. The residual violet blur is the same chromatic misbehaviour I fought when recoating eyepieces — only now it is a feature I have to chase into the ultraviolet rather than one I can ignore.
One artefact survived all of it: a hairline stripe running the length of the scan, a single fleck of dust parked on the slit, printing itself into every one of the 1,847 frames. It is the field-lens dust problem again, promoted to a permanent scar across the chromosphere. I photographed a star ninety-three million miles off and could not keep my own optics clean. The plages are there, though — bright and blotchy around an active region — and they were never visible in white light at all.