Repository navigation
feat(astro): integrate numerical propagation on TT, drag on UT1/UTC, and fix SSR civil dates - #110
Merged
Merged
Conversation
…and fix SSR civil dates 1. Numerical propagation on TT: StatePropagator (propagate_to*, ephemeris*, STM, propagate_covariance*, propagate_state_with_covariance*, PropagationConfig, and estimate_decay*) now integrates with elapsed TT as the independent variable, sharing the TT/TDB epoch mapping and RK4/DP54 integrator loop with propagate_variational (0-ULP agreement on the same TT grid). Public signatures remain absolute TDB seconds past J2000; elapsed TT is formed as (target - initial_tdb) - (tdb_minus_tt(tt_target) - tdb_minus_tt(tt_initial)) in TtEpochMap (shared with VariationalEpoch::from_tdb_seconds and multi-segment propagate_covariance*, which anchors one mapping at the initial epoch so node states match ephemeris* bit for bit), and each force receives the absolute TDB epoch rebuilt from elapsed TT. DP54 dense output folds accepted steps shorter than half a TDB ULP into the surrounding segment so no zero-length TDB segment is emitted and DenseSegment::eval / DenseOutput::eval return the post-step state at every endpoint. 2. Drag time scales and context APIs: DragForce and SourcedDragForce now take Earth orientation on UT1 from the PropagationContext EarthOrientationProvider, defaulting to TdbEarthOrientationProvider::new() in ValidityMode::Permissive when no provider is attached (using long-term Delta T outside the embedded UT1 table and recording any departure in PropagationContext / PropagationResult::ut1_degraded, while a caller-supplied provider keeps its own validity mode), form GCRF atmosphere-relative velocity as v - omega x r from that orientation's Earth rotation vector, and derive NRLMSISE-00 calendar inputs (with checked integer conversions) and space-weather lookups on UTC from the orientation's TimeScales. Add estimate_decay_with_context, estimate_decay_with_source_and_context, StatePropagator::propagate_covariance_with_context, and StatePropagator::propagate_state_with_covariance_with_context. 3. SSR civil date: civil_fields_from_j2000_gpst now delegates to civil_fields_from_j2000_seconds with checked u8::try_from conversions, rejecting 2^63 and out-of-range epochs cleanly.
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.
Moves numerical propagation onto TT, takes drag's Earth orientation on UT1 and its atmosphere calendar on UTC, and closes a saturating cast in the SSR civil-date conversion.
New public API (additive;
cargo semver-checksagainst main reports no semver update required):estimate_decay_with_context,estimate_decay_with_source_and_context,StatePropagator::propagate_covariance_with_context,StatePropagator::propagate_state_with_covariance_with_context.Numerical propagation on TT
StatePropagatorand everything it drives integrate with elapsed TT as the independent variable, as Orekit does and aspropagate_variationalalready did. That coverspropagate_to*,ephemeris*, the STM methods, covariance,PropagationConfigandestimate_decay*. Both propagators share one TT/TDB epoch mapping and one RK4/DP54 loop, and agree bit for bit on the same TT grid.Public epochs stay absolute TDB seconds. Elapsed TT is
(target - initial) - (TDB-TT at target - TDB-TT at initial), so no rounded absolute TT value is subtracted (error below 1e-13 s).DP54 dense output folds a step shorter than one TDB ULP into the neighbouring segment, so evaluating at an endpoint always returns the post-step state.
Multi-segment covariance shares one TT anchor, and its node states equal
ephemerisbit for bit.Pinned values that moved, each by its TT-vs-TDB elapsed difference (3.33e-10 of the elapsed time):
The Python
numerical_propagation.jsonfixture regenerates in the next release train.Drag
v - omega x rwith that rotation vector.PropagationResult::ut1_degraded, so decay estimates past mid-2027 keep working. A caller-supplied provider keeps its own validity mode.SSR civil date:
civil_fields_from_j2000_gpstnow goes through the checked civil-date helper, so 2^63 and out-of-range epochs returnNoneinstead of reaching a saturating cast.The Orekit oracles are unchanged, including the orbit-determination comparison with
BatchLSEstimator. Skyfield- and C-reference-matched outputs are unchanged.All seven local gates pass (fmt, clippy with and without default features, doctests, MSRV 1.89 check, nextest, fuzz check).