CCSDS 502.0-B-3 Orbit Ephemeris Message parser and interpolator
0
fork

Configure Feed

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

OCaml 64.8%
Java 16.9%
Shell 1.4%
Dune 0.9%
Other 16.0%
30 1 0

Clone this repository

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

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

Download tar.gz
README.md

oem#

CCSDS 502.0-B-3 Orbit Ephemeris Message parser and interpolator.

Parses the KVN (Keyword=Value Notation) text format for orbit ephemeris data. Provides Hermite interpolation between state vectors for smooth position queries at arbitrary times.

Installation#

Install with opam:

$ opam install oem

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 oem

Usage#

let report ~path ~at =
  match Oem.of_file path with
  | Error e -> Fmt.epr "%a@." Oem.pp_error e
  | Ok oem ->
      Fmt.pr "Object: %s@." (Oem.object_name oem);
      let start, stop = Oem.time_range oem in
      Fmt.pr "Range: %a -> %a@." Ptime.pp start Ptime.pp stop;
      (* Interpolate at a specific time. *)
      (match Oem.interpolate_all oem at with
      | Some sv -> Fmt.pr "Position: %a@." Vec3.pp sv.pos
      | None -> Fmt.pr "Time out of range@.")

API Overview#

  • type t -- Complete OEM file: header + segment list
  • type segment -- Metadata, state vector array, optional covariance list
  • type state_vector -- epoch : Ptime.t, pos : vec3, vel : vec3
  • type covariance -- Epoch, reference frame, upper-triangle matrix (21 elements)
  • of_string, of_channel, of_file -- Parse KVN format
  • interpolate -- Hermite interpolation within a segment
  • interpolate_all -- Search all segments and interpolate
  • time_range -- Start/stop time spanning all segments
  • object_name, object_id -- Accessors

License#

ISC