Converting to TLE

Orbit Mean-Elements Messages whose mean elements follow the SGP4 theory can be converted into a classic Two-Line Element set (TLE). This is useful to interoperate with the many tools in the SatelliteToolbox.jl ecosystem that consume TLEs, such as the SGP4 propagator.

This capability is provided by a package extension that is loaded automatically once SatelliteToolboxTle.jl is available in your environment:

julia> using Pkg

julia> Pkg.add("SatelliteToolboxTle")

Performing the Conversion

Load both packages and use Julia's convert function with the target type TLE. Assuming the variable omm holds an OrbitMeanElementsMessage for the Amazonia 1 satellite:

julia> using SatelliteToolboxTle
julia> tle = convert(TLE, omm)TLE: Name : AMAZONIA 1 Satellite number : 47699 International designator : 21015A Epoch (Year / Day) : 25 / 364.75838581 (2025-12-30T18:12:04.534) Element set number : 999 Eccentricity : 0.00011240 Inclination : 98.37210000 deg RAAN : 75.08770000 deg Argument of perigee : 97.37720000 deg Mean anomaly : 262.75450000 deg Mean motion (n) : 14.40772474 revs / day Revolution number : 25439 B* : 0.0001533 1 / er ṅ / 2 : 4.47e-06 rev / day² n̈ / 6 : 0 rev / day³

The conversion maps the OMM fields to their TLE counterparts, including the translation of the OBJECT_ID (e.g. 2021-015A) into the TLE international designator format (e.g. 21015A).

Requirements and Behavior

  • Mean element theory. The conversion only succeeds when the metadata field mean_element_theory is equal to "SGP4". Otherwise, an error is raised, since the elements cannot be interpreted as a TLE.

  • Mean motion. TLEs are expressed in terms of the mean motion. If the OMM provides mean_motion directly, it is used as is. If only the semi_major_axis is available, the mean motion is computed from it, which additionally requires the gravitational parameter GM to be present:

    \[n = \frac{1}{2\pi}\sqrt{\frac{GM}{a^3}} \times 86400\]

  • Required TLE fields. Conversion requires classification_type, norad_cat_id, element_set_number, rev_at_epoch, bstar, mean_motion_dot, and mean_motion_ddot. Missing fields raise an error; they do not receive placeholder values.

  • Unsupported alternatives. OMM TLE parameters may represent drag with either bstar or bterm, and the second derivative slot with either mean_motion_ddot or agom. A classic TLE conversion requires bstar and mean_motion_ddot; conversion rejects bterm and agom because they have no direct TLE representation.

Warning

The CCSDS standard does not fully specify whether the derivative fields (MEAN_MOTION_DOT and MEAN_MOTION_DDOT) already incorporate the SGP4 scaling factors. Based on the data returned by Celestrak and Space-Track, this package assumes they are already adjusted and copies them directly into the TLE.