- #1
thor36
- 10
- 0
Greetings all !
I really hope this is the right sub-forum for my question, I have chosen it because I've seen TLE being mentioned a couple of times around here.
I have done some reading on astrodynamics and orbital mechanics, but I am relatively new to coding. I would like to write some C++ code that would make use of this software library ( Computer software in C++ ). So far I am not having success with using "sgp4" and "twoline2rv" routines. Obviously, I don't know how to use them properly, although I tried to follow and understand the routines line by line and particularly paid attention to comments.
Let's say I get the TLE data for ISS online and store it in a file called "isstle.txt", which would look like this :
ISS (ZARYA)
1 25544U 98067A 14296.89020256 .00021128 00000-0 36676-3 0 2914
2 25544 51.6464 181.6097 0002420 294.7068 172.8232 15.50795889911298
I would then like to propagate the satellite's position and velocity vectors from some initial moment ( Tstart, most likely defined by particular TLE ) to a final moment (Tend, say 2 hours after Tstart) and compute state vectors on every "time step" of length dT along the way, including at initial and final moment. These vectors would then be stored in type double arrays.
The algorithm doesn't need to follow the style of following pseudo code, but here is what I have in mind, and it may help clarify my intentions :
TLE from internet -> textfile
SatData = twoline2rv( textfile )
sgp4() and twoline2rv() are actual names of the functions found in the libraries mentioned earlier.
I would very much appreciate a piece of sample code that can solve this problem or at least help orient myself a little. Of course any other tips and hints are just as welcome.
Thank you very much and kind regards
T
I really hope this is the right sub-forum for my question, I have chosen it because I've seen TLE being mentioned a couple of times around here.
I have done some reading on astrodynamics and orbital mechanics, but I am relatively new to coding. I would like to write some C++ code that would make use of this software library ( Computer software in C++ ). So far I am not having success with using "sgp4" and "twoline2rv" routines. Obviously, I don't know how to use them properly, although I tried to follow and understand the routines line by line and particularly paid attention to comments.
Let's say I get the TLE data for ISS online and store it in a file called "isstle.txt", which would look like this :
ISS (ZARYA)
1 25544U 98067A 14296.89020256 .00021128 00000-0 36676-3 0 2914
2 25544 51.6464 181.6097 0002420 294.7068 172.8232 15.50795889911298
I would then like to propagate the satellite's position and velocity vectors from some initial moment ( Tstart, most likely defined by particular TLE ) to a final moment (Tend, say 2 hours after Tstart) and compute state vectors on every "time step" of length dT along the way, including at initial and final moment. These vectors would then be stored in type double arrays.
The algorithm doesn't need to follow the style of following pseudo code, but here is what I have in mind, and it may help clarify my intentions :
TLE from internet -> textfile
SatData = twoline2rv( textfile )
for ( T = Tstart : dT : Tend )
sgp4( SatData, T )
store RV to arrays
endstore RV to arrays
sgp4() and twoline2rv() are actual names of the functions found in the libraries mentioned earlier.
I would very much appreciate a piece of sample code that can solve this problem or at least help orient myself a little. Of course any other tips and hints are just as welcome.
Thank you very much and kind regards
T
Last edited: