Skip to main content

Module cdm

Module cdm 

Source
Expand description

CCSDS Conjunction Data Message (CDM) KVN and XML format reader and writer.

CDM (CCSDS 508.0-B-1) describes a predicted close approach between two space objects: the time of closest approach, miss geometry, collision probability, the per-object metadata block, and per-object state vectors with RTN position-and-velocity covariance. This module owns the language-independent grammar for both serializations:

  • KVN (Keyword=Value Notation): line tokenization, the KEY = VALUE [unit] split, trailing-unit stripping, the COMMENT HBR = convention, object-block segmentation, the leading-float value parser, the state/covariance extraction, and the KVN line layout used on encode.
  • XML: a real DOM parse via the roxmltree crate (which correctly handles the <?xml?> declaration, comments, namespaces, entity escaping, and encoding), then name-based leaf-element lookup over the document and the two <segment> subtrees for the same state/covariance extraction. Encoding emits the CCSDS document layout through a controlled serializer (see encode_xml).

Both run identically regardless of the calling language, so they live in the core.

Date/time fields cross this boundary as raw strings: resolving TCA / CREATION_DATE to a concrete instant (and formatting one back) is the host’s job using its native date/time type, exactly as the TLE epoch is handled. This module deliberately does not depend on the time-scale machinery, and applies no calendar validation; it only carries the textual value through.

Structs§

CdmKvn
A two-object conjunction parsed from a CDM message (KVN or XML). Date/time fields are the raw textual values; the host resolves them to its own instant type.
CdmObject
One object’s CCSDS metadata block, state vector, and RTN covariance. Every metadata field is the verbatim textual value (CCSDS enum fields such as OBJECT_TYPE and MANEUVERABLE are carried as strings); absent fields are None and are not emitted on encode.

Enums§

CdmError
Failure modes of parse_kvn. The message strings are the historical public contract surfaced by the Elixir binding.
CdmInputErrorKind
CDM boundary-validation failure category.

Functions§

encode_kvn
Encode a CdmKvn back to KVN text.
encode_xml
Encode a CdmKvn to a CCSDS 508.0-B-1 CDM XML document.
parse_kvn
Parse a CDM in KVN format.
parse_xml
Parse a CDM in XML format.