aem#
CCSDS 504.0-B Attitude Ephemeris Message parser and serializer.
Parses the KVN (Keyword=Value Notation) text format for attitude ephemeris data. Supports quaternion (scalar-last) and Euler angle attitude representations, with time-tagged attitude data points organized in segments.
Reference: CCSDS 504.0-B-2 Attitude Data Messages.
Installation#
Install with opam:
$ opam install aem
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 aem
Usage#
let dump kvn_text =
match Aem.of_string kvn_text with
| Ok aem ->
Printf.printf "Object: %s\n"
(List.hd aem.segments).metadata.object_name;
let seg = List.hd aem.segments in
let att = seg.data.(0) in
(match att.attitude with
| Aem.Quaternion q ->
Printf.printf "Quaternion: (%.6f, %.6f, %.6f, %.6f)\n"
q.q1 q.q2 q.q3 q.qc
| Aem.Euler e ->
Printf.printf "Euler: (%.6f, %.6f, %.6f)\n"
e.angle_1 e.angle_2 e.angle_3)
| Error e -> Fmt.epr "%a\n" Aem.pp_error e
API Overview#
type t-- Complete AEM file: header + segment listtype segment-- Metadata + array of attitude data pointstype attitude_data-- Epoch + quaternion or Euler anglesof_string,of_channel,of_file-- Parse KVN formatto_string-- Serialize back to KVN format
License#
ISC