Skip to main content

Module omm

Module omm 

Source
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 JSON EPOCH) 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.
OmmInputErrorKind
OMM boundary-validation failure category.

Functions§

encode_csv
Encode Omm records as compact GP CSV.
encode_json
Encode an Omm as a CCSDS/CelesTrak OMM JSON object.
encode_json_array
Encode a slice of Omm records as a GP JSON array.
encode_kvn
Encode an Omm as a CCSDS OMM KVN message.
encode_xml
Encode an Omm as a CCSDS OMM XML message, following the CelesTrak/ndm document layout. Numeric values use their shortest round-tripping form and text values are XML-escaped, so parsing the output reproduces the same Omm.
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 Omm values.
parse_epoch
Parse a single CCSDS EPOCH string field to the canonical OmmEpoch.
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 an Omm.
parse_xml
Parse a CCSDS OMM in XML encoding into an Omm.