FLOAT
EN FR

Block

Stacking

FLOAT 0.2.0 · beta of 15 November 2026

What it does
It adds up the aligned frames of the night into one image, each frame counting by its quality, and leaves out satellite trails, planes and cosmic rays.
What it shows
In Inspect, the stack, its two half-stacks and the weight of every frame, with the frames stacked, the stacked exposure and the share of rejected pixels; in the Report, the stacking figures and the colour offset corrected.
What can be set
The Stacking method and the Drizzle scale, which FLOAT proposes with their reason, and the Rejection threshold (3 σ); the proposed values suit most nights.

The Stacking block combines the registered frames of a session into one image. It offers two methods: a Bayer drizzle, which drops every raw colour pixel at its registered position without debayering or interpolation, and a Classic stack, which debayers and interpolates each frame first. FLOAT measures the frames and proposes the method, the drizzle scale and the drop size, each with the reason for the choice; every value can still be set by hand.

  1. Calibration
  2. Registration
  3. Selection
  4. Stacking
  5. Astrometry
  6. Gradient

1What goes in, what comes out

The block receives the calibrated frames, the registration of each one (a cubic polynomial that maps its sensor pixels onto the reference frame), the size of its stars, and the weight the Selection block gave it.

It writes the stack, two half-stacks made of separate frames, the coverage map of each colour, and for every frame its weight or the reason it was left out. Inspect shows all of them.

2Bayer drizzle

A colour sensor records one colour per pixel: in each cell of 2 × 2 pixels, one red, two green, one blue. Debayering fills in the two missing colours of every pixel by interpolation. The Bayer drizzle skips that step. Each raw sample is dropped onto the output grid where the registration of its frame puts it, as a small square, and only into its own colour. The value of an output pixel is the weighted mean of the drops that touch it.[1]

The method depends on the frames being shifted against each other. Red and blue each hold a quarter of the samples: one frame alone leaves three output pixels in four empty in those colours. The shifts between frames, from dithering or from the drift of the mount, are what fills the grid.

The red and blue images of the stars are registered on the green one for the whole night, against lateral chromatic aberration and atmospheric dispersion. The offset of each colour is a quadratic surface over the field, fitted on the isolated, unsaturated stars of the first mean (at least 50, well above the noise and under half the saturation); the red and blue samples are then dropped where the green ones of the same star fall. The offsets at the centre and in the corners are given in the log and in the Report.

Colour of the samples
Drizzle scale
Coverage variation (standard deviation / median)
Output pixels left empty
Figure 1. The coverage of the output grid by the samples of one colour. Heavy lines: sensor pixels; fine lines: output pixels. Orange squares: the drops of the first frame; dots: the centres of the drops of the other frames (up to 60 frames). The darker an output pixel, the more drop area it received; a hatched one received none. A simplified model of what the block computes: shifts only, drawn at random, on a patch of 12 × 12 sensor pixels.

3Scale and drop size

Before it stacks, FLOAT computes the map of figure 1 from the real registration of the frames the selection keeps, on a grid of small patches of the field. It then applies the rule of the DrizzlePac Handbook: the standard deviation of the weight map must stay under 20 % of its median. The variation is measured for each colour; red and blue decide.

  • A scale of 1.5 or 2 is proposed only if the stars are undersampled (a width under 2 pixels) and the rule holds at that scale. Drizzle restores detail only in that case.[1]
  • The drop size is then the smallest value, in steps of 0.05 from 1 / scale upwards, that keeps the rule.
  • At scale 1, the drop size is 1.

The estimate takes about 0.5 s for 100 frames and 1.5 s for 300, on one processor core. After the stack, the same statistic is measured on the weight map actually obtained.

Table 1.The method FLOAT proposes, by the series of frames.
SeriesProposedWhy
Colour sensor, fewer than 15 framesClassicToo few frames for the red and blue samples to cover the grid.
Colour sensor, red or blue coverage varying by 20 % or more at 1×ClassicThe 20 % rule does not hold.[2]
Colour sensor, enough well-shifted framesBayer drizzle, at the scale the rule givesThe rule holds.
Colour sensor, stars under 2 px, coverage holding at 1.5× or 2×Bayer drizzle at 1.5× or 2×Undersampled stars: the finer grid restores detail.[1]
Monochrome sensorClassic; drizzle only with stars under 2 px, 15 frames and the coverage holding at 1.5× or 2×No colour mosaic: drizzle only adds detail when the stars are undersampled.
Frames already in colour (JPEG, PNG, TIFF)ClassicNo mosaic of raw samples to drop.

Figure 2 shows the weight map obtained on a real night: with stars of 2.1 px the scale stayed at 1, and the coverage of each colour varies by 1.5 to 3.1 %, far under the 20 % of the rule.

0.90 0.95 1.00 1.05 1.10 0 5 10 15 20 25 Coverage / median coverage Share of the pixels (%) Red, 3.1 % Green, 1.5 % Blue, 2.7 % 0.90 0.95 1.00 1.05 1.10 0 5 10 15 20 25 Coverage / median coverage Share of the pixels (%) Red, 3.1 % Green, 1.5 % Blue, 2.7 %
Figure 2. Distribution of the weight map of the stack, each colour over its median, in bins of 0.01, on the field without a tenth on each side. Data: the Pleiades, 1344 of 1348 frames of 13 s, Bayer drizzle at scale 1 with drops of 1 pixel. The legend gives the variation of each colour (standard deviation over median); the estimate made before the stack was 2.5, 1.1 and 2.5 %.

4Outlier rejection

