# Calculate Satellite Coordinates From TLE Data

I know it is not that hard for those familiar with the equations for it, but I am having trouble with the math. In order to fully understand the orbit elements of TLEs I read this which I found very helpful, but I am struggling with turning that into latitude and longitude coordinates. I am coming into this with no knowledge of the necessary algorithms which is what I am hoping someone can point me to. This post provides some relevant information but if I understand correctly is only explaining how to get the longitude at a specific time while I would like the full coordinates.

• Please put the full information from linked sites into your post to prevent link obsolescence ("rot"). What part of SGP/SDP algorithms does present difficulties for you? Apr 7 '14 at 23:36
• The information in the first link would be hard to summarize here but I added a bit to the second one. I also elaborated on what I am asking for. I don't understand what equations/algorithms are used to determine a satellites position at a certain time based on its TLE data, and that's what I would like to know. Apr 8 '14 at 0:43
• celestrak.com/publications/AIAA/2006-6753 Please search for SGP4/SDP4 algorithms on the Web. Note: the above link leads to annotated source code (celestrak.com/publications/AIAA/2006-6753/AIAA-2006-6753.zip). Apr 8 '14 at 0:49
• Could someone elaborate a little more about how to do it? @harry1795671: How did you use that Pyephem library? Oct 5 '14 at 12:30
• @Qorzyking Please note we're not a discussion forum but a Q&A site. If you have a new question please ask it as such. Refer to our About and Help center pages for more information how we function and organise things on Stack Exchange that Space Exploration is a part of. Thanks! Oct 5 '14 at 12:51

There are a number of software packages, many of them free, that deal with those two line elements. Use one of them.

Those two line elements are not Keplerian elements. They are instead Brouwer-Lyddane mean orbital elements. Keplerian elements assume a spherical central body and no forces other than gravitation. The Brouwer-Lyddane mean orbital elements address the first six spherical harmonics and attempt to account for atmospheric drag. The mathematics of Keplerian elements is a bit messy. The mathematics of those two line elements is beyond messy. It's a "math-out". (Think of a blizzard where all you see is whiteness. Blizzards are white-out conditions. The paper describing the two line elements is a math-out. All you see is mathematics.)

• In the end I settled on using Pyephem, a python library capable of doing the calculations fairly easily. May 8 '14 at 21:11

you can use PyEphem just like this

sudo apt-get install python

sudo apt-get install python-dev

sudo apt-get install python-pip

pip install pyephem


create test.py:

import ephem
import datetime
## [...]

name = "ISS (ZARYA)";
line1 = "1 25544U 98067A   12304.22916904  .00016548  00000-0  28330-3 0  5509";
line2 = "2 25544  51.6482 170.5822 0016684 224.8813 236.0409 15.51231918798998";

tle_rec.compute();

print tle_rec.sublong, tle_rec.sublat;

• Very nice! It's always good to see Python here. Skyfield is another Python package, and has a tag here where some use examples can be found. It is based on different principles, but has some overlapping functionality. Both PyEphem and Skyfield are in fact managed by the same person.
– uhoh
Mar 13 '17 at 7:32
• Now, I want to forecast orbit.what should I do?Just like this, input a time, output a longitude and latitude. @uhoh Have you something idea? Mar 13 '17 at 9:45
• Ya, the reason I didn't post another answer is that it does not appear to be so transparent to generate a ground track from an orbit in Skyfield. It's easy to get GCRS coordinates (x, y, z) or JD2000 coordinates, but if I understand correctly it's still up to the user to project down on to their own model for the Earth. Lat/lon are referenced to the Earth's surface, they are not necessarily precise space coordinates. If you ask this as another question here I can post short scripts for two different methods.
– uhoh
Mar 13 '17 at 10:36
• In the mean time, you can look at this question and Skyfield issue 121.
– uhoh
Mar 13 '17 at 10:38
• Warning: pyephem is deprecated and no longer maintained (last release was in 2015). Skyfield however had most recent released February 2019 (4 months prior to this comment).
– gerrit
Jun 5 '19 at 13:51

Depending on which algorithm/set of equations you are using to convert, you may need to convert the TLE parameters into ECEF coordinates, then convert that into latitude, longitude, and altitude. Here is a page that explains the ECEF-to-LLA conversion: http://www.gmat.unsw.edu.au/snap/gps/clynch_pdfs/coordcvt.pdf

A common math difficulty is that the true anomaly and the mean anomaly are related by Kepler's equation, which is a transcendental equation as your first link mentioned. An iterative method like Newton's Method is usually used for this part of the conversion.

I can't seem to find a webpage that has the set of algorithms for converting TLE to ECEF, but this page gives the algorithm for converting GPS ephemerides (orbital parameters) into ECEF coordinates: http://web.ics.purdue.edu/~ecalais/teaching/geodesy/EAS_591T_2003_lab_4.htm If I remember correctly the TLE conversion is pretty similar, so that might get you on the right track. If you don't have a textbook with the algorithm, it might be online in a paper or something.

• Please expand and include the relevant math for the benefit of subsequent visitors. Apr 8 '14 at 0:52
• Note: the first link is now dead. Mar 13 '17 at 14:08

I had a similair question, and using pyephem as suggested by zdRan worked great, except for one thing: Those are instructions for Debian/Ubuntu/etc. distributions and I was on a bare-bones CentOS install.

In case anyone else runs into this, here's the install instructions, to be used in place of the first block in zdRan's post:

sudo yum install python
sudo yum install python-devel

The epel-release is needed since pip isn't part of the core pacakges for CentOS, but is part of the extended packages. gcc only needs to be installed if you don't already have it (you can use whereis gcc to check, but yum won't install if already there, so not strictly necessary).