odm#
Orbit Data Messages (CCSDS 502.0-B-3).
Parse and manipulate Orbit Ephemeris Messages (OEM) and Orbit Parameter Messages (OPM) in KVN format. Supports multi-segment files, optional acceleration data, and Lagrange polynomial interpolation for position queries at arbitrary times.
Installation#
Install with opam:
$ opam install odm
If opam cannot find the package, it may not yet be released in the public
opam-repository. Add the overlay repository, then install it:
$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install odm
Usage#
let report path =
match Odm.of_kvn_file path with
| Ok oem ->
List.iter
(fun seg ->
let start, stop = Odm.epoch_range seg in
Fmt.pr "Segment: %s to %s (%d points)@." start stop
(Array.length (Odm.state_vectors seg)))
(Odm.segments oem)
| Error e -> Fmt.epr "%a@." Odm.pp_error e
(* Interpolate position at a given time. *)
let position_at ~segment ~unix_timestamp =
Odm.interpolate segment unix_timestamp
API Overview#
type t-- Complete OEM file: header + segment listtype segment-- Metadata, state vectors, and commentstype state_vector-- Epoch, position (km), velocity (km/s), optional accelerationtype metadata-- Object name/ID, reference frame, time system, interpolation infoof_kvn_string,of_kvn_channel,of_kvn_file-- Parse KVN formatsegments,state_vectors,epoch_range-- Accessorsinterpolate-- Lagrange polynomial interpolation within a segmentposition_at-- Search all segments and interpolate at a given time
Testing#
- Upstream vectors: bradsease/oem test suite (valid + invalid OEM samples)
- GMAT interop: 24 tests against NASA GMAT R2026a high-fidelity propagation traces (LEO, GEO, Molniya). Validates parser robustness on real-world scientific notation (1e-16 exponents), 5 orders of magnitude range, trailing whitespace, and orbital mechanics constraints (energy conservation, vis-viva). See
test/interop/gmat/.
License#
ISC