Tint a star measured in Gaia's BP−RP as the B−V of the dwarf of that colour

colorIndexToRgb maps a B−V onto the star field's tint ramp, and its one caller passed it every
star's colour index, whatever colorSystem said. BP−RP is the larger of the two for the same star —
0.823 against 0.65 for a G2 dwarf, 1.84 against 1.42 for an M0 (Pecaut & Mamajek) — so the 376 703
stars measured in it, 83 % of the catalogue, were tinted as later types than they are, and redder
than HYG's stars of the same type, and than their own disc in the system view.

A BP−RP is now carried to the B−V of the dwarf sequence at that colour (the table's own B−V
column, which DwarfSequencePoint now returns, clamped at its ends), then tinted as before. The
median Gaia colour, BP−RP 0.883, a G7 dwarf, read as a K2: its tint goes from (1, 0.972, 0.955) to
(0.975, 0.982, 1), the same as HYG's G7 stars.

Controls, each failing its named test: BP−RP read as B−V (2 of 792 failed), the star field not
passing the colour system (1 of 792), and the B−V taken from the wrong column (3 of 792).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-29 20:31:27 +02:00
co-authored by Claude Opus 5.5
parent fa52f6a818
commit 4191b70e63
4 changed files with 34 additions and 7 deletions
+2 -2
View File
@@ -168,8 +168,8 @@ describe('dwarfSequenceAtColor', () => {
});
it('reads the row at the end a colour is past, when asked to', () => {
expect(dwarfSequenceAtColor(2.2, 'B-V', true)).toEqual({ temperatureK: 2420, bolometricCorrectionV: -5.78, gMinusV: -3.09 });
expect(dwarfSequenceAtColor(-0.15, 'BP-RP', true)).toEqual({ temperatureK: 10700, bolometricCorrectionV: -0.42, gMinusV: 0.018 });
expect(dwarfSequenceAtColor(2.2, 'B-V', true)).toEqual({ bMinusV: 2.16, temperatureK: 2420, bolometricCorrectionV: -5.78, gMinusV: -3.09 });
expect(dwarfSequenceAtColor(-0.15, 'BP-RP', true)).toEqual({ bMinusV: -0.07, temperatureK: 10700, bolometricCorrectionV: -0.42, gMinusV: 0.018 });
expect(dwarfSequenceAtColor(null, 'B-V', true)).toBeNull();
});
});
+3
View File
@@ -181,6 +181,8 @@ export function spectralTypeFromColor(colorIndex: number | null, system: 'B-V' |
/** What the dwarf sequence says of a star of a given colour. */
export interface DwarfSequencePoint {
/** B−V, the colour in the other system's terms where it was read off BP−RP. */
bMinusV: number;
temperatureK: number;
/** Bolometric correction to V: what V leaves out of the star's total output, in magnitudes. */
bolometricCorrectionV: number;
@@ -208,6 +210,7 @@ export function dwarfSequenceAtColor(colorIndex: number | null, system: 'B-V' |
const t = (colour - blue[column]!) / (red[column]! - blue[column]!);
const lerp = (from: number, to: number): number => from + (to - from) * t;
return {
bMinusV: lerp(blue[1], red[1]),
temperatureK: lerp(blue[3], red[3]),
bolometricCorrectionV: lerp(blue[4], red[4]),
gMinusV: blue[5] === null || red[5] === null ? null : lerp(blue[5], red[5])