I have a TLE file associated with a satellite (contains its keplerian coordinates: TLE_description such as Eccentricity (degrees), Perigee Argument (degrees), Epoch (year_month_day hour:min:sec) and so on. It looks like this:
'''ISS (ZARYA)
1 25544U 98067A 14273.50403866 .00012237 00000-0 21631-3 0 1790
2 25544 51.6467 297.5710 0002045 126.1182 27.2142 15.50748592907666
I've attached a photo that shows the names of each value in the TLE.'''
From this TLE file, I want to have the Cartesian position vector (X, Y, Z) of the satellite in the satellite fix.
To do this, I tried using the beyond library (from beyond.io.tle import Tle ; from beyond.frames import create_station) to get some Keplerian data, (azimuth, elevation, distance_from_the_station) but all this data is computed with respect to a station, so this isn't the position vector of the satellite but a vector (azimut_station_to_satellite, elevation_station_to_satellite, distance_station_to_satellite) and I can't have the position vector from it. But since I can have a vector, I'm sure there is a way to get directly the position of the satellite from its TLE file.
If it's necessary, I can add a code! Thanks for reading.
I finally figured it out, here's the answer : I have a TLE like this :
'1 28446U 04041A 19002.21559949 -.00000090 00000-0 00000+0 0 9998 2 28446 0.0198 37.5572 0002596 225.6438 170.9111 1.00271812 52071'
To get the position and/or speed vector of my satellite in the cartesian coordinates, I juste have to do :
from sgp4.api import Satrec
from sgp4.api import jday
s = '1 28446U 04041A 19002.21559949 -.00000090 00000-0 00000+0 0 9998'
t = '2 28446 0.0198 37.5572 0002596 225.6438 170.9111 1.00271812 52071'
satellite = Satrec.twoline2rv(s, t)
jd, fr = jday(2019, 1, 1, 11, 59, 33) # I pick an epoch (close to the TLE's)
e, r, v = satellite.sgp4(jd, fr) # e = error, r = position vector, v = speed vector
If e = 0 there's no problem, else you get the index of the error. Credits go to Brandon Rhodes!