Drop the "..." Hipparcos leaves on a spectral type, which read as the app cutting it short

2 127 stars, Sirius among them, read "Spectral type A0m...", in search rows, route options and
the star card. The mark is Hipparcos's own: every one of the 3 803 HYG rows ending in it has a HIP
number, and the catalogue ends a classification it does not print in full with it. The app
truncated nothing, but the text reads as if it had.

fetchStars now trims a trailing "..." from HYG's spectral types. The dictionary in
stars-index.json goes from 3 056 distinct types to 2 883, and from 598 dotted ones to none. The
names, sources and source indices are unchanged, and so is every other column of stars-meta.bin
bar the type indices. gzip -9 of the index goes from 4 015 865 to 4 015 205 bytes.

build.ts validateStars now fails a catalogue with any type ending in "...". Run with the trim
removed, the ETL failed on 2 127 such types. Two ETL runs from cache wrote identical
stars-meta.bin and stars-index.json.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-24 23:44:41 +02:00
co-authored by Claude Opus 5.5
parent 5333be615e
commit 70cbdae306
4 changed files with 16 additions and 2 deletions
File diff suppressed because one or more lines are too long
Binary file not shown.
+5
View File
@@ -80,6 +80,11 @@ function validateStars(stars: StarRecord[]): void {
`${withoutError} stars have no distance error (at most ${MAX_STARS_WITHOUT_DISTANCE_ERROR} expected) — the parallax errors are being lost.` `${withoutError} stars have no distance error (at most ${MAX_STARS_WITHOUT_DISTANCE_ERROR} expected) — the parallax errors are being lost.`
); );
console.log(` ${withoutBand} stars with a stand-in magnitude; ${withoutError} distances without a published error.`); console.log(` ${withoutBand} stars with a stand-in magnitude; ${withoutError} distances without a published error.`);
// Hipparcos's mark on a classification it does not print in full reached the card as "Spectral
// type A0m...", for Sirius and 2 126 other stars, which reads as text the app cut short.
const dotted = stars.filter((star) => star.spectralType.endsWith('...')).length;
assertCondition(dotted === 0, `${dotted} spectral types end in "..." — fetchStars no longer trims Hipparcos's mark from them.`);
} }
/** /**
+10 -1
View File
@@ -60,6 +60,15 @@ function resolveName(row: Record<string, string>): string {
return `HYG ${row['id']}`; return `HYG ${row['id']}`;
} }
/**
* HYG's spectral type, without the `...` that 2 127 of the map's stars end in, all of them
* Hipparcos stars: the Hipparcos catalogue's mark for a classification it does not print in full
* (Sirius is "A0m..."). On the map it read as text the app had cut short.
*/
function spectralTypeOf(row: Record<string, string>): string {
return (row['spect'] ?? '').replace(/\.\.\.$/, '') || 'Unknown';
}
/** /**
* Downloads the HYG (Hipparcos/Yale/Gliese) stellar database, places each star along its * Downloads the HYG (Hipparcos/Yale/Gliese) stellar database, places each star along its
* equatorial direction (epoch J2000.0) at the better of its Hipparcos and Gaia distances, keeps * equatorial direction (epoch J2000.0) at the better of its Hipparcos and Gaia distances, keeps
@@ -135,7 +144,7 @@ export async function fetchStars(): Promise<StarRecord[]> {
z: z * scale, z: z * scale,
magnitude, magnitude,
...(magnitudeV === undefined ? {} : { magnitudeBand: 'V' as const }), ...(magnitudeV === undefined ? {} : { magnitudeBand: 'V' as const }),
spectralType: row['spect'] || 'Unknown', spectralType: spectralTypeOf(row),
colorIndex: colorIndex ?? null, colorIndex: colorIndex ?? null,
...(colorIndex === undefined ? {} : { colorSystem: 'B-V' as const }), ...(colorIndex === undefined ? {} : { colorSystem: 'B-V' as const }),
...(distanceError === undefined ? {} : { distanceError }), ...(distanceError === undefined ? {} : { distanceError }),