Using Pyephem to calculate ISS passes -
i'm trying calculate passes of number of space objects celestrak tle elements starting iss because can test against values spot station. have start setting observer:
self.home = ephem.observer() self.home.lat = '51.45' self.home.lon = '-2.58' self.elevation = 134.69 and i'm using function calculate 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 says on tin!
def deg2rad(self,radians): return radians * (180.0 / math.pi) the tle retrieved today (28th jan) http://www.celestrak.com/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 output
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 if run @ 2016/1/28 20:14:11 why not getting same spot station give next possible sighting:
tue feb 2, 7:38 pm < 1 min 12° 10° above ssw 12° above ssw i note altitude negative , expect positive if visible next reported rise time in february?
the altitude printing not altitude of moment of next pass, because calling spob.compute(self.home) whatever date , time happens current value of self.home.date. if want altitude print altitude of next pass, instead of arbitrary , likely-negative number, try using either altitude value returned among 6 return values of next_pass, or else careful set self.home.date time , date when satellite above horizon before calling compute() method satellite.
Comments
Post a Comment