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.
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.)
The mathematics is described in F.R. Hoots, "Reformulation of the Brouwer geopotential theory for improved computational efficiency", Celestial Mechanics 24 (1981).
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.
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
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 = ephem.readtle(name, line1, line2); tle_rec.compute(); print tle_rec.sublong, tle_rec.sublat;
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 sudo yum upgrade python-setuptools sudo yum install epel-release sudo yum install python-pip sudo yum install gcc sudo pip install pyephem
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).
From there, proceed as above, works great.
(This was on CentOS 7, but a similair procedure should work for most CentOS/Red Hat/Fedora distributions)