Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phephem: iss predictions not matching nasa website

Tags:

python

pyephem

I have been reading previous posts here but I still have a question. I am just making a very simple script to tell me when satellites are passing over my city.

I am using this blog post as a guide: http://libjoe.blogspot.com.au/2009/10/where-is-my-satellite-in-python.html

For testing, I am checking whether the output for the ISS station matches the predicted output on the nasa site but it doesn't match: http://spotthestation.nasa.gov/sightings/view.cfm?country=Australia&region=Victoria&city=Melbourne#.VLr7I82UdhE

I have my lat&long set for Melbourne, and I am using ephem.localtime when printing out the rise & set times. However, the times never match the nasa site.

Any advice would be greatly appreciated, thank you!

import datetime
import ephem
import math
import os
import sys 
import time
import urllib2

observer = ephem.Observer()
observer.long = '-37.799423'
observer.lat = '144.999979'
observer.date = datetime.datetime.now()

tles = urllib2.urlopen('http://www.amsat.org/amsat/ftp/keps/current/nasabare.txt').readlines()
tles = [item.strip() for item in tles]
tles = [(tles[i],tles[i+1],tles[i+2]) for i in xrange(0,len(tles)-2,3)]

for tle in tles:

   try:
     sat = ephem.readtle(tle[0], tle[1], tle[2])
     rt, ra, tt, ta, st, sa = observer.next_pass(sat)

     if rt is not None and st is not None:
       #observer.date = rt
       sat.compute(observer)

       print tle[0]
       print 'rise time: ', ephem.localtime(rt)
       print 'set time: ',  ephem.localtime(st)
       print
   except ValueError as e:
    print e

Here is the output of my script run now at "15:10" in Melbourne on 18th Jan 2015, where the ISS station is listed in the output as:

rise time: 2015-01-19 02:27:09
set time: 2015-01-19 02:37:37

However, the NASA site (spotthestation.nasa.gov/sightings/…) states the following predictions for Jan 19th:

  • Mon Jan 19, 9:23 PM and
  • Mon Jan 19, 10:59 PM
like image 929
Paul P Avatar asked Dec 12 '25 11:12

Paul P


1 Answers

Typically, longitude is a “big number” between ±180° while latitude is a small number in the more limited range ±90° — is it possible that you have reversed the latitude and longitude here?

like image 165
Brandon Rhodes Avatar answered Dec 14 '25 00:12

Brandon Rhodes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!