TLE Object#

In this notebook we will discuss the usage of the TLE object: this allows the user to create a TLE object from a string or file.

The TLE class then allows easy manipulation and update of the TLE values, as well as the interface with the dSGP4 propagator (for a tutorial on the propagation see: ).

Imports#

import dsgp4

Load TLE from str#

Here, we show how to load TLEs from a list of strings:

#let us assume we have the following two lines for the TLE, plus the first line that indicates the satellite name:
tle_lines = []
tle_lines.append('0 TIMATION 1')
tle_lines.append('1  2847U 67053E   24063.46171465  .00000366  00000-0  27411-3 0  9994')
tle_lines.append('2  2847  69.9643 216.8651 0003597  77.7866 282.3646 14.02285835897007')

#let us construct the TLE object
tle=dsgp4.tle.TLE(tle_lines)
print(tle)
TLE(
0 TIMATION 1
1  2847U 67053E   24063.46171465  .00000366  00000-0  27411-3 0  9994
2  2847  69.9643 216.8651 0003597  77.7866 282.3646 14.02285835897007
)

All right, we can now access the TLE info as if it was a dictionary, or as attributes of the class:

#let's print all TLE elements:
print("TLE elements:")
print(f"Satellite catalog number: {tle.satellite_catalog_number}")
print(f"Classification: {tle.classification}")
print(f"International designator: {tle.international_designator}")
print(f"Epoch year: {tle.epoch_year}")
print(f"Epoch day: {tle.epoch_days}")
print(f"First time derivative of the mean motion: {tle._ndot}")
print(f"Second time derivative of the mean motion: {tle._nddot}")
print(f"BSTAR drag term: {tle._bstar}")
print(f"Element set number: {tle.element_number}")
print(f"Inclination [rad]: {tle._inclo}")
print(f"Right ascension of the ascending node [rad]: {tle._nodeo}")
print(f"Eccentricity [-]: {tle._ecco}")
print(f"Argument of perigee [rad]: {tle._argpo}")
print(f"Right ascension of ascending node [rad]: {tle._nodeo}")
print(f"Mean anomaly [rad]: {tle._mo}")
print(f"Mean motion [rad/min]: {tle._no_kozai}")
TLE elements:
Satellite catalog number: 2847
Classification: U
International designator: 67053E
Epoch year: 2024
Epoch day: 63.46171465
First time derivative of the mean motion: 1.1090112955380637e-11
Second time derivative of the mean motion: 0.0
BSTAR drag term: 0.00027411000000000004
Element set number: 999
Inclination [rad]: 1.2211073938530685
Right ascension of the ascending node [rad]: 3.785010027666755
Eccentricity [-]: 0.0003597
Argument of perigee [rad]: 1.3576322839318213
Right ascension of ascending node [rad]: 3.785010027666755
Mean anomaly [rad]: 4.928191961076781
Mean motion [rad/min]: 0.061186262187069844

We also have access to a few perhaps handy methods:

#let's first define the Earth radius according to WSG-84:
r_earth=dsgp4.util.get_gravity_constants('wgs-84')[2].numpy()*1e3

#let's extract the semi-major axis:
print(f"Semi-major axis [km]: {tle.semi_major_axis.numpy()*1e-3}")

#let's extract the TLE apogee & perigee altitudes:
print(f"Apogee radius [km]: {tle.apogee_alt(r_earth).numpy()*1e-3}")
print(f"Perigee radius [km]: {tle.perigee_alt(r_earth).numpy()*1e-3}")
Semi-major axis [km]: 7264.027802311157
Apogee radius [km]: 888.5036731116484
Perigee radius [km]: 883.2779315106654

Load TLE from dic#

Here, we show how to load TLEs from a dictionary. First, let’s define the TLE elements in a dictionary:

tle_dictionary=dict(
                    satellite_catalog_number=43437,
                    classification='U',
                    international_designator='18100A',
                    epoch_year=2020,
                    epoch_days=143.90384230,
                    ephemeris_type=0,
                    element_number=9996,
                    revolution_number_at_epoch=56353,
                    mean_motion=0.0011,
                    mean_motion_first_derivative=0.,
                    mean_motion_second_derivative=0.,
                    eccentricity=0.0221,
                    inclination=1.7074,
                    argument_of_perigee=2.1627,
                    raan=4.3618,
                    mean_anomaly=4.5224,
                    b_star=0.0001)
#now the same API as above applies:
tle = dsgp4.tle.TLE(tle_dictionary)
print(tle)
TLE(
1 43437U 18100A   20143.90384230  .00000000  00000-0  10000-3 0 99960
2 43437  97.8268 249.9127 0221000 123.9136 259.1144 15.12608579563539
)

Load TLEs from file:#

Here, we load the TLEs directly from file. We assume the user has downloaded the TLE data, for instance from Space-Track, and has placed such data in the example.tle file.

Then, we can simply load all TLEs using dsgp4. This will construct a list of TLE objects:

Note

The TLE file can or cannot contain the extra descriptive line that specifies the TLE name. The following lines should work either way.

tles=dsgp4.tle.load('example.tle')
print(tles)
[TLE(
0 COSMOS 2251 DEB
1 34454U 93036SX  22068.91971155  .00000319  00000-0  11812-3 0  9996
2 34454  74.0583 280.7094 0037596 327.9100  31.9764 14.35844873683320
), TLE(
0 COSMOS 2251 DEB
1 34456U 93036SZ  22068.85349922  .00005488  00000-0  13805-2 0  9997
2 34456  74.0462 226.5559 0056524 251.9784 107.5213 14.50477917685046
), TLE(
0 COSMOS 2251 DEB
1 34457U 93036TA  22068.86184197  .00003162  00000-0  55362-3 0  9992
2 34457  74.0015 304.7929 0101048  52.3409  79.2774 14.64945713693281
)]