Satellites, planes, cosmic rays and hot pixels are left out sample by sample. The Bayer drizzle has three ways of finding them.

On the raw pixels

A sigma clipping against the spread measured at each output point. A first pass keeps the weighted mean and standard deviation of the samples dropped there; a second leaves out the samples farther than the threshold (3 standard deviations) and measures both again; a third judges every sample against these values and deposits the ones kept. There is no noise model: the spread is the one the frames show at that point. This follows the principle of Siril’s sigma clipping, with the weighted mean as centre.[3]

Figure 3 shows what this rejection took from each frame of a long series: a few hundredths of a percent of the samples, most of them above the mean, with a few frames standing out.

0 60 120 180 240 300 0.00 0.05 0.10 0.15 0.20 0.25 Time since the first frame (min) Samples rejected (%) Above the mean Below the mean 0 60 120 180 240 300 0.00 0.05 0.10 0.15 0.20 0.25 Time since the first frame (min) Samples rejected (%) Above the mean Below the mean
Figure 3. Share of the samples of each stacked frame left out by the rejection on the raw pixels, against the time since the first frame. Data: the Pleiades, 1344 frames of 13 s, threshold 5 standard deviations (the default when this stack was made). Blue: samples above the mean (median 0.029 % per frame); orange: below it (0.007 %). Five frames lose more than 0.1 %, the most 0.20 %.

By frame count

With N values, one outlier can reach at most (N − 1) / √N standard deviations: under 3 below 11 values. In a Bayer drizzle, red and blue hold about a quarter of the frames at a point, so a sigma clipping at 3 can run short of values. The values of every frame are then kept for each output point, and the rejection is chosen by their number: percentile clipping, winsorized sigma clipping, or linear fit clipping. FLOAT proposes this way when the colours hold too few values per point.

From the Classic stack’s rejection

The rejection of the Classic method runs on the debayered, registered frames, and what it rejects in a frame is left out of that frame’s drops on the same output pixels.

5Two half-stacks

The frames are dealt alternately, in blocks of 20, to two half-stacks A and B built the same way. Both show the same sky; the noise of their frames is independent. Their difference gives the noise of the stack: with equal weights, the noise of the stack is half the standard deviation of A − B (in general, that deviation times √(wA wB) / (wA + wB), w being the sum of the frame weights of each half). The Denoise block uses them as a pair: a network that predicts one half from the other keeps only what both contain.[5]

6The Classic method

Each frame is debayered with RCD,[6] the colours balanced before and the balance taken off after, as raw converters do. It is resampled onto the reference grid with Lanczos-4, clamped to hold back the dark rings Lanczos-4 draws around bright stars. The frames are then combined with a rejection chosen by their number: percentile clipping under 6 frames, winsorized sigma clipping from 6 to 15, linear fit clipping from 16. The combination itself can be chosen: the weighted mean of what the rejection keeps (the default), the median, the maximum (star trails, meteors and satellites are kept), the minimum, or the sum. The four last reject nothing and give every frame the same weight.

7Settings

Table 2.The main settings of the block. “Automatic” values are shown in FLOAT with their reason.
SettingValueRangeWhat it does
Stacking methodautomaticBayer drizzle, ClassicClassic suits few or barely shifted frames, whose red and blue pixels leave holes in a drizzle.
Drizzle scaleautomatic1 – 3 ×Output resolution relative to the sensor. Higher values cost memory and add noise.
Drop sizeautomatic0.3 – 1Size of the deposited drop relative to the input pixel. Smaller drops are sharper but noisier, with a risk of holes.
Rejection (drizzle)automaticOn the raw pixels, By frame count, From the classic stack’s rejectionHow outliers are found (section 4).
Rejection threshold3 σ2 – 20Higher keeps more samples; lower removes more trails but may eat star cores in poor seeing.
Half-stack block20 frames1 – 200The size of the blocks of frames dealt in turn to the half-stacks A and B.
Combination (Classic)meanmean, median, maximum, minimum, sumWith the Classic method: how the values of the frames at each pixel make the stack.
Pattern removaloffon, offMeasures the sensor’s fixed pattern and subtracts it from every frame (section 8).

8Limits, and what was tried

  • Pattern removal is off by default. It measures the fixed pattern of the sensor as the median of the frames in sensor coordinates, and subtracts it, against the streaks known as walking noise. On some stacks the estimate also held the tracks of the faint stars across the sensor, and subtracting it drew the very streaks it was meant to remove.
  • No Bayer drizzle for frames already in colour. A JPEG, PNG or TIFF frame has no mosaic of raw samples to drop: the Classic method is used (issue 57).
  • Few frames at a point, no rejection. Where fewer than three frames cover a point, at the edges of the field, nothing is rejected.

References

  1. Fruchter, A. S. & Hook, R. N. 2002, Drizzle: A Method for the Linear Reconstruction of Undersampled Images, PASP 114, 144. arXiv:astro-ph/9808087
  2. The DrizzlePac Handbook, version 3, Space Telescope Science Institute, §7.3 “Inspecting Drizzled Products after User Reprocessing”. hst-docs.stsci.edu/drizzpac
  3. Siril documentation, Stacking, “Rejection algorithms”. siril.readthedocs.io
  4. Samuelson, P. A. 1968, How Deviant Can You Be?, JASA 63, 1522. doi:10.1080/01621459.1968.10480944
  5. Lehtinen, J. et al. 2018, Noise2Noise: Learning Image Restoration without Clean Data, ICML. arXiv:1803.04189
  6. Sanz Rodríguez, L., Ratio Corrected Demosaicing (RCD), release 2.3. github.com/LuisSR/RCD-Demosaicing