Combining: one value from many
Once aligned, every pixel position has one value from each frame. Most of those values are good. A few are not: a satellite crossed, a cosmic ray hit, a plane's light passed through. Combining is deciding which values to trust and how to average them.
- Mean versus median
the trade The mean of good data has the lowest noise, but one satellite trail drags it up. The median ignores the trail but is about 25% noisier on clean data. Rejection gets the best of both: find the outliers, drop them, average the rest.
- Sigma clipping
--stack-method sigma_clip15+ frames For each pixel, take the median of the frames' values and their spread (from the MAD), reject any value more than 3 spreads away, and repeat up to three times. Then average what remains, weighted by each frame's quality. With fewer than 15 frames a sigma estimate is unreliable, so the default switches to a percentile clip, which simply drops the highest and lowest values.
Also available: winsorized clipping, a generalised extreme-studentized-deviate test (ESD), linear-fit clipping, inverse-variance weighting and a wavelet-domain combine. See the advanced page.
- Weights from quality, region by region
patch weighting A frame that is sharp in one corner and soft in another, because of a gust of wind or a tilt, is scored in patches, and counts for more where it is sharp.
- Common crop
no black borders A rotated and shifted frame no longer fills the whole grid. The area every frame covers is stacked as normal. The stack then extends to the largest rectangle that at least half the frames cover, each outer pixel combined from the frames that cover it, so dithering, drift and field rotation cost less of the field; the edges are a little noisier.
--no-full-fieldkeeps only the area every frame covers.
Proper coaddition: weighting by detail
A weighted average gives each frame one weight for everything in it. But a soft frame and a sharp frame are equally good at recording the smooth glow of a nebula, and very different at recording a small star. Proper image coaddition (Zackay and Ofek, 2017) gives each frame a separate weight for every scale of detail.
- The idea
on by default--no-proper-coadd Any image can be split into spatial frequencies, from the broad background to the finest detail, with a Fourier transform. Blur weakens the high frequencies; how much is described by the frame's point-spread function (PSF), the shape a point of light takes in that frame (more on the PSF). Proper coaddition weights each frame at each frequency by how much of that frequency its PSF passed, divided by its noise. Sharp frames dominate the fine detail; every frame still contributes to the smooth parts.
R̂ = Σj (Fj / σj2) P̂j* M̂j / √( Σj (Fj2 / σj2) |P̂j|2 )
M is each frame, P its PSF, F its transparency, σ its background noise; the hat means the Fourier transform. The result is mathematically guaranteed to be at least as sharp as a weighted mean of the same frames, and keeps total flux unchanged.
- Measured, not assumed
per-frame PSF Each frame's PSF is measured by fitting an elliptical Moffat profile (a star shape with realistic wide wings) jointly to about 30 bright, isolated, unsaturated stars. Its transparency comes from those stars' brightness in a fixed aperture, and its noise from the sky. Outliers such as satellite trails are removed first against the normal stack.
On three real sessions: stars 1.3 to 2.7% narrower than the plain stack, with equal or lower noise.
Further reading
- Zackay, B. & Ofek, E. O. (2017). How to COAAD images. II. A coaddition image that is optimal for any purpose in the background-dominated noise limit. The Astrophysical Journal 836, 188.
