Fun with PyEphem

I just tried finding out when and if the International Space Station would pass overhead. First I installed pyephem for linux:
$ sudo easy_install pyephem
Then started python and typed the following:
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ephem
>>> home=ephem.Observer()
>>> home.long = -43.9
>>> home.lat = 19.9
>>> home.elevation = 1000
>>> home.date = "2007/12/09 20:00"
Getting the information about the ISS was a bit harder. Had to go to this page at celestrak and get the first three lines then enter it in ephem.
>>> iss = ephem.readtle("ISS (ZARYA)",
... "1 25544U 98067A 07343.37458451 .00020246 00000-0 12456-3 0 4837",
... "2 25544 51.6404 280.6485 0000524 313.0633 141.2500 15.77203764518419")
>>> iss.compute(home)
>>> print iss.rise_time, iss.transit_time, iss.set_time
2007/12/9 16:26:18 2007/12/9 16:29:51 2007/12/9 16:33:25
Definitely easy enough for me to write a little python program to get the most interesting events happening in my area tonight.

Comments

Popular posts from this blog

Shortest Sudoku solver in Python

Canon EOS 450D triggered by an Arduino