Orbit Data Messages (CCSDS 502.0-B-3)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 2.6%
Shell 0.1%
Dune 0.1%
Other 97.4%
41 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-odm https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-odm
git@git.recoil.org:gazagnaire.org/ocaml-odm git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-odm

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

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 list
  • type segment -- Metadata, state vectors, and comments
  • type state_vector -- Epoch, position (km), velocity (km/s), optional acceleration
  • type metadata -- Object name/ID, reference frame, time system, interpolation info
  • of_kvn_string, of_kvn_channel, of_kvn_file -- Parse KVN format
  • segments, state_vectors, epoch_range -- Accessors
  • interpolate -- Lagrange polynomial interpolation within a segment
  • position_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