I'm trying to calculate the passes of a number of space objects from CelesTrak TLE Elements starting with the ISS because I can test it against the values from Spot The Station. So I have start with setting up the observer:
self.home = ephem.Observer()
self.home.lat = '51.45'
self.home.lon = '-2.58'
self.elevation = 134.69
and I'm using this function to calculate the passes etc
def nextPass(self,tle):
spob = ephem.readtle(tle[0],tle[1],tle[2])
spob.compute(self.home)
print('\n\n%s: altitude %4.1f deg, azimuth %5.1f deg' % (spob.name, self.deg2rad(spob.alt), self.deg2rad(spob.az) ) )
self.home.date = datetime.utcnow()
info = self.home.next_pass(spob)
print("%s = Rise time: %s azimuth: %s" % (self.home.date,info[0], info[1]))
and deg2rad does what it says on the tin!
def deg2rad(self,radians):
return radians * (180.0 / math.pi)
The TLE retrieved today (28th Jan) from https://celestrak.org/NORAD/elements/ is
isstle = ['ISS (ZARYA) ',
'1 25544U 98067A 16028.60081312 .00014289 00000-0 21385-3 0 9994',
'2 25544 51.6413 39.1283 0006529 51.2720 308.9374 15.54305299983116',
]
Currently my output is
ISS (ZARYA): altitude -68.0 deg, azimuth 241.6 deg
2016/1/28 20:14:11 = Rise time: 2016/1/28 20:46:11 azimuth: 203:45:42.0
My question is if i run this at 2016/1/28 20:14:11 why am I not getting the same as Spot The Station which currently give as the next possible sighting:
Tue Feb 2, 7:38 PM < 1 min 12° 10° above SSW 12° above SSW
I note that the altitude is negative and I would expect it to positive if it was visible but the next reported rise time is in February?