CCSDS 504.0-B Attitude Ephemeris Message parser and serializer
0
fork

Configure Feed

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

OCaml 92.9%
Dune 2.1%
Other 5.0%
14 1 0

Clone this repository

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

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

Download tar.gz
README.md

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 list
  • type segment -- Metadata + array of attitude data points
  • type attitude_data -- Epoch + quaternion or Euler angles
  • of_string, of_channel, of_file -- Parse KVN format
  • to_string -- Serialize back to KVN format

License#

ISC