List stars in search and routes by the type their colour gives them, and say where archive positions come from
5333be6gave the star card an estimated type for the 383 695 stars the ETL files as "Unknown", but search rows, the route search index and the current-star route option still printed that literal: TRAPPIST-1 read "STAR · UNKNOWN" in search beside "Spectral type ~M8, from colour" on its card, audit #17's own symptom. spectralClassification (spectral.ts) now gives the catalogue's type, else the colour's marked "~", else nothing, and all three and the card's subtitle use it; a search row with nothing to add prints its kind alone rather than a trailing " · ". The neighbourhood note still read "Positions from measured parallaxes" after4c8e4a0placed 3 277 stars at the Exoplanet Archive's sy_dist, 343 of them without a usable parallax and 281 of those past 1 kpc — microlensing hosts such as OGLE-2005-BLG-390L at 6.6 kpc, from a lensing model. positionsNote now says so, with the count. Neither the note nor the census subtitle (audit #16) had a test: putting back "Hipparcos · Yale Bright Star · Gliese" passed all 775. In the app on :4302: the note reads "Positions from measured parallaxes, and for the 3,277 planet hosts only the NASA Exoplanet Archive places, from its distances. Grid marks the galactic plane through the Sun."; search reads "TRAPPIST-1 STAR · ~M8", "OGLE-2005-BLG-390L STAR", "Sirius STAR · A0M"; TRAPPIST-1's route option has subtitle "~M8". The scene spec gains an archive-placed fixture star. Controls, each failing its named test: the search row printing the raw type, keeping the separator with nothing after it, the route index and the current-star option printing the raw type, the note back to parallaxes only, the subtitle back to the old catalogue list (1 of 797 each), the note never counting the archive (2 of 797), and the classification without its estimate (3 of 797). 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 { dwarfSequenceAtColor, isGiant, parseSpectralClass, SPECTRAL_CLASSES, spectralTypeFromColor, spectralTypeToColorIndex, temperatureToColorIndex } from './spectral';
|
||||
import { dwarfSequenceAtColor, isGiant, parseSpectralClass, spectralClassification, SPECTRAL_CLASSES, spectralTypeFromColor, spectralTypeToColorIndex, temperatureToColorIndex } from './spectral';
|
||||
|
||||
describe('parseSpectralClass', () => {
|
||||
it('reads a clean class and subclass', () => {
|
||||
@@ -143,6 +143,14 @@ describe('spectralTypeFromColor', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('spectralClassification', () => {
|
||||
it("gives the catalogue's type, else the colour's marked as an estimate, else nothing", () => {
|
||||
expect(spectralClassification({ spectralType: 'M5Ve', colorIndex: 1.807, colorSystem: 'B-V' })).toBe('M5Ve');
|
||||
expect(spectralClassification({ spectralType: 'Unknown', colorIndex: 4.902, colorSystem: 'BP-RP' })).toBe('~M8');
|
||||
expect(spectralClassification({ spectralType: 'Unknown', colorIndex: null })).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('dwarfSequenceAtColor', () => {
|
||||
it("puts the Sun's colour in either system at the Sun's temperature and correction", () => {
|
||||
for (const [colour, system] of [[0.65, 'B-V'], [0.823, 'BP-RP']] as const) {
|
||||
|
||||
Reference in New Issue
Block a user