ommHandling

Read CCSDS Orbit Mean-Elements Message (OMM) general perturbations data and convert it to osculating classical orbital elements in the Basilisk inertial (J2000/ICRF) frame.

OMM supports NORAD catalog numbers of up to nine digits, removing the classic numeric TLE field’s five-digit restriction. The U.S. Space Force (USSF) assigns catalog numbers; CelesTrak distributes the data. This reader supports IDs through 999999999 and preserves them in OmmData.noradID, independently of SGP4’s internal identifier. See CelesTrak’s GP format documentation.

All four CelesTrak encodings are accepted and auto-detected: XML, JSON, CSV and KVN. The mean elements are handed to SGP4 exactly as tleHandling does for a TLE, so both paths produce osculating elements through the same propagation and frame conversion. Only the Earth-centered, TEME, UTC, SGP4 profile is supported.

class ommHandling.OmmData(oe: ClassicElements, ommEpoch: datetime, satName: str = 'BSK-Sat-00', noradID: str = '', objectID: str = '', classification: str = 'Unknown', revAtEpoch: int = 0, propagator: str = '0', elemSetNo: int = 999, meanMotion: float = 0.0, nDot: float = 0.0, nDotDot: float = 0.0, bStar: float = 0.0, centerName: str = 'EARTH', refFrame: str = 'TEME', meanElementTheory: str = 'SGP4', timeSystem: str = 'UTC')[source]

Bases: object

Hold the orbital elements and metadata of a single OMM record.

Mirrors Basilisk.utilities.tleHandling.TleData, with the OMM-only metadata added and the TLE-only line-format fields dropped.

noradID is empty when no catalog number is available.

nDot and nDotDot retain the supplied MEAN_MOTION_DOT and MEAN_MOTION_DDOT values without rescaling, in rev/day**2 and rev/day**3. CelesTrak GP data uses the TLE coefficient convention: one-half of the first physical derivative and one-sixth of the second physical derivative. Other producers’ conventions must be interpreted using their documentation. These coefficients are passed unchanged to the SGP4 initializer, which converts their units; SGP4 itself does not use them for propagation. See CelesTrak’s TLE field explanation.

ommHandling.satOmm2elem(omm_path: str) → list[source]

Convert the OMM records of a constellation to osculating orbital elements for each satellite.

The encoding (XML, JSON, CSV or KVN) is detected from the file contents. Catalog numbers, including nine-digit OMM IDs, are preserved in noradID without being constrained by SGP4’s internal identifier storage. Supplied values must be in [0, 999999999]; optional leading + signs and leading zeros are accepted and preserved. Missing, null or blank catalog numbers yield noradID="" without affecting orbital conversion. Each valid input record remains a separate result even when multiple records have no catalog number. Missing, null or blank international designators yield objectID="". Supplied designators, including the literal UNKNOWN, are preserved after trimming whitespace; backend identifier accommodations do not change this metadata. Mean-motion derivative fields retain the supplied coefficients without rescaling; see OmmData for CelesTrak’s TLE coefficient convention.

XML accepts unqualified elements and the urn:ccsds:schema:ndmxml namespace, using either prefixes or a default namespace. Records are read from omm/body/segment in a standalone OMM or a direct OMM child of an NDM container. Segments inside extensions or other message types are ignored. Consumed fields must appear in their owning metadata, mean-elements or TLE-parameters blocks. This placement check includes headers, bodies and recognized optional containers. Errors outside a segment invalidate all segments in that OMM message; errors within a segment invalidate only that record. Other OMM messages remain available. Misplaced fields or blocks directly under NDM are file-level errors. XML records containing misplaced or duplicate OMM fields or blocks are skipped with a warning before SGP4 is invoked. KVN and JSON records with duplicate consumed fields are also skipped, including names that collide after case normalization. Duplicate consumed CSV headers make the whole file ambiguous and raise ValueError before conversion. CSV accepts leading blank lines and quoted cells, including embedded newlines. Rows with missing or extra cells are skipped before optional defaults are applied; optional columns omitted from the header still receive their normal defaults.

Calendar-date and day-of-year epochs accept arbitrary fractional-second digits. Digits beyond microsecond precision are truncated consistently for ommEpoch, SGP4 initialization and propagation, and frame conversion.

Only Earth-centered, TEME, UTC, SGP4 records with ephemeris type 0 (CelesTrak default) or 2 (SGP4) are supported. JSON and CSV records may omit CENTER_NAME, REF_FRAME, TIME_SYSTEM, and MEAN_ELEMENT_THEORY; CelesTrak’s EARTH/TEME/UTC/SGP4 defaults then apply. XML and KVN require these fields explicitly. Empty or incompatible declarations cause the record to be skipped with a warning before SGP4 is invoked.

CelesTrak’s MEAN_ELEMENT_THEORY = SGP/SGP4 is accepted as an alias for SGP4 in every encoding, after trimming whitespace and normalizing case. OmmData.meanElementTheory stores the canonical value SGP4.

Numeric XML/KVN unit declarations must match the CCSDS units used by SGP4: deg, rev/day, rev/day**2, rev/day**3, and inverse Earth radii (1/ER or 1/[Earth radii]) for BSTAR. Dimensionless fields must omit units. Unsupported declarations cause the record to be skipped; values are not converted between units. Omitted units use these same conventions.

CLASSIFICATION_TYPE accepts U, C, or S after trimming whitespace and normalizing case. Missing or blank values default to U; unsupported values cause the record to be skipped before SGP4 is invoked.

Parameters:

omm_path – path to an OMM file holding one or many satellites

Returns:

ommDataList: list of OmmData, one per satellite, each carrying the osculating orbital elements in oe plus the record’s metadata