sgp4: reject SGP4-XP element sets (ephemeris type 4) with a clear error - #174
Open
ssmichael1 wants to merge 1 commit into
Open
sgp4: reject SGP4-XP element sets (ephemeris type 4) with a clear error#174ssmichael1 wants to merge 1 commit into
ssmichael1 wants to merge 1 commit into
Conversation
An SGP4-XP line 1 stores agom and a B term in the columns a classic TLE uses for nddot and B*. satkit parsed those as nddot/bstar and ran classic SGP4 on them, returning a plausible but wrong state. The TLE and OMM SGP4 sources now return an UnsupportedEphemerisType error for type 4; parsing is unchanged so mixed catalogs still load. The Python dict-to-OMM converter never copied EPHEMERIS_TYPE, so the guard could not see it from that path; it now carries the field through (top level and tleParameters, int or numeric string). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QpWfy5Nh7LVU531hD5Lkwv
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
sgp4()now refuses SGP4-XP element sets instead of silently propagating them, for TLE and OMM inputs, in Rust and Python.An SGP4-XP line 1 (ephemeris type 4, column 63) stores agom and a B term in the columns a classic TLE uses for nddot and B*. satkit parsed those as nddot/bstar and ran classic SGP4 on them, returning a plausible but wrong state.
Changes
tle::Error::UnsupportedEphemerisType(u8); theSGP4Sourceimpl returns it for type 4. Parsing is unchanged, so catalog files mixing types still load.EPHEMERIS_TYPE == 4with a matchingomm::Error::UnsupportedEphemerisType.omm_from_pydictnever copiedEPHEMERIS_TYPE, so the Rust guard could not see it. It now carries the field through (top level and nestedtleParameters, int or numeric string). Python raisesRuntimeErrormentioning SGP4-XP.ephem_type(Rust + stub), a paragraph in the SGP4 guide, changelog line.Not in scope: any SGP4-XP support. The reference implementation is distributed by USSF as Fortran binaries only; examined and dropped.
Tests
test_sgp4.py. Full suite minus GMAT: 169 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01QpWfy5Nh7LVU531hD5Lkwv