Block
Gradient
- What it does
- It takes off the uneven glow that light pollution and the Moon spread over the image, so that the sky background is even from one edge to the other.
- What it shows
- In Inspect, the stack with the gradient removed, with the size of the gradient (in % of the sky level) and the number of sky samples used; the same figure in the Report.
- What can be set
- The Method: Polynomial (the default) suits most fields, Automatic follows more complex gradients; and the Surface degree (2), raised to 3 or 4 for wide fields.
The Gradient block models the smooth sky that light pollution and the Moon add to the stack, and the vignetting of the sky background, and removes it from what every later block reads. It offers three models: a polynomial surface fitted on blocks of sky, a thin-plate spline through samples of sky, and an automatic surface fitted on every pixel that does not look like an object. Only the variation of the sky across the field is removed, not its level. An H-alpha survey of the field, when there is one, keeps the samples away from the nebulosity.
- Selection
- Stacking
- Astrometry
- Gradient
- Deconvolution
- Denoise
1What goes in, what comes out
The block reads the stack and the map of how many frames cover each pixel. Pixels that fewer than 60 % of the typical number of frames cover, and that reach the border of the stack, are left out; so are the areas excluded in the editor.
It writes the sky’s variation for each of the three colours, with a median of 0 over the covered field, and the level of the sky it leaves in place. Later blocks subtract the variation from the stack and the half-stacks A and B alike (section 5 of the Stacking page), so both share the same sky. The sky’s level is kept on purpose: the noise models of the later blocks rely on it.
FLOAT also reports how large the gradient was: the spread of the removed surface across the field (from its 1st to its 99th percentile), as a percentage of the sky’s level. The block’s preview shows the stack with the gradient removed.
2Polynomial
A polynomial of the pixel position, fitted for each colour on samples of sky.[1] With no sample placed, the field is cut into blocks; the side of the grid is the “Samples per side” setting, and each cell of the grid holds about 4 × 4 blocks. The median of a block is one sample.
The samples of sky are found on the luminance, over the whole field, in a loop. The surface is fitted on the samples; the samples that lie more than 2.5 sigmas above it are left out; the surface is fitted again, until the set no longer changes. The sigma is the scatter between neighbouring samples, so it measures the noise and the fine structure of the sky, not the objects, which change slowly from one block to the next. Samples below the surface are all kept: the sky is there.
Each colour is then fitted on those samples, leaving out, in turn, the ones farther than 2.5 sigmas from its own surface. A block counts as a sample only if the stack covers it at 99 % or more. Under 10 such blocks, or with fewer than three times as many samples as the surface has terms, the block stops and says so: lower the degree or the number of samples.
3RBF
A thin-plate spline (a radial basis function) through the samples of sky.[1][2] The surface passes near every sample, so it can follow a gradient of any shape; it also depends on where the samples are. The “Surface smoothing” setting sets how near: at 0 the surface passes through every sample, higher it passes near them and is smoother.
With no sample placed, the samples are a regular grid with “Samples per side” points along the shorter side of the image, a square box around each. The samples kept are the ones not above a degree-2 surface through them by more than 2.5 sigmas, found as in section 2. The coordinates and the values of each colour are rescaled before the fit, so that the smoothing means the same on every image.
The samples of the polynomial and of the RBF can also be placed by hand in the editor, and areas excluded there, as ellipses or painted strokes. Placed samples are always kept as placed.
4Automatic
A model with no samples, after the automatic method of background extraction of Siril.[1] It works on each colour apart, on a copy of the stack reduced 4 times by block means (“Working reduction”), with the image scaled to 0 to 1 between its darkest and its brightest pixels (0.01th and 99.99th percentiles of the covered field, with 20 % of headroom above). The background is first fitted on every pixel; then, for at most 20 rounds, until fewer than 1 pixel in 10,000 changes:
- the residual is the image minus the background; a pixel is kept when its residual lies between the median minus 4 sigmas and the median plus 2 sigmas, sigma being 1.4826 times the median absolute deviation of the residual over the whole covered field. Bright structures go first;
- with “Structure protection”, a smooth mask grown around the pixels whose residual exceeds the “Protection threshold” (0.05, on the 0 to 1 image) is left out too. “Protection growth” sets how far the mask grows. With “Noise protection” other than 0, the threshold is that many times the noise of the sky instead;
- never fewer than 2 % of the pixels are kept;
- the background is fitted again on the kept pixels.
The surface is built by filling the rejected areas from the kept pixels with repeated low-pass filters (three running box blurs that match a Gaussian[3]), then filtering once more. The radius of the filter is “Model scale” percent of the shorter side of the reduced image, 5 by default. A last low-pass, of “Model smoothness” times that radius, smooths the model; it is brought back to full size by bilinear interpolation. At the edges of the image, each blur continues the image along its slope, so that the surface does not sag towards the border.
With “Plane first”, a stiff polynomial (a plane by default) is fitted and removed first, and the flexible model works on what it leaves. This helps on gradients as strong as the objects themselves: a bright urban sky, a strong Moon gradient.
5The H-alpha survey as a guide
Where an H-alpha survey covers the field, FLOAT reprojects it onto the stack and uses it to choose the samples: with “Away from emission” on, the samples the block chooses (none placed) never sit where the survey shows nebulosity. The faint extensions of an emission nebula are then not taken for sky. The survey only says where not to sample; the sky model never reads its values.
The survey is scaled so that its sky is 0 and its bright emission 1 (1st and 99.5th percentiles of the field). A sample sits on emission when the median of that level in its box is above 0.02. The survey is used only if its range is at least 12 times its own noise; one that shows only noise leaves every sample. It is not used either when it would leave less than 5 % of the covered field for the samples, or too little sky for the fit: the block then chooses its samples on the image alone, and says so in the log. The automatic model takes no samples, so the survey does not act on it.
With the survey setting on “auto”, FLOAT uses NSNS when it covers at least 95 % of the field, otherwise the all-sky Finkbeiner map.[4][5] The setting can also name one of them, or “none”. A field that was not identified by the Astrometry block has no survey.
6Settings
| Setting | Value | Range | What it does |
|---|---|---|---|
| Method | Polynomial | Polynomial, RBF, Automatic | How the sky gradient is modelled (sections 2 to 4). |
| Surface degree | 2 | 1 – 5 | Degree of the polynomial. 3 or 4 for wide fields with complex gradients; a high degree on a field filled with nebula can take a part of it for sky. |
| Samples per side | 16 | 4 – 64 | With no sample placed. Polynomial: the field is cut into 4 times this many blocks per side. RBF: this many samples along the shorter side. More, smaller blocks find sky in a crowded field; fewer, larger ones average more noise. |
| Object rejection | 2.5 σ | 1 – 10 | Samples farther from the surface than this are taken as objects and left out, in turn. |
| Surface smoothing | 0.5 | 0 – 1 | RBF: 0, the surface passes through every sample; higher, it passes near them, smoother. |
| Away from emission | on | on, off | The samples the block chooses stay off the nebulosity the H-alpha survey shows. Samples placed by hand are always kept. |
| Model scale | 5 | 1 – 10 | Automatic: the scale below which variations are taken as objects rather than gradient. Higher keeps only the large gradients; lower follows more local ones and may take large faint objects for sky. |
| Model smoothness | 1 | 0 – 5 | Automatic: extra smoothing of the final model (0: none). |
| Structure protection | on | on, off | Automatic: masks the extended bright structures so that the model does not take them in. |
| Protection threshold | 0.05 | 0 – 1 | Automatic: brightness above the model, on the image scaled to 0 to 1, at which a pixel is taken as a structure. Lower protects more. |
| Protection growth | 0.5 | 0 – 1 | Automatic: how far the protection mask grows around the structures. |
| Noise protection | 0 | 0 – 50 | Automatic: when not 0, the protection threshold is this many times the noise of the sky, which suits a faint nebula in a field where bright stars set the range. |
| Plane first | off | on, off | Automatic: a stiff polynomial is fitted and removed before the flexible model. |
| Plane-first degree | 1 | 1 – 6 | Degree of that polynomial (1: a plane). |
| Working reduction | 4 × | 1, 2, 4, 8 | Automatic: the model is computed on a copy reduced this many times: faster, coarser. The scale of the background itself does not change. |
| Sample points | none | placed in the editor | The samples placed on the image. Empty: the block’s own grid. |
| Excluded ellipses, Excluded strokes | none | drawn in the editor | Areas that never enter any of the three models. |
| H-alpha survey | auto | auto, nsns, finkbeiner, none | Which survey guides the samples (section 5). |
| NSNS coverage | 0.95 | 0 – 1 | Below this fraction of the field covered by NSNS, “auto” switches to Finkbeiner. |
7Limits, and what was tried
- The polynomial and the automatic model trade against each other. The polynomial keeps faint, very wide structures best but follows only gradients of its own shape. The automatic model removes complex gradients best, and with them part of the faintest wide structures.
- A model that looks only at the image cannot tell a very wide faint cloud from a gradient. A lower model scale, a high degree and Plane first each can take part of a large faint or bright object for sky.
- The RBF depends on where its samples are. It is best with samples placed by hand.
- Frames stacked without alignment. When too little of the stack is covered by all the frames, the block cannot model the sky and asks for Registration to be placed before Stacking.
- The survey is a guide, not a reference. It does not exist for every field, and it is not used when the field was not identified. A method that fitted the survey as part of the true sky, with a gain, was tried and removed: it did not make the surface more flexible, and on a field with little H-alpha and much dust the fitted gain ran away and attributed to the survey light that was not its own.
References
- Siril documentation (version 1.5.0), Background Extraction: “Sample-based method” (RBF, Polynomial) and “Automatic (sample-free) method”. siril.readthedocs.io
- Bookstein, F. L. 1989, Principal warps: thin-plate splines and the decomposition of deformations, IEEE Transactions on Pattern Analysis and Machine Intelligence 11, 567. doi:10.1109/34.24792
- Wells, W. M. 1986, Efficient Synthesis of Gaussian Filters by Cascaded Uniform Filters, IEEE Transactions on Pattern Analysis and Machine Intelligence 8, 234. doi:10.1109/TPAMI.1986.4767776
- Ziegenbalg, S. 2025, Northern Sky Narrowband Survey (NSNS), DR0.2, H-alpha, intensity calibrated with WHAM data; northern sky, HiPS pixels of 6.4″ made from 5″ data; read as HiPS simg.de/P/NSNS/DR0_2/halpha. simg.de/nebulae3
- Finkbeiner, D. P. 2003, A Full-Sky H-alpha Template for Microwave Foreground Prediction, ApJS 146, 407 (all sky, 6 arcminutes; read as HiPS CDS/P/Finkbeiner). arXiv:astro-ph/0301558