Block
Color
- 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.
- Deconvolution
- Denoise
- Color
- Stars/background
- 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.
| Reason | What it means |
|---|---|
| Edge | Within 50 pixels of the edge of the stack. |
| Not measured | Empty pixels in its aperture. |
| Not positive | No positive flux in every colour: faint, or on a dark background. |
| Saturated | A 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.
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.
8Settings
| Setting | Value | Range | What it does |
|---|---|---|---|
| If calibration fails | Fallback balance | Fallback balance, Stop | What the block does when the stars cannot calibrate the colours (section 6). |
| Minimum stars | 50 | 20 – 2000 | The fewest measured stars with a Gaia spectrum the calibration accepts. 50 gives each factor about 1 % of uncertainty. |
| Photometry aperture (Advanced) | automatic | 1.5 – 30 px, step 0.5 | Radius 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 reference | 5778 K | 3000 – 12,000 K, step 100 | Colour temperature rendered as neutral white. A 5778 K blackbody is close to the Sun’s spectrum, a G2V star. |
| Bright limit (Advanced) | G 7.5 | 3 – 15, step 0.5 | Brightest Gaia stars whose XP spectrum is used. |
| Faint limit (Advanced) | G 14 | 8 – 17.5, step 0.5 | Faintest Gaia stars whose XP spectrum is used. |
| Star count (Advanced) | 4000 | 100 – 20,000 | Maximum 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
- 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
- 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
- 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
- Demleitner, M. & Andrae, R. 2022, Monte Carlo sampled DR3 XP spectra, GAVO Data Center. doi:10.21938/W:hWbPah3wBabuqewQULTA
- Buchsbaum, G. 1980, A spatial processor model for object colour perception, J. Franklin Inst. 310, 1. doi:10.1016/0016-0032(80)90058-7
- 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
- Theil, H. 1950, A rank-invariant method of linear and polynomial regression analysis, I, Proc. Kon. Ned. Akad. Wetensch. 53, 386.
- 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