opm#
CCSDS 502.0-B Orbit Parameter Message parser and serializer.
Parses the KVN (Keyword=Value Notation) text format for orbit parameter data. Supports both Cartesian state vectors and Keplerian orbital elements, with optional spacecraft parameters and maneuver definitions.
Reference: CCSDS 502.0-B-3 Orbit Data Messages, Annex (OPM).
Installation#
Install with opam:
$ opam install opm
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 opm
Usage#
let report kvn_text =
match Opm.of_string kvn_text with
| Error e -> Fmt.epr "%a@." Opm.pp_error e
| Ok opm -> (
Fmt.pr "Object: %s@." opm.metadata.object_name;
match opm.state with
| Opm.Cartesian sv ->
Fmt.pr "Position: (%.3f, %.3f, %.3f) km@." sv.x sv.y sv.z
| Opm.Keplerian ke ->
Fmt.pr "SMA: %.3f km, ecc: %.6f@." ke.semi_major_axis ke.eccentricity)
API Overview#
type t-- Complete OPM: header, metadata, state, optional maneuverstype state--Cartesianstate vector orKeplerianelementstype maneuver-- Epoch, duration, delta-V components, reference frameof_string,of_channel,of_file-- Parse KVN formatto_string-- Serialize back to KVN format
License#
ISC