Skip to content

Improves pure-Python ECI/ECEF accuracy#105

Open
ryanpavlick wants to merge 2 commits intogeospace-code:mainfrom
ryanpavlick:improve-pure-python-eci-ecef-accuracy
Open

Improves pure-Python ECI/ECEF accuracy#105
ryanpavlick wants to merge 2 commits intogeospace-code:mainfrom
ryanpavlick:improve-pure-python-eci-ecef-accuracy

Conversation

@ryanpavlick
Copy link
Copy Markdown
Contributor

Summary

Improves the non-AstroPy ECI/ECEF path by replacing the old single sidereal-rotation fallback with a more complete Earth-orientation model.

What changed

  • adds an internal Earth-orientation helper module for:
    • UTC normalization
    • embedded leap-second handling
    • UTC->TT conversion
    • optional UT1-UTC support
    • precession, nutation, apparent sidereal time, and polar motion
  • upgrades the pure-Python eci2ecef() / ecef2eci() fallback to use that model
  • threads optional delta_ut1, xp, and yp through higher-level wrappers
  • improves sidereal-time handling in the pure-Python path
  • tightens ECI/ECEF test expectations to reflect the new accuracy
  • adds an EOP roundtrip test

Accuracy and performance

On the existing sample case, the pure-Python fallback error drops from kilometer-scale to meter-scale relative to Astropy.

This does make the fallback slower than before because it now computes leap-second handling, TT/UT1-related quantities, precession, nutation, sidereal rotation, and optional polar motion instead of a single sidereal rotation.

On local benchmarks for the pure-Python fallback:

  • scalar eci2ecef() calls were about 12.6x slower
  • a 1000-point same-epoch vector case was about 3.0x slower

The tradeoff here is intentionally accuracy over raw speed for the non-AstroPy path.

Testing

All tests pass. Adds a new EOP roundtrip test and tightens existing ECI/ECEF fallback tests.

…ipsoid and some additional functions in nvector.py; along with associated tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant