Describe a folded Gliese star by its own row where SIMBAD puts the HYG star already there elsewhere

e7c420b folded a Gliese-only row into a Gaia entry a HYG star already described whenever the two V
agreed within 0.5, and kept that HYG star's description. HYG hangs "Gl 905.2A", M5, V 13.11,
B-V 1.55 on HIP 117059, which SIMBAD names as LAWD 93: Gl 905.2B, a DA white dwarf, Gaia DR3
2871730307948650368. Gl 905.2A is G 130-6, another source 3' away with no parallax. So the fold
dropped the white dwarf's own row (DA4, V 12.90, B-V 0.15) and drew its source as a 3 384 K M5
dwarf of 0.292 solar radii.

foldByIdentity now looks up the SIMBAD designation of the HYG star describing the target. Where it
names another source, the Gliese row is the star on this one, and its description, photometry
included, replaces that one (combine takes the described entry as an argument). Five of the 63
folds are of this kind; decoded from the published catalogue, before -> after:

- Gl 905.2A [116690] M5 V 13.11, 3 384 K, 0.292 R -> Gl 905.2B [119589] DA4 V 12.90, 8 175 K, 0.022 R
- GJ 9490A [71678] M0 -> GJ 9490C [118981] K5, the type SIMBAD gives BD+20 3009 (same V and B-V)
- HD 40887 [28371] V 7.85 -> Gl 225.2C [118408] V 8.30, on the source SIMBAD names GJ 225.2 C
- Tau Oph [88131] F5V+ V 4.77 (the pair's light) -> Tau Oph [119195] dF3 V 5.24, GJ 700.1 A's
- HD 65277 [38820] "Gl 293.1B" -> HD 65277 [118511] Gl 293.1A, V 8.06, on GJ 293.1 A's source

Nothing else changes: 455 519 stars, 63 folds, 0 Gliese rows beside their source, no planet
hosted on any of the five ids. The HD 40887 name leaves the map, SIMBAD putting HD 40887 AB on
the source HYG labels Gl 225.2B.

The tolerance's doc said the ten such pairs agree within 0.12. There are 14; 11 do, and the three
that differ by 0.21, 0.45 and 0.47 are three of these five.

Guarded mutants, each failing only "describes the entry by the Gliese row where SIMBAD names the
HYG star already there as another source" (1 of 834): the condition never true; the condition
inverted to describer === designation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-30 21:18:13 +02:00
co-authored by Claude Opus 5.5
parent e7c420b296
commit 5620776601
5 changed files with 38 additions and 6 deletions
+18
View File
@@ -350,6 +350,24 @@ describe('foldByIdentity', () => {
expect(stars[0]).toMatchObject({ id: 33139, name: 'HD 265866', magnitude: 9.89, magnitudeBand: 'V', colorIndex: 1.6, source: 'gaia' });
});
it('describes the entry by the Gliese row where SIMBAD names the HYG star already there as another source', () => {
// HYG hangs "Gl 905.2A", M5, on HIP 117059; SIMBAD has HIP 117059 as LAWD 93, Gl 905.2B, a DA
// white dwarf at 53.76 mas, and Gl 905.2A as G 130-6, a source 3′ away with no parallax.
const hip117059 = at(116690, 355.96134, 32.54631, 17.13, { name: 'Gl 905.2A', source: 'hyg', magnitude: 13.11, magnitudeBand: 'V', spectralType: 'M5', colorIndex: 1.55, colorSystem: 'B-V', distanceError: 0.1 });
const lawd93 = at(1000116690, 355.96134, 32.54631, 18.6, { name: 'Gaia DR3 2871730307948650368', gaiaDesignation: 'Gaia DR3 2871730307948650368', source: 'gaia', magnitude: 12.97, magnitudeBand: 'G', colorIndex: -0.04, colorSystem: 'BP-RP', distanceError: 0.0006 });
const gl905b = at(119589, 355.96134 + arcsecOfRa(8, 32.54631), 32.54631, 16.64, { name: 'Gl 905.2B', source: 'hyg', magnitude: 12.9, magnitudeBand: 'V', spectralType: 'DA4', colorIndex: 0.15, colorSystem: 'B-V' });
const { stars: merged } = mergeStarCatalogues([{ ...HIPPARCOS, stars: [hip117059] }, { ...GAIA, stars: [lawd93] }]);
const identities = new Map([
[hip117059.id, 'Gaia DR3 2871730758921709952'],
[gl905b.id, lawd93.gaiaDesignation!]
]);
const { stars, folded } = foldByIdentity([...merged, gl905b], identities);
expect(folded).toBe(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(Math.hypot(stars[0].x, stars[0].y, stars[0].z)).toBeCloseTo(18.6, 9);
});
it('leaves a star with a Hipparcos error alone, and one of another brightness than the HYG star already there', () => {
expect(foldByIdentity([{ ...gliese, distanceError: 0.05 }, gaia], identities).folded).toBe(0);
// A companion SIMBAD gives its primary's source: two magnitudes apart.
+19 -5
View File
@@ -261,9 +261,9 @@ export function isSameStar(kept: StarRecord, entry: StarRecord): boolean {
* records, and so does the distance's error: Gaia's, not the Hipparcos one of a distance dropped —
* 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.
* `described` overrides that choice where an identity settles it (see {@link foldByIdentity}).
*/
function combine(kept: StarRecord, other: StarRecord): StarRecord {
const described = isDesignation(kept) && !isDesignation(other) ? other : kept;
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 placed = otherBetter ? other : kept;
const scale = otherBetter ? distanceOf(other) / distanceOf(kept) : 1;
@@ -282,8 +282,10 @@ function combine(kept: StarRecord, other: StarRecord): StarRecord {
/**
* How far apart in V a Gliese-only entry and the HYG star already on its Gaia entry may be and still
* be one star. The ten such pairs agree within 0.12 (Gl 251 and HD 265866, 10.01 and 9.89); a
* companion SIMBAD gives its primary's source differs by magnitudes.
* be one star. Of the 14 such folds, 11 agree within 0.12 (Gl 251 and HD 265866, 10.01 and 9.89);
* Gl 905.2B, Gl 225.2C and 69 Tau Oph differ by 0.21, 0.45 and 0.47, and on all three SIMBAD puts
* the HYG star already there on another source (see {@link foldByIdentity}). A companion SIMBAD gives
* its primary's source differs by magnitudes.
*/
export const IDENTITY_FOLD_MAGNITUDE_TOLERANCE = 0.5;
@@ -311,6 +313,14 @@ export function foldsInto(target: StarRecord, entry: StarRecord): boolean {
* HYG's name and type. Taking the Gliese row's, as {@link combine} would, put CNS3's V at Gaia's
* distance: GJ 4285 at V 11.45, where its G 13.05 and BP−RP 2.74 give 14.4, drawn five times too
* luminous, and six stars with no colour lost their temperature and radius, Gl 700.1C among them.
*
* Unless SIMBAD names the HYG star already there as another source: then HYG hung it on the wrong
* one, and the Gliese row is the star that source is, so its description — photometry included —
* replaces that one. HIP 117059 is LAWD 93, the white dwarf Gl 905.2B (DA, V 12.94 in SIMBAD), which
* HYG labels "Gl 905.2A", M5, V 13.11, B−V 1.55: kept, the white dwarf was drawn as a 3 384 K red
* dwarf 15 times its radius. Five of the 63 folds are of this kind, GJ 9490C, Gl 225.2C, 69 Tau Oph
* A and HD 65277 (Gl 293.1A) the others; each HYG star SIMBAD puts elsewhere loses its entry,
* having no source of its own on the map to carry it.
*/
export function foldByIdentity(stars: readonly StarRecord[], gaiaDesignationById: ReadonlyMap<number, string>): { stars: StarRecord[]; folded: number } {
const byDesignation = new Map<string, number>();
@@ -327,8 +337,12 @@ export function foldByIdentity(stars: readonly StarRecord[], gaiaDesignationById
if (target === undefined || !foldsInto(result[target], star)) {
return;
}
const describer = gaiaDesignationById.get(result[target].id);
const { magnitude, magnitudeBand, colorIndex, colorSystem } = result[target];
result[target] = { ...combine(result[target], star), magnitude, magnitudeBand, colorIndex, colorSystem };
result[target] =
describer !== undefined && describer !== designation
? combine(result[target], star, star)
: { ...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.
byDesignation.delete(designation!);
folded.add(index);
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.