Two-Line Element (TLE)¶
Functions for parsing, validating, and converting Two-Line Element sets.
For propagating orbits from TLE data, use the SGPPropagator class.
TLE Utility Functions¶
epoch_from_tle
builtin
¶
Extract Epoch from TLE line 1
Extracts and parses the epoch timestamp from the first line of TLE data. The epoch is returned in UTC time system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line1
|
str
|
First line of TLE data |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Epoch |
Epoch
|
Extracted epoch in UTC time system |
Examples:
keplerian_elements_from_tle
builtin
¶
Extract Keplerian orbital elements from TLE lines.
Extracts the standard six Keplerian orbital elements from Two-Line Element (TLE) data. Returns elements in standard order: [a, e, i, raan, argp, M] where angles are in radians.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line1
|
str
|
First line of TLE data. |
required |
line2
|
str
|
Second line of TLE data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
Tuple
|
A tuple containing: - epoch (Epoch): Epoch of the TLE data. - elements (numpy.ndarray): Six Keplerian elements [a, e, i, raan, argp, M] where a is semi-major axis in meters, e is eccentricity (dimensionless), and i, raan, argp, M are in radians. |
keplerian_elements_to_tle
builtin
¶
Convert Keplerian elements to TLE lines.
Converts standard Keplerian orbital elements to Two-Line Element (TLE) format. Input angles should be in degrees for compatibility with TLE format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
Epoch of the elements. |
required |
elements
|
ndarray
|
Keplerian elements [a (m), e, i (deg), raan (deg), argp (deg), M (deg)]. |
required |
norad_id
|
str
|
NORAD catalog number (supports numeric and Alpha-5 format). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
Tuple
|
A tuple containing (line1, line2) - the two TLE lines as strings. |
create_tle_lines
builtin
¶
create_tle_lines(epoch: Epoch, inclination: float, raan: float, eccentricity: float, arg_perigee: float, mean_anomaly: float, mean_motion: float, norad_id: str, ephemeris_type: int, element_set_number: int, revolution_number: int, classification: str = None, intl_designator: str = None, first_derivative: float = None, second_derivative: float = None, bstar: float = None) -> Tuple
Create complete TLE lines from all parameters.
Creates Two-Line Element (TLE) lines from complete set of orbital and administrative parameters. Provides full control over all TLE fields including derivatives and drag terms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
Epoch of the elements. |
required |
inclination
|
float
|
Inclination in degrees. |
required |
raan
|
float
|
Right ascension of ascending node in degrees. |
required |
eccentricity
|
float
|
Eccentricity (dimensionless). |
required |
arg_perigee
|
float
|
Argument of periapsis in degrees. |
required |
mean_anomaly
|
float
|
Mean anomaly in degrees. |
required |
mean_motion
|
float
|
Mean motion in revolutions per day. |
required |
norad_id
|
str
|
NORAD catalog number (supports numeric and Alpha-5 format). |
required |
ephemeris_type
|
int
|
Ephemeris type (0-9). |
required |
element_set_number
|
int
|
Element set number. |
required |
revolution_number
|
int
|
Revolution number at epoch. |
required |
classification
|
str
|
Security classification. Defaults to ' '. |
None
|
intl_designator
|
str
|
International designator. Defaults to ''. |
None
|
first_derivative
|
float
|
First derivative of mean motion. Defaults to 0.0. |
None
|
second_derivative
|
float
|
Second derivative of mean motion. Defaults to 0.0. |
None
|
bstar
|
float
|
BSTAR drag term. Defaults to 0.0. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
Tuple
|
A tuple containing (line1, line2) - the two TLE lines as strings. |
validate_tle_line
builtin
¶
validate_tle_lines
builtin
¶
calculate_tle_line_checksum
builtin
¶
parse_norad_id
builtin
¶
norad_id_numeric_to_alpha5
builtin
¶
Convert numeric NORAD ID to Alpha-5 format or pass through if in legacy range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
norad_id
|
int
|
Numeric NORAD ID (0-339999). IDs 0-99999 are passed through as numeric strings. IDs 100000-339999 are converted to Alpha-5 format. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
For IDs 0-99999: numeric string (e.g., "42"). For IDs 100000-339999: Alpha-5 format ID (e.g., "A0001"). |