Keep Gaia's colour on a star HYG describes without one

combine took the described entry's colour whole, null included. So a HYG row with no B-V, merged
into its Gaia source, lost the BP-RP Gaia measured for it: HD 45951, HD 45291 and HD 124953, three
naked-eye giants Gaia has at BP-RP 1.25, 1.19 and 0.37, showed no colour on their card. HD 45951's
point had its colour at 280159d, as a bare Gaia designation.

combine now takes the colour, in its own system, from the other entry where the description has
none. The fallback the review proposed, `described.colorIndex ?? other.colorIndex`, reads the same
empty row here, since the Gaia entry is inserted first and so is `kept`, and the HYG row is both
`other` and `described`; it is one of the mutants below. The fold into a source whose HYG star SIMBAD
puts elsewhere keeps the Gliese row's own colour or none, not that other star's.

Published catalogue: 931 stars gain a Gaia BP-RP, all HYG-described entries on a Gaia source with
a V magnitude. 298 of them had neither type nor colour and are now drawn with a temperature and a
radius. 621 dwarfs read their temperature off that colour rather than their type's row, 290 of them
by more than 500 K. The colour is the one every other dwarf on the map is read from, and it agrees
with the brightness where the type does not: HIP 1546, "K:" at V 12.46 and 33.5 pc (M_V 9.8), was
5 270 K and 0.126 R, and is 3 732 K and 0.42 R at BP-RP 2.01. The three giants keep the
temperature and radius their type gives. Star count and every ETL figure unchanged.

