Orekit fixture generation #16

Closed
opened 2026-09-30 11:08:03 -04:00 by connor · 3 comments
Owner

A committed, rerunnable script producing reference trajectories and observations. Fixtures land under tests/fixtures/ with Orekit version, force-model configuration and generation date recorded.

Needs a JVM installed; there is none on mainframe yet.

M1.

A committed, rerunnable script producing reference trajectories and observations. Fixtures land under `tests/fixtures/` with Orekit version, force-model configuration and generation date recorded. Needs a JVM installed; there is none on mainframe yet. M1.
connor added this to the M1 milestone 2026-09-30 11:24:57 -04:00
connor added the size/L label 2026-09-30 11:24:57 -04:00
Author
Owner

The gravity field has to be pinned by model, not by degree. Found while sourcing coefficients for #8: two fully normalized coefficient sets, both nominally Earth gravity and both usable to the same degree, differed by 1e-4 to 1e-3 relative throughout, with C(2,0) differing by 8e-6. That is about 1.6 m/day of along-track at LEO — the order of the agreement target itself.

So a fixture generated against "EGM96 to degree 70" and compared against a field that is some other model to degree 70 would fail by roughly the tolerance, with nothing in the record to say why. For a generation run, record the model's identity and not just its truncation: the file the coefficients came from, its digest, its stated GM and reference radius, and the degree and order actually used on each side.

The reference radius is the easiest of those to get wrong, because it looks like a body constant and is not. EGM96's is 6378136.3 m against WGS84's 6378137.0 m, and the expansion is defined against the field's own value.

**The gravity field has to be pinned by model, not by degree.** Found while sourcing coefficients for #8: two fully normalized coefficient sets, both nominally Earth gravity and both usable to the same degree, differed by 1e-4 to 1e-3 relative throughout, with `C(2,0)` differing by 8e-6. That is about 1.6 m/day of along-track at LEO — the order of the agreement target itself. So a fixture generated against "EGM96 to degree 70" and compared against a field that is some other model to degree 70 would fail by roughly the tolerance, with nothing in the record to say why. For a generation run, record the model's identity and not just its truncation: the file the coefficients came from, its digest, its stated `GM` and reference radius, and the degree and order actually used on each side. The reference radius is the easiest of those to get wrong, because it looks like a body constant and is not. EGM96's is 6378136.3 m against WGS84's 6378137.0 m, and the expansion is defined against the field's own value.
Author
Owner

scripts/generate-orekit-fixtures.sh and scripts/generate-nyx-fixtures.sh. Both fetch at pinned digests, compile a driver, run it and throw the sources away; what is committed is numbers. Each fixture records the tool, its version, the generation date and the force model in that tool's own vocabulary. A second reference was added beyond what this issue asked for, because nyx reads the same ANISE kernels this crate does and so removes the frame difference that limits the Orekit comparison.

Eleven fixtures: point mass, EGM96 8x8 and 20x20, Sun and Moon, radiation pressure, and NRLMSISE-00 drag, against each tool where applicable.

The matching is most of the work, and tests/common/mod.rs lists what has to agree before a number means anything. Worth recording:

  • Orekit is given the very EGM96 file this crate generates its own coefficients from. nyx parses that format directly; Orekit needs the record separators inserted, and nyx needs the POTFIELD header split. Same file, same digest, each tool a different small repair.
  • Asking Orekit for GCRF rather than EME2000 was worth 7x: the terrestrial frame was never the problem, the 23 mas frame bias was.
  • nyx's mu is overridden from the kernel's DE440 value to EGM96's, which is what this crate's Earth carries.
  • The nyx fixtures sample nyx's own accepted integrator steps rather than a time grid, because its trajectory interpolation is a five-point Hermite fitted after the fact and is its accuracy floor: 2.7e-6 m at the stored states against 8.1e-4 m read on a 60 s grid.

Two things on this list are not done, and are the reason this is not finished:

  1. Observations. The issue asks for them and the fixture format has no place for them yet.
  2. A faceted spacecraft, which is blocked by #30: this crate's faceted surface applies the force along the Sun line while Orekit's box-wing puts a component along each face normal. No configuration makes those agree.

Harris-Priester fixtures were generated and then deliberately removed. This crate departs from the published interpolation on purpose, so a comparison measured that choice rather than correctness; and nyx turned out to carry a different table entirely, coarser and with the maximum-density column running from 0.87x this crate's at 160 km to 0.53x at 680 km.

`scripts/generate-orekit-fixtures.sh` and `scripts/generate-nyx-fixtures.sh`. Both fetch at pinned digests, compile a driver, run it and throw the sources away; what is committed is numbers. Each fixture records the tool, its version, the generation date and the force model in that tool's own vocabulary. A second reference was added beyond what this issue asked for, because nyx reads the same ANISE kernels this crate does and so removes the frame difference that limits the Orekit comparison. Eleven fixtures: point mass, EGM96 8x8 and 20x20, Sun and Moon, radiation pressure, and NRLMSISE-00 drag, against each tool where applicable. **The matching is most of the work**, and `tests/common/mod.rs` lists what has to agree before a number means anything. Worth recording: - Orekit is given the very EGM96 file this crate generates its own coefficients from. nyx parses that format directly; Orekit needs the record separators inserted, and nyx needs the `POTFIELD` header split. Same file, same digest, each tool a different small repair. - Asking Orekit for GCRF rather than EME2000 was worth 7x: the terrestrial frame was never the problem, the 23 mas frame bias was. - nyx's `mu` is overridden from the kernel's DE440 value to EGM96's, which is what this crate's Earth carries. - The nyx fixtures sample nyx's own accepted integrator steps rather than a time grid, because its trajectory interpolation is a five-point Hermite fitted after the fact and is its accuracy floor: 2.7e-6 m at the stored states against 8.1e-4 m read on a 60 s grid. **Two things on this list are not done**, and are the reason this is not finished: 1. **Observations.** The issue asks for them and the fixture format has no place for them yet. 2. **A faceted spacecraft**, which is blocked by #30: this crate's faceted surface applies the force along the Sun line while Orekit's box-wing puts a component along each face normal. No configuration makes those agree. Harris-Priester fixtures were generated and then **deliberately removed**. This crate departs from the published interpolation on purpose, so a comparison measured that choice rather than correctness; and nyx turned out to carry a different table entirely, coarser and with the maximum-density column running from 0.87x this crate's at 160 km to 0.53x at 680 km.
Author
Owner

Closing with the two remaining items deferred to #36, by Connor's call 2026-10-03: what is here is accepted for M1.

Observations are deliberately not done, not merely unfinished. His judgment: validating the measurement models against another tool is overkill. The geometry is simple, it is covered by unit tests, and an identity test is a better check of it than a cross-tool comparison would be. Recorded on #36 so the decision stays visible.

The faceted fixture stays blocked by #30 and is listed there too.

Closing with the two remaining items deferred to #36, by Connor's call 2026-10-03: what is here is accepted for M1. **Observations are deliberately not done**, not merely unfinished. His judgment: validating the measurement models against another tool is overkill. The geometry is simple, it is covered by unit tests, and an identity test is a better check of it than a cross-tool comparison would be. Recorded on #36 so the decision stays visible. **The faceted fixture stays blocked by #30** and is listed there too.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: connor/astrokit#16