Read an archive host's colour off the dwarf sequence at its temperature, and say it was not measured

For an archive-placed host with a temperature and no B magnitude, fetchExoplanets took B−V from
Ballesteros' blackbody fit, which runs 0.1 to 0.2 redder than Pecaut & Mamajek's dwarf sequence
below 3 800 K, and the luminosity then read its correction off that sequence at that colour: 3 500 K
came back as 3 102 K with a correction 1.15 magnitudes too large, anything under about 3 170 K was
clamped to B−V 2.00, and the card printed it as a measured "Colour B−V 2.00". CFBDSIR
J145829+101343, a 580 K brown dwarf, read "Spectral type ~M6, from colour".

temperatureToColorIndex now reads the table itself backwards, interpolating B−V between the two
types the temperature falls between, so the temperature and correction read back off the colour
are the table's at that temperature; it has no answer outside 2 420 to 31 400 K. The colour is
flagged colorFromTemperature, a fifth bit in the photometry byte (the format, README and the ETL's
round-trip check follow), and the card prints it "B−V 1.66, from its temperature", marked derived.

From cache: 57 archive stars change colour; 54 carry the flag and 3, CFBDSIR J145829+101343 among
them, now have none. For the 47 of them the archive gives a luminosity, the one derived from
magnitude and colour moves from a median 0.228 dex off it to 0.124; Kepler-445 (3 157 K) from
0.0282 L☉ to 0.0080 against the archive's 0.0079. Its colour goes from 2.00 to 1.67. The card shows
the archive's luminosity where it has one since earlier on this branch, so this is the figure used
for the rest and for their radii.

Controls, each failing its named test: the nearest hotter row taken without interpolating (2 of
803 failed), no refusal outside the table, the flag not encoded, and the card calling the colour
measured (1 of 803 each).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-29 21:29:09 +02:00
co-authored by Claude Opus 5.5
parent f82b5e1c74
commit 23547defe0
11 changed files with 61 additions and 31 deletions
+11 -8
View File
@@ -99,19 +99,22 @@ describe('spectralTypeToColorIndex', () => {
});
describe('temperatureToColorIndex', () => {
it("puts the Sun's temperature at its own B-V and a cool dwarf redder", () => {
it("puts the Sun's temperature at its own B-V and a cool dwarf where the dwarf sequence has it", () => {
expect(temperatureToColorIndex(5772)).toBeCloseTo(0.65, 2);
expect(temperatureToColorIndex(3400)).toBeCloseTo(1.79, 2);
// Two thirds of the way from M2 (3 560 K, B−V 1.505) to M2.5 (3 470 K, 1.522).
expect(temperatureToColorIndex(3500)).toBeCloseTo(1.5163, 4);
});
it('stays inside the range the spectral classes span', () => {
expect(temperatureToColorIndex(2566)).toBe(2);
expect(temperatureToColorIndex(50000)).toBe(-0.33);
it('reads back as the temperature it came from, so the correction is the one at that temperature', () => {
for (const temperatureK of [31400, 12000, 7000, 5772, 4000, 3500, 3157, 2566, 2420]) {
expect(dwarfSequenceAtColor(temperatureToColorIndex(temperatureK))!.temperatureK).toBeCloseTo(temperatureK, 6);
}
});
it('has no answer for a temperature that is not one', () => {
expect(temperatureToColorIndex(0)).toBeNull();
expect(temperatureToColorIndex(Number.NaN)).toBeNull();
it('has no answer outside the table, nor for a temperature that is not one', () => {
for (const temperatureK of [580, 2419, 31401, 50000, 0, Number.NaN]) {
expect(temperatureToColorIndex(temperatureK)).toBeNull();
}
});
});