Expand description
CCSDS Orbit Mean-Elements Message (OMM) parser, encoder, and SGP4 bridge.
OMM (CCSDS 502.0-B) is the modern replacement for the TLE: it carries the
same SGP4/SDP4 mean elements (mean motion, eccentricity, inclination, RAAN,
argument of perigee, mean anomaly, B*, epoch, …) plus richer metadata
(object name, NORAD id, reference frame, time system, element-set theory).
CelesTrak and Space-Track serve general-perturbations (GP) data as OMM in
three interchangeable encodings: KVN (KEY = VALUE lines), XML, and JSON.
This module follows the format-agnostic design used on the Elixir side: a
single canonical container (Omm) holds the CCSDS field set as plain data
with documented units, and the per-encoding readers/writers map onto it. The
element values flow into the validated SGP4 path through Omm::to_element_set
(consumed by Satellite::from_elements) so an OMM drives SGP4 without
downgrading its full epoch into the legacy TLE year/day representation.
§TLE-derived field quantization
An OMM carries a full UTC calendar EPOCH, which is converted directly to
SGP4’s split Julian date. B* and the second mean-motion derivative are still
TLE-derived GP parameters:
- B* and the second mean-motion derivative. A TLE stores these in its
“assumed decimal” field (five significant mantissa digits and a power-of-ten
exponent), and that quantized value is what SGP4 actually receives. OMM
prints the same quantities as plain decimals, so the bridge re-quantizes
them onto the assumed-decimal grid via
crate::astro::tle.
Structs§
- Omm
- Canonical, format-agnostic OMM container.
- OmmArray
- The result of parsing a CelesTrak OMM JSON array: every OMM that parsed, plus a count of array elements that were skipped.
- OmmEpoch
- UTC calendar epoch as carried by an OMM, split into the components a KVN/XML
EPOCH(or JSONEPOCH) string spells out. Stored as integers so the epoch re-encodes losslessly and converts directly to the SGP4 epoch.
Enums§
- OmmError
- Failure modes of the OMM readers.
- OmmInput
Error Kind - OMM boundary-validation failure category.
Functions§
- encode_
csv - Encode
Ommrecords as compact GP CSV. - encode_
json - Encode an
Ommas a CCSDS/CelesTrak OMM JSON object. - encode_
json_ array - Encode a slice of
Ommrecords as a GP JSON array. - encode_
kvn - Encode an
Ommas a CCSDS OMM KVN message. - encode_
xml - Encode an
Ommas a CCSDS OMM XML message, following the CelesTrak/ndmdocument layout. Numeric values use their shortest round-tripping form and text values are XML-escaped, so parsing the output reproduces the sameOmm. - parse
- Parse an OMM in any supported encoding, detecting it from the leading
non-whitespace character and first content line:
<is XML,{or[is JSON, a comma-separated header is CSV, and anything else is KVN. - parse_
csv - Parse the first valid GP CSV record into an
Omm. - parse_
csv_ array - Parse all valid GP CSV records into
Ommvalues. - parse_
epoch - Parse a single CCSDS
EPOCHstring field to the canonicalOmmEpoch. - parse_
json - Parse a CCSDS/CelesTrak OMM in JSON encoding into an
Omm. - parse_
json_ array - Parse a CelesTrak OMM JSON array into every contained
Omm. - parse_
kvn - Parse a CCSDS OMM in KVN (
KEY = VALUE) encoding into anOmm. - parse_
xml - Parse a CCSDS OMM in XML encoding into an
Omm.