🎨 Registration, Outlier Rejection, and Stacking

Pre-processing and Stacking · lesson 5 of 12 · 3 min

Once calibrated and debayered, your frames must be precisely superimposed, cleared of their transient defects, then combined. These three steps produce the master image you will work on next.

Registration (alignment)

From one frame to the next, the field moves a little: tracking errors, intentional dithering, field rotation with an alt-azimuth mount, reframing on another night. Registration detects the stars in each frame, matches them with those of a reference frame, and calculates the transformation (shift, rotation, sometimes slight distortion) that superimposes them.

Choose as reference a sharp frame, with round stars and a low background. Siril can choose it automatically based on star quality.

This is also the time to sort: blurry frames (wind, cloud, focus that drifted) or frames with elongated stars degrade the result. For each frame, Siril displays star sharpness (FWHM) and roundness: discarding the worst 5 to 10% is often more useful than keeping everything.

Outlier rejection

Some frames contain defects that appear only once: a satellite or airplane trail, a cosmic ray, a leftover hot pixel. For a given pixel, the software examines the stack of values it takes across all the aligned frames.

Sigma clipping calculates the mean and standard deviation of this stack, then rejects values that are too far off (beyond a certain number of standard deviations, often around 3). A satellite trail, very bright on a single frame, stands far outside the stack and disappears. Variants ("winsorized" sigma clipping, percentile rejection, etc.) adapt to the number of frames: statistical methods need a fairly large stack, at least ten or so frames and ideally more.

Dithering makes this rejection much more effective: a hot pixel lands on a different spot of the sky in each frame and gets eliminated as an outlier.

Stacking

What remains is to combine the values that were kept:

  • the average gives the best signal-to-noise ratio. Combined with rejection, it is the recommended method in the vast majority of cases;
  • the median naturally rejects extreme values without any settings, but the resulting image is noticeably noisier than with an average. It remains useful for calibration masters or when you have few frames.

Before combining, the software normalizes the frames: it equalizes their background level and scale, because the sky background varies during the night (Moon, target altitude, light pollution).

Cropping the edges

Since the frames were shifted to be superimposed, the edges of the stacked image contain only some of the exposures: they are noisier, sometimes dark or streaked. Crop them right away, before any other operation: otherwise, gradient removal and color calibration would be skewed by these abnormal areas.

Save the stacked image as a 32-bit FITS: it is your raw material, to be kept carefully so you can redo the processing later.

Key points

  • Registration superimposes the frames using their stars; choose a sharp reference.
  • Discarding blurry frames or frames with elongated stars improves the result.
  • Sigma clipping rejects outliers (satellites, airplanes, cosmic rays); it needs enough frames.
  • Average with rejection gives the best signal-to-noise ratio; the median is noisier.
  • Crop the irregular edges before any other operation and keep the stack as a 32-bit FITS.

🧮 Exercise

On a series containing a satellite trail, stack once as an average without rejection, and once as an average with sigma clipping. Compare: the trail should disappear in the second version.