Guarded mutants: no fallback, and the review's fallback to `other`, each fail only "keeps Gaia's
colour where the description has none"; the misplaced fold falling back to the other star's colour
fails only "describes the entry by the Gliese row where SIMBAD names the HYG star already there as
another source" (1 of 837 each).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-30 21:28:29 +02:00
co-authored by Claude Opus 5.5
parent 5620776601
commit 98082a0460
3 changed files with 20 additions and 1 deletions
+11
View File
@@ -192,6 +192,15 @@ describe('mergeStarCatalogues', () => {
expect(merged).toMatchObject({ magnitude: 11.01, magnitudeBand: 'V', colorIndex: 1.807, colorSystem: 'B-V', distanceError: 0.000065, distanceFromGaia: true }); expect(merged).toMatchObject({ magnitude: 11.01, magnitudeBand: 'V', colorIndex: 1.807, colorSystem: 'B-V', distanceError: 0.000065, distanceFromGaia: true });
}); });
it("keeps Gaia's colour where the description has none", () => {
// HD 45951: HYG gives V 6.20 and K2III but no B−V; Gaia DR3 3369454521490604416 has BP−RP 1.248.
const hyg = at(119622, 97.79164, 16.93863, 112, { name: 'HD 45951', magnitude: 6.2, magnitudeBand: 'V', spectralType: 'K2III', colorIndex: null });
const gaia = at(1000004369, 97.79164, 16.93863, 112, { name: 'Gaia DR3 3369454521490604416', magnitude: 5.898, magnitudeBand: 'G', colorIndex: 1.248, colorSystem: 'BP-RP', source: 'gaia' });
const [merged] = mergeStarCatalogues([{ ...HIPPARCOS, stars: [hyg] }, { ...GAIA, stars: [gaia] }]).stars;
expect(merged).toMatchObject({ name: 'HD 45951', magnitude: 6.2, magnitudeBand: 'V', colorIndex: 1.248, colorSystem: 'BP-RP' });
});
it("takes a Hipparcos distance more precise than the Gaia entry it folds into, along Gaia's direction", () => { it("takes a Hipparcos distance more precise than the Gaia entry it folds into, along Gaia's direction", () => {
// Schedar: 71.0 pc ±3.5 % in Gaia, which saturates on it, and 70.0 pc ±1.0 % in Hipparcos. // Schedar: 71.0 pc ±3.5 % in Gaia, which saturates on it, and 70.0 pc ±1.0 % in Hipparcos.
const hyg = at(3179, 10.1268, 56.5373, 70.0, { name: 'Schedar', magnitude: 2.24, distanceError: 0.0105, distanceFromGaia: false }); const hyg = at(3179, 10.1268, 56.5373, 70.0, { name: 'Schedar', magnitude: 2.24, distanceError: 0.0105, distanceFromGaia: false });
@@ -366,6 +375,8 @@ describe('foldByIdentity', () => {
expect(stars).toHaveLength(1); expect(stars).toHaveLength(1);
expect(stars[0]).toMatchObject({ id: 119589, name: 'Gl 905.2B', spectralType: 'DA4', magnitude: 12.9, colorIndex: 0.15, source: 'gaia' }); expect(stars[0]).toMatchObject({ id: 119589, name: 'Gl 905.2B', spectralType: 'DA4', magnitude: 12.9, colorIndex: 0.15, source: 'gaia' });
expect(Math.hypot(stars[0].x, stars[0].y, stars[0].z)).toBeCloseTo(18.6, 9); expect(Math.hypot(stars[0].x, stars[0].y, stars[0].z)).toBeCloseTo(18.6, 9);
// Nor the M5's B−V where the row has no colour of its own (Gl 225.2C, beside HD 40887's).
expect(foldByIdentity([...merged, { ...gl905b, colorIndex: null }], identities).stars[0].colorIndex).toBeNull();
}); });
it('leaves a star with a Hipparcos error alone, and one of another brightness than the HYG star already there', () => { it('leaves a star with a Hipparcos error alone, and one of another brightness than the HYG star already there', () => {
+9 -1
View File
@@ -262,14 +262,21 @@ export function isSameStar(kept: StarRecord, entry: StarRecord): boolean {
* unless the other entry's distance is the more precise, as the Hipparcos one of a bright star * unless the other entry's distance is the more precise, as the Hipparcos one of a bright star
* `placementDistancePc` keeps at it is, which then sets the distance along Gaia's direction. * `placementDistancePc` keeps at it is, which then sets the distance along Gaia's direction.
* `described` overrides that choice where an identity settles it (see {@link foldByIdentity}). * `described` overrides that choice where an identity settles it (see {@link foldByIdentity}).
*
* A colour the description lacks comes from the other entry, in its own system: HYG has none for
* HD 45951, HD 45291 and HD 124953, three naked-eye giants Gaia measures at BP−RP 1.25, 1.19 and
* 0.37, and each card showed no colour at all.
*/ */
function combine(kept: StarRecord, other: StarRecord, described = isDesignation(kept) && !isDesignation(other) ? other : kept): StarRecord { function combine(kept: StarRecord, other: StarRecord, described = isDesignation(kept) && !isDesignation(other) ? other : kept): StarRecord {
const otherBetter = other.distanceError !== undefined && kept.distanceError !== undefined && other.distanceError < kept.distanceError; const otherBetter = other.distanceError !== undefined && kept.distanceError !== undefined && other.distanceError < kept.distanceError;
const placed = otherBetter ? other : kept; const placed = otherBetter ? other : kept;
const scale = otherBetter ? distanceOf(other) / distanceOf(kept) : 1; const scale = otherBetter ? distanceOf(other) / distanceOf(kept) : 1;
const gaiaDesignation = kept.gaiaDesignation ?? other.gaiaDesignation; const gaiaDesignation = kept.gaiaDesignation ?? other.gaiaDesignation;
const coloured = described.colorIndex !== null ? described : described === kept ? other : kept;
return { return {
...described, ...described,
colorIndex: coloured.colorIndex,
colorSystem: coloured.colorSystem,
x: kept.x * scale, x: kept.x * scale,
y: kept.y * scale, y: kept.y * scale,
z: kept.z * scale, z: kept.z * scale,
@@ -339,9 +346,10 @@ export function foldByIdentity(stars: readonly StarRecord[], gaiaDesignationById
} }
const describer = gaiaDesignationById.get(result[target].id); const describer = gaiaDesignationById.get(result[target].id);
const { magnitude, magnitudeBand, colorIndex, colorSystem } = result[target]; const { magnitude, magnitudeBand, colorIndex, colorSystem } = result[target];
// Where the Gliese row is the star, its colour too, or none: not the one of the star SIMBAD puts elsewhere.
result[target] = result[target] =
describer !== undefined && describer !== designation describer !== undefined && describer !== designation
? combine(result[target], star, star) ? { ...combine(result[target], star, star), colorIndex: star.colorIndex, colorSystem: star.colorSystem }
: { ...combine(result[target], star), magnitude, magnitudeBand, colorIndex, colorSystem }; : { ...combine(result[target], star), magnitude, magnitudeBand, colorIndex, colorSystem };
// One star each: a second Gliese row naming the same source is another star SIMBAD has not split. // One star each: a second Gliese row naming the same source is another star SIMBAD has not split.
byDesignation.delete(designation!); byDesignation.delete(designation!);
Binary file not shown.