Light, noise and signal-to-noise
Light arrives as individual photons, at random. Even a perfectly steady star delivers a slightly different number of photons to a pixel in each exposure. That randomness, not any flaw in the camera, sets the basic limit on how faint you can see.
- Shot noise
σ = √N If a pixel collects on average N photons, the count in any one exposure scatters by about √N (a Poisson distribution). Brighter means noisier in absolute terms, but cleaner in relative terms: 100 photons scatter by 10 (10%), 10,000 by 100 (1%).
- The other noise sources
read, dark, sky Read noise is added by the electronics each time the sensor is read out, the same for a short exposure as a long one. Dark current is electrons freed by heat, which build up with exposure time and roughly double with every 6 °C. The sky background, from light pollution, the Moon and the glow of the atmosphere itself, adds its own shot noise everywhere, and under suburban skies it is usually the largest term of all.
- Signal-to-noise ratio
SNR The ratio of the brightness of what you want to the scatter around it. Detail becomes visible at an SNR of a few, and looks smooth at a few tens. Because independent noise adds in quadrature, combining N equal frames multiplies the SNR by √N: four times the frames, twice the SNR.
- Gain and ADU
e−/ADU The camera does not report photons or electrons but analogue-to-digital units (ADU), raw numbers. The gain converts between them. Knowing it is what turns pixel values back into photon counts, and so into honest error bars for photometry.
The Bayer pattern
A camera sensor's pixels only count light; they cannot tell its colour. A colour camera such as the Origin's puts a tiny red, green or blue filter over each pixel, in a repeating 2×2 pattern invented by Bryce Bayer at Kodak in 1976.
- Why two greens
Human vision takes most of its sense of brightness and detail from green light, so Bayer gave green twice the samples. Half the pixels are green and a quarter each are red and blue.
- What it costs
Each pixel records one colour; the other two are estimated from its neighbours (demosaicing). Red and blue are sampled only every other pixel in each direction, so fine colour detail is coarser than the pixel count suggests, and a single hot pixel or cosmic ray can be smeared into a coloured blob if it is not caught first.
- Mono cameras
A monochrome camera has no filter grid: every pixel sees every colour, and colour comes from separate exposures through filters in front of the camera. It is more sensitive and sharper, at the cost of more exposures. The Origin uses a colour sensor so a single exposure gives a colour image.
Seeing, the PSF and FWHM
A star is so far away that it is, for any telescope, a point. Yet on the sensor it is a small round blob. The shape of that blob is the point-spread function (PSF), and every point of light in the image, star or nebula, is spread by it.
- Where the blur comes from
Mostly from the atmosphere: pockets of air at different temperatures bend light slightly differently, so a star's image dances and smears during the exposure. Astronomers call this seeing. The optics (focus, aberrations, the diffraction of the aperture itself), tracking errors and wind add to it.
- Measuring it
FWHM The usual number is the full width at half maximum: how wide the star's profile is at half its peak brightness, in pixels or in arcseconds on the sky. Smaller is sharper. A good night and a poor night can differ by a factor of two.
- Its shape
Gaussian, Moffat A bell curve (Gaussian) describes a star's core well but has almost no wings. Real stars have broader wings from scattered light, which the Moffat profile captures. OriginStack fits Moffat profiles where the shape matters, such as proper coaddition.
Convolution and deconvolution
Spreading every point of the true sky by the PSF is an operation called convolution. The recorded image is the true sky convolved with the PSF, plus noise. Deconvolution tries to run that backwards: given the image and the PSF, estimate the sharper sky.
- Why it is hard
The PSF wipes out the finest detail almost completely, and what little survives is buried in noise. A naive inverse, dividing by the PSF in the frequency domain, divides noise by numbers close to zero and explodes. Every practical method is a compromise between sharpening and amplifying noise.
- Richardson-Lucy
--deconvolve rl An iterative method from 1972–74, derived for photon-counting data. Start from a flat guess; blur the guess with the PSF and compare it with the image; multiply the guess by the ratio, spread back through the PSF; repeat. It keeps the image positive and conserves flux. Stopped early it sharpens gently; run too long it starts fitting the noise, turning grain into speckles.
- Ringing
Around a bright star on a dark sky, deconvolution overshoots and leaves dark and bright rings, the same Gibbs effect as in any sharpening of a hard edge. That is why OriginStack masks stars when it deconvolves, and keeps deconvolution off by default.
- Regularised methods
tvsparse Total-variation and sparse methods add a preference for a plausible answer, piecewise smooth or built from few wavelet components, to hold the noise back. They trade some sharpening for fewer artefacts.
Spatial frequency and the Fourier transform
Any image can be described as a sum of smooth waves of different sizes and directions. Large waves (low frequencies) carry the broad glow of a nebula and the background gradient; small waves (high frequencies) carry star cores, fine filaments and most of the pixel noise. The Fourier transform converts an image into those waves and back.
- Blur in frequency terms
Convolution with the PSF becomes simple multiplication in the frequency domain: each wave is weakened by a fixed factor, the PSF's transfer function. Low frequencies pass almost untouched; high frequencies are cut. That is why blur removes fine detail but leaves the overall brightness unchanged.
- Where OriginStack uses it
To measure shifts between frames (phase correlation), to weight frames by how much of each frequency they kept (proper coaddition), and in difference imaging, which matches two images' blur before subtracting them.
Wavelets
The Fourier transform says which sizes of detail are present, but not where. A wavelet transform says both: it splits the image into layers, one per scale, each still laid out like the image. One layer holds 1–2 pixel detail, the next 2–4 pixels, and so on, with a smooth residual at the bottom. Put the layers back together and you have the original image exactly.
- Why it suits noise reduction
Pixel noise lives almost entirely in the finest layers, spread thinly as many small values. Real structure shows up as a few large values, often across several layers at the same place. Shrinking the small values toward zero and keeping the large ones removes noise while keeping edges, which a plain blur cannot do. OriginStack's denoiser works this way.
- Other uses
Local contrast enhancement boosts selected middle layers; background extraction and star detection use the smooth layers to tell broad glow from compact sources.
Stretching
A linear stack is faithful but looks almost black. The faint outer arms of a galaxy may be a few tenths of a percent of the brightness of its core, and a screen shows only about 256 levels. A stretch is a curve that maps the linear values to display brightness, lifting the faint end hard while compressing the bright end.
- Black and white points
First the range is set: values below the black point show as black, values above the white point as white. Setting the black point just under the sky, measured from the sky's own noise, makes the background dark without clipping faint signal.
- The curves
Arcsinh is linear for faint values and logarithmic for bright ones, a natural fit for astronomical data. The midtones transfer function (the classic "screen transfer" curve) moves one chosen input level to the middle of the display. The generalised hyperbolic stretch (GHS, Cranfield & Symons, 2021), OriginStack's default, is a family of curves with a stretch strength, a symmetry point where the stretch is concentrated, and protection for shadows and highlights, so the faint arms can be lifted without blowing out the core.
- Colour
Stretching red, green and blue separately with the same curve lifts each channel by a different amount, so bright star cores drift toward white. Stretching only the brightness and scaling the three channels together keeps each pixel's colour ratios (Lupton et al., 2004). OriginStack does the first by default and the second with
--stretch-color preserve.- See them side by side
The stretch gallery shows one real stack with every stretch OriginStack offers, and what each is good for.
- One stretch only
Measurements happen before the stretch, on the linear data. And the image is stretched once, as a whole: stretching layers separately and adding them back distorts brightness in ways no later step can undo.
Alt-az mounts and field rotation
An equatorial mount turns about an axis parallel to the Earth's, so it follows the stars with one motion and the field stays upright. An alt-az mount, like the Origin's, moves up-down and left-right instead. It follows a star's position perfectly, but the field slowly rotates around the target during the night.
- How fast
ω = 15.04°/h × cos φ × cos A / cos h The rotation rate depends on your latitude φ and the target's azimuth A and altitude h. It is fastest high in the sky toward the north or south, and slow low in the east or west. Close to the zenith it can reach tens of degrees per hour.
- What it means for stacking
Frames must be aligned with rotation, not just shifts, and the corners that rotate out of view shrink the area every frame shares. Across nights the rotation between sessions is arbitrary. Short exposures keep stars round within each frame. See registration.
Dithering and drizzle
- Dithering
Moving the telescope by a few pixels between exposures, on purpose. After alignment the sky lines up but the sensor's defects (hot pixels, column patterns, a residual from an imperfect dark) land in different places in each frame, so outlier rejection removes them instead of stacking them up into streaks. On an alt-az mount the slow drift and rotation do some of this for free.
- Drizzle
--drizzle-scale 2 When stars are only a pixel or two wide (undersampled), dithered frames sample the sky at different sub-pixel positions. Drizzle, developed for the Hubble Deep Field, drops each frame's pixels onto a finer output grid at their exact positions, recovering some of the resolution lost to the coarse pixels. It needs many well-dithered frames and leaves more noise in each output pixel.
FITS, linear data and coordinates
- FITS
.fits The Flexible Image Transport System, astronomy's standard file format since 1981. It stores the pixel values at full precision alongside a text header of keywords: exposure time, temperature, camera, date, and the stack's own record of what went into it.
- Linear versus stretched
A JPEG is stretched, 8-bit and compressed: good to look at, useless to measure. OriginStack's FITS output is the linear stack in floating point at full precision, ready for photometry, merging with tomorrow's frames, or your own processing in another program.
- World coordinates
WCS A small set of header keywords that maps every pixel to right ascension and declination. With it, software can label objects, look up catalogue stars for colour calibration and photometry, and line up images taken on different nights or with different instruments.
Further reading
- Bayer, B. E. (1976). Color imaging array. US Patent 3,971,065.
- Moffat, A. F. J. (1969). A theoretical investigation of focal stellar images in the photographic emulsion and application to photographic photometry. Astronomy & Astrophysics 3, 455–461.
- Richardson, W. H. (1972). Bayesian-based iterative method of image restoration. Journal of the Optical Society of America 62, 55–59.
- Lucy, L. B. (1974). An iterative technique for the rectification of observed distributions. The Astronomical Journal 79, 745–754.
- Starck, J.-L. & Murtagh, F. (2006). Astronomical Image and Data Analysis, 2nd ed. Springer.
- Lupton, R. et al. (2004). Preparing red-green-blue images from CCD data. PASP 116, 133–137.
- Cranfield, M. & Symons, M. (2021). Generalised Hyperbolic Stretch. ghsastro.co.uk.
- Fruchter, A. S. & Hook, R. N. (2002). Drizzle: a method for the linear reconstruction of undersampled images. PASP 114, 144–152.
- Wells, D. C., Greisen, E. W. & Harten, R. H. (1981). FITS: a flexible image transport system. Astronomy & Astrophysics Supplement 44, 363–370.
