Apply debiasing for obs80 catalog codes, not just names (Closes #409) - #410
Merged
Conversation
debias() looked the catalog up as an MPC_CATALOGS key (a name, e.g. "UCAC4"), but obs80 supplies the single-char code (a value, e.g. "q"). bias_dict is keyed by the code, so a code never resolved and debiasing silently no-op'd on all obs80 input -- including the bulk MPC archive the catalogue fit ingests. Use MPC_CATALOGS.get(catalog, catalog): a name maps to its code, a code passes through, and blank/None/unknown still fall through the `not in bias_dict` guard unchanged (preserving #401). Confirmed end-to-end: fitting with debias on vs off now differs (it was byte-identical before). Adds a regression test asserting a code (e.g. "p") applies the same correction as its name ("PPM") and actually changes the astrometry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
debias()silently applied no correction on obs80 input:Obs80DataReadersupplies the single-char catalog code (W,q, …), butdebias()looked the catalog up as anMPC_CATALOGSkey (a name likeUCAC4). Sincebias_dictis keyed by the code, a code never resolved → the guard returned the astrometry unchanged. So debiasing never fired on obs80 — including the bulk MPC archive the catalogue fit ingests.Fix
"UCAC4") → its code"q"→ inbias_dict✓ (unchanged behaviour for ADES-style input)"q") → passes through → inbias_dict✓ (obs80 now debiases)not in bias_dictguard unchanged ✓ (preserves debias() raises KeyError on blank/unknown star-catalog codes (crashes fits on real obs80 data) #401)Validation
End-to-end, fitting the same objects with
debias=Falsevsdebias=Truenow differs (it was byte-identical before the fix):Corrections are small (sub-arcsec), as expected — but they now actually apply, which the "faithful to JPL" weighting+debiasing story needs on obs80 data.
Tests
Adds a regression test asserting a code (
"p") yields the same correction as its name ("PPM") and actually changes the astrometry. All 8test_debiastests pass.Closes #409.
🤖 Generated with Claude Code