Repository navigation
fix: normalize ephemeris reference frames at backend boundaries - #127
Merged
Merged
Conversation
|
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
Prepare Siderust v0.18.0 with backend-independent physical frame semantics: the same
Position<Center, Frame, Unit>describes the same axes and origin regardless of how its numbers were calculated. Fixes #126.Scientific root cause
Raw VSOP87A/E and post-Laskar ELP82B positions were labeled as the IAU 2006 canonical ecliptic without completing their native-frame ties. Their published native→FK5 matrices differ. Modern DE SPICE
J2000data are ICRF-realized, not classical FK5/EME2000.Preserve the verified chains:
C * H * Vfor VSOP andC * H * Lafter the existing Laskar step for ELP.Cis SOFA/ERFAecm06at J2000;His the fixed J2000fk5hiporientation, without catalogue spin. No matrices were refitted or inferred from DE residuals. Positions and analytical velocities use the same static rotation. ELP now evaluates its documented TDB argument from TT input.References: IMCCE VSOP conventions, Bretagnon & Francou 1988, ELP82B notice §§8–9, ERFA ecm06/fk5hip, and NAIF frame conventions/lunar frames.
Implementation
CenterShiftProvider::try_shiftthe implementation path. A narrowtry_to_center_withentry point handles standard-center positions; reverse/composed shifts propagateCenterShiftErrorand its original cause. Existing infallible transforms delegate to that path. Explicit nutation selection is preserved and regression-tested.DynEphemerisandPlanetStatekeep their existing scope.parse_bsprejects duplicate fundamental targets that its single-segment result cannot represent; use the stacked loaders for overlapping coverage.IAU_MOONits distinctMoonIauMeanEarthidentity.MoonPrincipalAxeshas no invented analytical orientation.API and compatibility
Breaking changes for 0.18.0:
try_shift -> Result.shift,to_center*and combinedto*conveniences remain documented panic-on-error APIs; usetry_shift/try_to_center_withto handle capability and coverage failures.try_pluto_barycentric; overriding only the infallible wrapper does not supply a transform. Unsupported Pluto is identified by physical center ID 999.MoonIauMeanEarth. Actual principal-axes data require appropriate binary PCK/FK data and must not be relabeled.Analytical numeric outputs change; downstream snapshots need updating. Coordinate/FFI layouts remain unchanged, and the FFI version reports 1800. Serde still stores components/center parameters without a frame discriminator: callers must preserve provenance. Python companion #21 handles the string alias; it must adopt the released 0.18 core separately to inherit normalization. No external repository was modified in this finalization.
Scientific validation
Permanent Cargo tests retain independent IMCCE A/E states (four bodies, multiple epochs), original-coefficient span-endpoint evaluations, all five published ELP Table H vectors, independent ERFA basis/handedness checks, position/velocity tests and lunar compile-fail checks. Expected values were not regenerated from Siderust. Fixture metadata records authoritative sources, units, time conventions and precision.
Center-matched comparisons only: Earth is
399relative to Sun10; Moon is301relative to Earth399. Earlier Mercury/Mars/Neptune residuals against system-barycenter IDs1/4/8are removed from the conclusions. No missing planet-center offset is silently replaced with a system barycenter.Illustrative J2000 orientation-only effects, holding epoch arguments fixed:
ELP's separate TT→TDB effect is about 0.08 m at J2000. These are model residuals, not accuracy guarantees. The empirical historical/FK5 tie retains uncertainty; it is not an exact recovered DE200→DE440 alignment. The coarse element catalogue/abbreviated Pluto series still lack a precision realization tie, and arbitrary frame-ID-1 provenance must come from the producer.
An explicitly ignored external-kernel test checks Sun/Earth/Moon states and Earth velocity at 1900/J2000/2026/2100 against CSPICE N0067 plus independent ERFA: 1 mm position and 1e-7 km/day velocity tolerances. It has been executed successfully with the official DE440s kernel. Normal scientific reference tests need only Cargo.
Tests and CI
cargo fmt --all -- --check: passed.cargo clippy --workspace --all-features --all-targets -- -D warnings: passed.cargo test --workspace --all-features: 2,055 unit/integration tests + 322 doctests passed, zero failures; two external-kernel tests, one hash-printing developer helper and 33 documentation examples ignored as declared. The DE440s test passed separately; the unchanged lunar external parity test requires its five original NAIF kernels.cargo test --workspace --doc --all-features: 322 passed, zero failures, 33 declared ignores.thumbv7em-none-eabihfno-default andserde,atmospherechecks: passed.cdae832: 14 successful checks, including the full feature matrix, doctests, embedded no_std checks and coverage gates. Siderust CI and release metadata validation passed; publication and GitHub Release jobs were correctly skipped on this PR.Repository cleanup
Remove the validation-only Rust example, auxiliary Python generator, comparison CSV and standalone report. Consolidate permanent conventions in Frames and centers; retain the Rust tests and independent fixtures with their provenance. Correct outdated Keplerian/backend, IAU 1976/1980, GCRS and lunar-alias descriptions. No new dependencies or academic-paper changes.
Release preparation
Root and FFI manifests, internal dependency, lockfile, ABI version, citation metadata, installation snippets and the undated changelog entry are prepared for v0.18.0. No tag, merge, publication or release has been created.