Fold a Gliese star into the Gaia source SIMBAD names it as, so none is drawn twice or inside 10 pc by mistake
HYG's Gliese-only rows, with no Hipparcos astrometry and no published error on their distance, reach the merge with positions off by up to minutes of arc, photometric distances and sometimes wrong proper motions, and isSameStar's geometry missed 49 of them beside their own Gaia entry. 43 lie within 25 pc and 27 are fainter than V 12, the layer the brief asked to merge without duplicates. GJ 3478 is 16.3" from its Gaia entry, past the 15" tolerance; GJ 2097 moves 39 % differently by HYG's motion; GJ 4285 is co-moving but 1.6 magnitudes brighter in HYG's V than Gaia's G. Two of them were false stars inside 10 pc: GJ 2097 at 6.41 pc and GJ 4285 at 6.80, which Gaia measures at 24.47 and 28.25. HYG also put Gl 94 31.6 degrees from where it is, and HD 23585 and HD 23713, Pleiades members at 135 pc, at 20.6 and 22.2. 0e9ab6f's "no Gliese row within 25 pc has a co-moving bare Gaia entry 3-300" away" held only under its own motion rule. fetchStars now asks SIMBAD once, in one cached TAP query, for the Gaia DR3 designation of every object it knows by a GJ number (4 868), maps HYG's `gl` column onto it, and foldByIdentity folds each Gliese-only row into the bare Gaia entry of that source: HYG's name, type and photometry, Gaia's position and distance, as combine does for any other pair. An ETL run from cache folds 49: 455 571 stars become 455 522, the stars within 10 pc 369 become 367, within 25 pc 5 522 become 5 479, HYG rows without a Gaia counterpart 11 517 become 11 468, distances with no published error 395 become 346. exoplanets.json is unchanged. In the running app GJ 2097 reads "24 pc, HYG, Gaia DR3 distance", GJ 4285 28 pc, Gl 94 17 pc, and 367 stars lie within 10 pc. validateMerge now refuses any Gliese-only row beside the bare Gaia entry SIMBAD names as the same star. Controls: folding with an empty identity map fails the ETL with "49 Gliese stars are drawn beside the Gaia source SIMBAD names them as, starting with GJ 1033" (the baseline passed); in the unit suite, folding a row with a Hipparcos error fails "leaves a star with a Hipparcos error, and a Gaia entry already folded into, alone", and keeping the Gliese position fails "folds a Gliese entry into the Gaia entry SIMBAD names it as, at Gaia's position and distance". HYG's V is kept for a folded star, which for GJ 3207 is the wrong one (11.51 where SIMBAD has 13.75). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+27
-2
@@ -1,10 +1,11 @@
|
||||
import { writeFileSync } from 'node:fs';
|
||||
|
||||
import { hipparcosDistancePc, mergeStarCatalogues, placementDistancePc } from '../../src/app/shared/astro/star-merge';
|
||||
import { foldByIdentity, hipparcosDistancePc, mergeStarCatalogues, placementDistancePc } from '../../src/app/shared/astro/star-merge';
|
||||
import { encodeStarCatalog } from '../../src/app/shared/models/star-catalog';
|
||||
import { StarRecord, SUN_STAR_ID } from '../../src/app/shared/models/star.model';
|
||||
import { fetchGaiaDistancesByHip, fetchHipparcosParallaxErrors, GaiaAnswerError } from './sources/gaia';
|
||||
import { positionalSources } from './sources/registry';
|
||||
import { fetchGaiaDesignationsByGj } from './sources/simbad';
|
||||
import { PARALLAX_PRECISION_MAS } from './sources/star-sources';
|
||||
import { parseCsvObjects, parseOptionalNumber } from './lib/csv';
|
||||
import { fetchTextCached } from './lib/http';
|
||||
@@ -163,11 +164,35 @@ export async function fetchStars(): Promise<StarRecord[]> {
|
||||
|
||||
console.log(` kept ${stars.length} stars (of ${rows.length} in the catalog): ${atGaiaDistance} at Gaia's distance, ${pastCutoff} of them past ${DISTANCE_CUTOFF_PC} pc.`);
|
||||
|
||||
const merged = await mergeWithOtherSources(stars);
|
||||
const { stars: merged, folded } = foldByIdentity(await mergeWithOtherSources(stars), await glieseGaiaDesignations(rows));
|
||||
console.log(` ${folded} Gliese entries folded into the Gaia source SIMBAD names them as.`);
|
||||
merged.sort((a, b) => a.id - b.id);
|
||||
return merged;
|
||||
}
|
||||
|
||||
/** HYG's Gliese designation as SIMBAD writes it: "Gl 734B" is "GJ 734 B". */
|
||||
function simbadGliese(gl: string): string {
|
||||
return gl.trim().replace(/^Gl\s+/, 'GJ ').replace(/^(GJ \d+(?:\.\d+)?)\s*([A-Z]+)$/, '$1 $2');
|
||||
}
|
||||
|
||||
/**
|
||||
* The Gaia DR3 designation SIMBAD gives each HYG star with a Gliese number, by HYG id: what the
|
||||
* merge folds its Gliese-only rows by, and what build.ts checks it did. `rows` are HYG's, read
|
||||
* again from the cache when not given.
|
||||
*/
|
||||
export async function glieseGaiaDesignations(rows?: Record<string, string>[]): Promise<Map<number, string>> {
|
||||
const hyg = rows ?? parseCsvObjects(await fetchTextCached(HYG_CSV_URL, 'hygdata_v41.csv'));
|
||||
const byGj = await fetchGaiaDesignationsByGj();
|
||||
const designations = new Map<number, string>();
|
||||
for (const row of hyg) {
|
||||
const designation = row['gl'] ? byGj.get(simbadGliese(row['gl'])) : undefined;
|
||||
if (designation) {
|
||||
designations.set(Number(row['id']), designation);
|
||||
}
|
||||
}
|
||||
return designations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unions HYG with every other positional source that is wired in and reachable.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user