Commit Graph

1 Commits

Author SHA1 Message Date
Alexa Louise
7ea1bf8435 Add Truth Contracts - Fix Time/Frame/Datum Issues 🎯
CRITICAL FIXES FOR SCIENTIFIC ACCURACY (~700 lines):

Time Scale Handling:
- Explicit UTC/TAI/TT/TDB/UT1/GPS conversion
- 37 leap seconds table (current as of 2025)
- UTC→TT: +32.184s after accounting for leap seconds
- UTC→TDB: TT + periodic terms (barycentric time)
- UTC→UT1: Uses IERS EOP data (Earth rotation)
- No more time scale confusion!

Reference Frame Typing:
- ICRF_BARYCENTRIC (JPL ephemerides)
- HELIOCENTRIC_ECLIPTIC (planetary orbits)
- ECI (Earth-Centered Inertial, J2000)
- ECEF (Earth-Centered Earth-Fixed, WGS84)
- TOPOCENTRIC (observer alt/az)
- ECEF↔ECI uses GMST (Greenwich Mean Sidereal Time)
- Frame compatibility validation

Datum Corrections:
- WGS84 Prime Meridian ≠ Greenwich Observatory (~102m offset)
- Ellipsoidal height ≠ Orthometric height (MSL)
- Mount Everest: 8877.69m ellipsoidal vs 8848.86m MSL
- Geoid undulation: -106m to +85m globally
- EGM2008 geoid model support (simplified)

Truth Contract System:
- Every test MUST declare frame + time scale + datum
- Prevents apples-to-oranges comparison
- Typed like a programming language
- Contract validation enforced

Fixes The Two Common Failures:
1.  Time scale mismatch (UTC vs TDB) →  Explicit conversion
2.  Datum confusion (Everest height) →  Ellipsoidal height

This is the difference between 'looks right' and 'IS scientifically correct'

References:
- IERS leap second table (updated 2017-01-01)
- WGS84 corrected landmarks
- GMST formula (IAU 2000)
- Geoid model placeholder (use EGM2008 in production)
2025-12-21 22:54:51 -06:00