FLOAT
EN FR

Block

Color

FLOAT 0.2.0 · beta of 15 November 2026

What it does
It sets the colour balance of the image from the stars of the field, whose true colours are known from the Gaia catalogue.
What it shows
A neutral sky and stars with their natural colours; Inspect lists every star measured, and whether it was used.
What can be set
Usually nothing: the defaults suit most fields; White reference chooses which star colour looks white, and Minimum stars can be lowered for a narrow field with few stars.

The Color block calibrates the colours of the stack on the stars of the field. The isolated stars of the field are measured on the stack and compared with the colours their Gaia XP spectra give. For red and blue, a robust straight line through the stars gives the factor that brings a white reference, a G2V star by default, to neutral; green stays at 1. The camera’s channels are not mixed. When the stars cannot calibrate the colours, a fallback balance takes over and the block says why.

  1. Deconvolution
  2. Denoise
  3. Color
  4. Stars/background
  5. Post

1What goes in, what comes out

The block reads the stack with the sky removed by the Gradient block, the stars the Catalogs block selected with their Gaia XP spectra, and the stack’s map of the pixels near saturation. The Catalogs block needs the solution of the Astrometry block to place those stars.

It writes one factor per camera channel, stored as a diagonal 3 × 3 matrix: a white balance of the camera’s colours, not a conversion to sRGB, so the camera’s primaries are kept. It also writes a table of every catalogue star with what was measured, what was expected, and whether the star was used or why not. Inspect shows the table.

The block does not work on a monochrome image, which has no colours to calibrate.

2The stars and their spectra

The colour stars are Gaia DR3 stars[3] of the field with an XP spectrum, between the Bright limit (G 7.5) and the Faint limit (G 14). Each one must be isolated: every other star within 40 arcseconds is at least 3 magnitudes fainter. The Catalogs block takes no star within 60 pixels of the edge, and the Color block sets aside any star within 50 pixels of the edge of the stack (Table 1).

At most 4000 stars are kept. When there are more, they are spread evenly over the magnitudes, not the brightest only: on a wide field taken with a camera lens, the brightest thousands are all saturated.

The spectra are the Gaia XP spectra, in the sampled form that Demleitner and Andrae published,[4] or the compact form of the offline catalogue, installed once (see the Astrometry block). When services with different wavelength grids answer, all spectra are brought to 400–800 nm. From its spectrum, each star gets its expected colour, as a point in the CIE XYZ colour space.

3Measuring the stars

Each star is measured on the stack by aperture photometry in each colour, within the Photometry aperture, over its own local background taken in a ring from 2.5 to 3.6 times the aperture’s radius. By default the aperture’s radius is 0.7 times the star FWHM measured by Registration, times the drizzle scale, and at least 4 pixels.

Table 1.The stars that are left out, and why. Inspect gives the reason of each one.
ReasonWhat it means
EdgeWithin 50 pixels of the edge of the stack.
Not measuredEmpty pixels in its aperture.
Not positiveNo positive flux in every colour: faint, or on a dark background.
SaturatedA sample near saturation in at least one frame, within the aperture or one pixel beyond it.

The saturated stars are found with the stack’s map of the samples near saturation. For a stack made before it kept that map, a star is saturated when its peak exceeds 45 % of the brightest pixels of the channel.

4The white and the factors

The white reference is the light of a blackbody at 5778 K. The expected XYZ colour of each star is adapted from this white to D65 (Bradford transform) and converted to linear sRGB, so that the white reference comes out neutral.

For red and for blue, FLOAT takes the ratio of the colour to green, measured on the stack, against the same ratio expected from the Gaia spectra. A straight line is fitted through the stars with the Theil–Sen estimator,[7][8] the median of the slopes of all pairs of stars, which is robust to the scatter of single stars. The line is read at the ratio of the white reference, 1. The factor is the inverse of the measured ratio there. Green is 1.

Figure 1 shows the two fits on a real stack: each star is one point per ratio, and the factors are read where the lines cross the white reference.

white reference 0.2 0.6 1.0 1.4 1.8 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Expected ratio to green, from the Gaia spectrum Measured ratio to green Red / green, stars Blue / green, stars Theil–Sen line, red Theil–Sen line, blue white reference 0.2 0.6 1.0 1.4 1.8 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Expected ratio to green, from the Gaia spectrum Measured ratio to green Red / green, stars Blue / green, stars Theil–Sen line, red Theil–Sen line, blue
Figure 1. Ratio to green measured on the stack against the ratio expected from the star’s Gaia XP spectrum, for red (filled dots) and blue (rings), with the Theil–Sen lines. Data: the Pleiades, 1344 frames of 13 s, 537 of the 605 catalogue stars of the field. At the white reference (grey line), the red line reads 1.903 and the blue one 0.792: before the common scaling, the factors are 0.526 for red and 1.263 for blue, green 1; after it, 0.427, 0.812 and 1.026. Settings: the defaults, the Photometry aperture automatic (4 px).

The three factors are then scaled by a common constant (divided by the mean of their inverses); the colours do not depend on it. This is the matrix. With fewer than 20 usable stars, no factor is computed. By default, 50 stars are required (Minimum stars): the scatter of the measured ratios is 5 to 7 %, and 50 stars give each factor an error of about 0.7 to 1 % (the scatter divided by √50).

5Where the matrix is applied

The matrix is applied to the linear image, after the Gradient block. Every block that reads the image after Color receives it multiplied by the matrix: the stack, and its two half-stacks.

The raw files’ daylight white balance, when the stack was multiplied by it, is taken back exactly by this calibration, which measures the white on the stars.

6The fallback balance

The stars cannot calibrate the colours when the field is not identified, when no Gaia star of the field is available, or when fewer than Minimum stars were measured. The setting If calibration fails chooses. With Fallback balance, the run goes on, the block is drawn in orange and its tooltip gives the reason. With Stop, the block fails.

The fallback balance is a calibration without photometry, in two steps. First, the sky level of each channel, the median of its pixels after clipping at 3 standard deviations what stands above the sky, is taken off, so that the background is neutral. Then red and blue are scaled so that the median ratio to green of the field’s stars, up to 2000 of them, is 1, the grey-world assumption[5] taken on the stars. With fewer than 10 measurable stars, the camera’s colours are kept.

7An approximation of the sensor’s response

The stars that calibrate the colours also tell something about the camera. The flux of a star in one channel is the integral of its spectrum times the channel’s response. With the Gaia XP spectra of the colour stars and the fluxes measured on the stack, FLOAT solves for the three responses that explain them best. Each curve is a sum, with no negative term, of Gaussians of standard deviation 12 nm centred every 15 nm from 380 to 1000 nm; the roughness of the curve is penalised, as in the recovery of camera sensitivities from known spectra,[6] and the stars the fit cannot explain are rejected over four passes.

The curves are computed in about a second when they are shown, from what the Catalogs and Color blocks saved; nothing more is stored. Inspect shows them under Color, with the colour each wavelength takes, and the Report prints them. Figure 2 shows the three curves rebuilt for one camera.

Hβ[OIII]Hα 400 450 500 550 600 650 700 750 800 0.0 0.2 0.4 0.6 0.8 1.0 Wavelength (nm) Relative response Red Green Blue Hβ[OIII]Hα 400 450 500 550 600 650 700 750 800 0.0 0.2 0.4 0.6 0.8 1.0 Wavelength (nm) Relative response Red Green Blue
Figure 2. Approximate response of the red, green and blue channels against wavelength, relative to the strongest, rebuilt from the colour stars of figure 1. Data: the Pleiades, 537 stars, spectra from 400 to 800 nm; the median misfit of the stars’ fluxes is 7.8 % in red, 8.5 % in green and 8.7 % in blue. The grey lines mark Hβ, [OIII] and Hα. Star spectra are broad and alike, so many curves explain the stars equally well: the shapes are approximate, and the response at a narrow line such as Hα can be well off (section 9). Here the blue curve is highest at 400 nm, the edge of the spectra, and the red one has two peaks: details of this kind are the least constrained.

