Estimate a spectral type from each star's colour where no catalogue gives one, and say so
383 695 of the 455 608 stars read "Spectral type Unknown", every Gaia star among them, although 380 884 of them carry a colour. The card now gives those the type of the dwarf whose colour is nearest, in the colour's own system, marked as an estimate: TRAPPIST-1, BP-RP 4.90, reads "Spectral type ~M8, from colour", which is how it was classified (M8 V). A star with neither a type nor a colour gets no subtitle rather than the literal "Unknown". The colours are Pecaut & Mamajek's mean dwarf sequence (2013, ApJS 208, 9, table 5), as Mamajek maintains it online (version 2022.04.16, which carries Gaia BP-RP), from B0 to M8.5. B-V cannot tell O types apart (the whole sequence spans 0.03 of it), and BP-RP turns back past M8.5 and is tabulated only from B9. A colour outside the table gets no estimate: 186 BP-RP and 41 B-V colours, among them the blue Gaia DR3 5612323414549657984 at BP-RP -0.15. 380 657 stars get an estimate: F 97 840, G 144 327, K 105 984, M 29 142, A 3 272, B 92. Checked against catalogued types: - 19 433 HYG dwarfs with a B-V: 74.3 % within two subclasses, 95.5 % within five. - 146 Gaia exoplanet hosts the archive types as dwarfs, from BP-RP: 88.4 % within two subclasses, 98.6 % within five. The estimate assumes a dwarf, so a giant reads later than it is (Pollux, K0 III at B-V 0.99, reads K3). It also ignores reddening. The comment says both. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { parseSpectralClass, SPECTRAL_CLASSES, spectralTypeToColorIndex, temperatureToColorIndex } from './spectral';
|
||||
import { parseSpectralClass, SPECTRAL_CLASSES, spectralTypeFromColor, spectralTypeToColorIndex, temperatureToColorIndex } from './spectral';
|
||||
|
||||
describe('parseSpectralClass', () => {
|
||||
it('reads a clean class and subclass', () => {
|
||||
@@ -100,3 +100,31 @@ describe('temperatureToColorIndex', () => {
|
||||
expect(temperatureToColorIndex(Number.NaN)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('spectralTypeFromColor', () => {
|
||||
it("reads the Sun's type off either colour", () => {
|
||||
expect(spectralTypeFromColor(0.65, 'B-V')).toBe('G2');
|
||||
expect(spectralTypeFromColor(0.82, 'BP-RP')).toBe('G2');
|
||||
});
|
||||
|
||||
it('reads a red dwarf the way it was classified', () => {
|
||||
// TRAPPIST-1 is M8 V, and Gaia has it at BP−RP 4.90; Proxima is M5.5 Ve at B−V 1.81.
|
||||
expect(spectralTypeFromColor(4.902, 'BP-RP')).toBe('M8');
|
||||
expect(spectralTypeFromColor(1.807, 'B-V')).toBe('M5');
|
||||
});
|
||||
|
||||
it('does not read one colour as the other', () => {
|
||||
// 1.43 is a K5 dwarf in BP−RP and an M0 in B−V.
|
||||
expect(spectralTypeFromColor(1.43, 'BP-RP')).toBe('K5');
|
||||
expect(spectralTypeFromColor(1.43, 'B-V')).toBe('M0');
|
||||
expect(spectralTypeFromColor(1.43)).toBe('M0');
|
||||
});
|
||||
|
||||
it('has no answer past either end of the table, nor without a colour', () => {
|
||||
expect(spectralTypeFromColor(-0.35, 'B-V')).toBeNull();
|
||||
expect(spectralTypeFromColor(-0.15, 'BP-RP')).toBeNull();
|
||||
expect(spectralTypeFromColor(5.5, 'BP-RP')).toBeNull();
|
||||
expect(spectralTypeFromColor(null, 'B-V')).toBeNull();
|
||||
expect(spectralTypeFromColor(-0.301, 'B-V')).toBe('B0');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user