- OCaml 76%
- Java 22%
- Shell 2%
oem #
Orbit Ephemeris Message parser and interpolator (CCSDS 502.0-B-3).
Flight dynamics teams send each other a spacecraft's predicted trajectory as
an Orbit Ephemeris Message (OEM): a list of positions and velocities at
successive epochs, sometimes with covariances. This package reads the KVN
(keyword = value) text form of an OEM into typed records with Ptime.t
epochs. It can then give the state at any time between two samples, using a
cubic Hermite polynomial so that both position and velocity stay continuous.
The odm package has a second OEM parser, Odm.Oem, which splits the KVN
lines by hand; this one reads them through kvn. Nothing checks that the two
agree.
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 #
An OEM file is a t: a header and a list of segments. Each segment carries
its metadata, an array of state_vectors (epoch, pos and vel) and
optional covariances. A covariance holds an epoch, a reference frame and the
21 elements of the upper triangle of a 6x6 matrix.
of_string,of_channelandof_fileparse the KVN form.interpolateworks within one segment and returnsNoneoutside it.interpolate_alluses the first segment, in file order, that covers the requested time.time_rangeis the earliest start and latest stop over all segments.object_nameandobject_idcome from the first segment.
License #
ISC. See LICENSE.md.