↑ Stacking divides the noise by the square root of N — The star field is synthetic, so the truth is known and the noise can be measured as the residual itself. One frame has a residual RMS of 16.507 e- (against 16.248 predicted from 200 e- of sky plus 8 e- of read noise), and stacking up to 64 frames tracks sqrt(N) to within 1.1 %. The last two panels paint the residual itself on the same scale: what filled the frame at N = 1 is gone at N = 64, with nothing left at the star positions. Ops used: synth_frame_series, sigma_clip_stack, noise_sigma.
↑ Lucky imaging — sorting the frames by quality — The better the atmosphere, the more of the same total flux lands in fewer pixels, so the selection criterion is peak fraction times roundness — a number that does not move when exposure or gain change. These are the best 8 of 16 frames by score; score and FWHM correlate at -0.964 across FWHM 3.29 to 6.21 px. Blue is kept, grey is dropped. Ops used: synth_frame_series, frame_quality, lucky_select.

↑ How much to keep — sharpness bought with noise — Going from all 16 frames down to the best 12 % (2 frames) improves the stacked FWHM from 4.319 to 3.294 px, a 23.7 % gain — and, with 8x fewer frames, costs a background noise sigma rising from 3.517 to 8.675 e-, 2.47 times worse against the sqrt(16/2) = 2.83 the counting predicts. Lucky imaging is a trade, not an improvement, and both sides belong in the same figure. Note the noise is *not measured as the residual against the truth: this experiment deliberately varies the per-frame FWHM, so a residual would also contain the change in the PSF and could not tell noise from a different image. Ops used: lucky_select, sigma_clip_stack, frame_quality.*
↑ How a cosmic ray disappears — by sharpness, or by counting frames — A cosmic ray never went through the optics, so it is sharper than a star. Comparing a 2x-subsampled Laplacian against the fine-structure image finds 39 pixels against the 44 planted — precision 0.949, recall 0.841 — and the point is that it flags no star core at all. Because the data is synthetic we can also make the same exposure *without the cosmic rays and measure the departure from the truth directly: pixels more than 100 e- off drop from 44 to 9, and 84 % of the total departure is removed. Note what must not be quoted here — the frame maximum, which goes 7000 to 7000 e- and barely moves, because it belongs to the brightest star and because one missed pixel pins it as long as recall is below 1. With several frames it is easier still: plainly averaging 8 frames only dilutes each hit to 1/8 and still lands 1750 e- from the truth, while a kappa-sigma combine reaches 45 e- with no detection or replacement at all, and rejecting frame-to-frame first reaches 7 e-. Ops used: synth_starfield, cosmic_ray_reject, cosmic_ray_reject_stack, sigma_clip_stack, star_detect.*
↑ Drizzle conserves area — Each input pixel is shrunk into a *drop and spread over the output grid in proportion to overlap area, so while the drops stay inside the grid the total cannot change. Across all 12 combinations of pixfrac 1.0 / 0.7 / 0.4 and magnification x1 to x4 the relative error peaks at 6.3e-15 — that is double-precision rounding, not “approximately conserved”. The mean of the weight map matches pixfrac squared exactly, which is the same statement seen from the coverage side. The input total is 306035.5635 e-. Ops used: synth_frame_series, drizzle_resample.*

↑ Drizzle — the image stands up as the drop shrinks — A star field with a true FWHM of 1.15 pixels — below Nyquist — shot 24 times with a 1.5-pixel dither. One frame measures 1.357 px, and plainly averaging them makes it worse, 1.991 px, because the dither gets averaged too. Handing drizzle the same dither brings it to 1.574 / 1.450 / 1.399 input pixels at pixfrac 1.0 / 0.6 / 0.3, while the total flux does not move apart from the 0.76 % that left through the border. Smaller drops mean sharper images and emptier output pixels (the minimum weight falls to 0.041) — that tug-of-war is drizzle’s only knob. Ops used: synth_frame_series, drizzle_resample, sigma_clip_stack, frame_quality.
↑ A double star 1.6 pixels apart — Two stars of sigma 0.55 px, 1.6 px apart, shot 24 times with dither. A mean stack yields 1 star, while the same raw frames through drizzle x3 (pixfrac 0.4) separate into 2. Nothing was added: the information was already in the dither, and drizzle simply does not throw it away. “Separated” is measured rather than asserted — the dip between the two peaks along the central row is 0.0 % for the mean stack (no dip at all) against 5.9 % for drizzle. The fourth panel is the same drizzle without dividing by the weight map, and detecting on it turns the coverage lattice into 200 spurious stars — the flux-conserving image and the image you look at are different quantities. Ops used: drizzle_resample, sigma_clip_stack, star_detect.

↑ Where sigma clipping breaks — exactly at 50 % — The first k of 20 frames get +900 e- of contamination, and k sweeps from 0 to 60 %. Up to 45 % the error is -0.080 e- — the same answer as with no contamination at all (-0.034 e-). Then at exactly 50 % it jumps to +450.0 e-, precisely half the contamination, and at 55 % to +900.0 e-, all of it. This is not an implementation fault but the breakdown point of the median: once the contaminated frames are the majority the median sits among them and the clipping throws away the *good frames — it is still rejecting 47.4 % of the pixels, it has simply swapped which half. The plot in the last frame is the proof: the plain median folds at the same 50 % (+883.6 e- at 55 %), while the plain mean drifts in proportion to the contamination from the very start (+495.0 e-). A limit that cannot be fixed is shown as it is. Ops used: synth_frame_series, sigma_clip_stack.*
↑ Registration — every star looks like every other star — Descriptor matching does not work on a star field: every star has the same shape, so Lowe’s ratio test discards nearly all of them. What works is the geometry of the arrangement — every pair of stars votes for a displacement, the mode is the coarse shift, an existing 2-D point-correspondence RANSAC drops the mismatches, and Umeyama fits the rest. Across 9 frames with up to 6.0 px of dither the median shift error is 0.0359 px (median 33 inliers, residual RMS 0.112 px). Averaging without registering gives FWHM 5.310 px; registering first gives 3.077 px. Ops used: star_detect, frame_align, align_frames, sigma_clip_stack, frame_quality.
↑ Measuring a known flux back — The synthetic star’s total flux is 10000 e- because we chose it, and the profile is drawn by exact per-pixel integration of the Gaussian (erf), so the image sums to that too. An aperture of radius 8 sigma measures it back to 0.0000 % at all four scales. Squeezing to 3 sigma leaves a negative bias of -0.968 % to -0.095 %, and that is pixelation rather than a bug: representing an edge pixel by its average times an area fraction always undercounts, because the part inside the circle is the brighter part. The proof is that the bias falls as sigma squared — 10.1 times smaller from sigma 1.0 to 3.0. Ops used: synth_starfield, aperture_photometry.