8Settings

Table 2.The settings of the block, and the three of the Catalogs block that choose its stars. The Advanced ones are marked.
SettingValueRangeWhat it does
If calibration failsFallback balanceFallback balance, StopWhat the block does when the stars cannot calibrate the colours (section 6).
Minimum stars5020 – 2000The fewest measured stars with a Gaia spectrum the calibration accepts. 50 gives each factor about 1 % of uncertainty.
Photometry aperture (Advanced)automatic1.5 – 30 px, step 0.5Radius of the aperture that measures the stars. Automatic: 0.7 times the star FWHM measured by Registration, times the drizzle scale, at least 4 px. Larger is safer in poor seeing but noisier.
White reference5778 K3000 – 12,000 K, step 100Colour temperature rendered as neutral white. A 5778 K blackbody is close to the Sun’s spectrum, a G2V star.
Bright limit (Advanced)G 7.53 – 15, step 0.5Brightest Gaia stars whose XP spectrum is used.
Faint limit (Advanced)G 148 – 17.5, step 0.5Faintest Gaia stars whose XP spectrum is used.
Star count (Advanced)4000100 – 20,000Maximum number of XP spectra used.

9Limits, and what was tried

  • No colour matrix. An earlier version rebuilt the sensor’s sensitivity curves from the stars and fitted a 3 × 3 colour matrix on them. The stars do not constrain such a matrix where the spectra are alike, and it mixed the channels arbitrarily: the H-alpha of the Rosette and of the Heart came out magenta. It was taken out, and the block applies one factor per colour.
  • The camera’s spectral response is a diagnostic only. Inspect shows an approximation of it, recomputed when it is shown, from what the Catalogs and Color blocks saved. It changes no colour. On synthetic stars with known curves, the shapes came back within 0.02 of the maximum in the median over the visible, but the response at H-alpha came out 0.76 for a true 0.59. No error band is drawn: neither resampling the stars nor varying the smoothing measured that error.[6]
  • A white balance does not mix channels. It leaves the hue as the camera’s filters give it: an emission seen a little by the blue pixels stays a little blue.
  • Too few stars with a spectrum. A narrow field holds few of them. When the installed star spectra stop at a magnitude brighter than the Faint limit, the colour stars between the two have none, and the log says so. The full star spectra are installed from Settings › Catalogs & astrometry.
  • Saturated stars are left out. On a wide field taken with a lens, many of the brightest are.

References

  1. De Angeli, F. et al. 2023, Gaia Data Release 3: Processing and validation of BP/RP low-resolution spectral data, A&A 674, A2. arXiv:2206.06143
  2. Montegriffo, P. et al. 2023, Gaia Data Release 3: External calibration of BP/RP low-resolution spectroscopic data, A&A 674, A3. arXiv:2206.06205
  3. Gaia Collaboration, Vallenari, A. et al. 2023, Gaia Data Release 3: Summary of the content and survey properties, A&A 674, A1. arXiv:2208.00211
  4. Demleitner, M. & Andrae, R. 2022, Monte Carlo sampled DR3 XP spectra, GAVO Data Center. doi:10.21938/W:hWbPah3wBabuqewQULTA
  5. Buchsbaum, G. 1980, A spatial processor model for object colour perception, J. Franklin Inst. 310, 1. doi:10.1016/0016-0032(80)90058-7
  6. Finlayson, G., Hordley, S. & Hubel, P. 1998, Recovering device sensitivities with quadratic programming, IS&T/SID Color Imaging Conference 6, 90. doi:10.2352/cic.1998.6.1.art00020
  7. Theil, H. 1950, A rank-invariant method of linear and polynomial regression analysis, I, Proc. Kon. Ned. Akad. Wetensch. 53, 386.
  8. Sen, P. K. 1968, Estimates of the Regression Coefficient Based on Kendall’s Tau, J. Am. Stat. Assoc. 63, 1379. doi:10.1080/01621459.1968.10480934