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:
+17
-4
@@ -8,7 +8,7 @@ import { fetchDeepSky } from './fetchDeepSky';
|
||||
import { fetchExoplanets } from './fetchExoplanets';
|
||||
import { fetchSolarSystem } from './fetchSolarSystem';
|
||||
import { BYTES_PER_STAR_META, BYTES_PER_STAR_POSITION, decodeStarCatalog, encodeStarCatalog, isDesignation } from '../../src/app/shared/models/star-catalog';
|
||||
import { fetchStars } from './fetchStars';
|
||||
import { fetchStars, glieseGaiaDesignations } from './fetchStars';
|
||||
import { ARCHIVE_EPOCH, archiveStarId, CATALOGUE_EPOCH } from '../../src/app/shared/astro/host-star-matching';
|
||||
import { propagateProperMotion, raDegDecDistanceToXyz } from '../../src/app/shared/astro/coordinates';
|
||||
import { describeSources } from './sources/registry';
|
||||
@@ -240,10 +240,17 @@ function validateStars(stars: StarRecord[]): void {
|
||||
* with a row floor on each query.
|
||||
*/
|
||||
const MAX_UNMERGED_TWINS = 100;
|
||||
/**
|
||||
* Gliese-only rows beside the Gaia entry SIMBAD names as the same star, which no geometry saw:
|
||||
* 49 before `foldByIdentity`, two of them false stars inside 10 pc (GJ 2097 at 6.41 pc and GJ 4285
|
||||
* at 6.80, which Gaia has at 24.47 and 28.25). The twin count above does not see them, being up to
|
||||
* minutes of arc apart.
|
||||
*/
|
||||
const MAX_GLIESE_ROWS_BESIDE_THEIR_GAIA_SOURCE = 0;
|
||||
const MAX_HYG_SURVIVORS = 15_000;
|
||||
const TWIN_TOLERANCE_RAD = (1 / 3600) * (Math.PI / 180);
|
||||
|
||||
function validateMerge(stars: StarRecord[]): void {
|
||||
function validateMerge(stars: StarRecord[], gaiaDesignationById: ReadonlyMap<number, string>): void {
|
||||
// Checked first and on its own: an unreachable Gaia is skipped rather than thrown, and would
|
||||
// otherwise surface below as "68 000 HYG stars found no counterpart" — true, and no help.
|
||||
assertCondition(
|
||||
@@ -287,7 +294,13 @@ function validateMerge(stars: StarRecord[]): void {
|
||||
twins <= MAX_UNMERGED_TWINS,
|
||||
`${twins} stars from different catalogues sit within an arcsecond of each other (at most ${MAX_UNMERGED_TWINS} expected), starting with ${example} — the merge is keeping the same star twice.`
|
||||
);
|
||||
console.log(` ${survivors} HYG stars have no Gaia counterpart; ${twins} unmerged cross-catalogue pairs within an arcsecond.`);
|
||||
const bare = new Set(stars.filter((star) => star.source === 'gaia' && isDesignation(star)).map((star) => star.name));
|
||||
const beside = stars.filter((star) => star.source === 'hyg' && star.distanceError === undefined && bare.has(gaiaDesignationById.get(star.id) ?? ''));
|
||||
assertCondition(
|
||||
beside.length <= MAX_GLIESE_ROWS_BESIDE_THEIR_GAIA_SOURCE,
|
||||
`${beside.length} Gliese stars are drawn beside the Gaia source SIMBAD names them as, starting with ${beside[0]?.name} — the identity fold is not being made.`
|
||||
);
|
||||
console.log(` ${survivors} HYG stars have no Gaia counterpart; ${twins} unmerged cross-catalogue pairs within an arcsecond; ${beside.length} Gliese stars beside their own Gaia source.`);
|
||||
}
|
||||
|
||||
function validateBodies(bodies: BodyRecord[]): void {
|
||||
@@ -490,7 +503,7 @@ async function build(): Promise<void> {
|
||||
|
||||
console.log('Validating output...');
|
||||
validateStars(stars);
|
||||
validateMerge(stars);
|
||||
validateMerge(stars, await glieseGaiaDesignations());
|
||||
validateBodies(bodies);
|
||||
validateExoplanets(exoplanets, stars);
|
||||
validateDeepSky(deepSky);
|
||||
|
||||
Reference in New Issue
Block a user