EarthSatellite rise and set of next pass
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyEphem |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I am getting inconsistent results for rising and setting times for the EarthSatellite type. I am running the code from an Idle window. Each time I run it, I get varying results. In addition the setting the observer horizon is not working perhaps due to the rising/setting time weirdness. Please see my code below.
import ephem
import os
from math import ceil
def readTLE(TLEfile, satellite) :
print TLEfile, satellite
if os.path.
# logging.info('TLE file: %s' % TLEfile)
f = open(TLEfile,'r')
for line in f :
if line.strip() == satellite :
TLE = [ line.strip() ]
else:
# logging.warn('TLE file: %s not found. Aborting.' % TLEfile)
return
f.close()
return TLE
TLE = readTLE(
#print TLE
envisat = ephem.readtle(
halifax = ephem.Observer()
halifax.lat, halifax.long = '44:39:00', '63:34:00'
halifax.horizon = '00:00'
np = halifax.
#print np
#print envisat._orbit, envisat._epoch
orbit_number = int(ceil(
print orbit_number
rising_time, setting_time = np[0], np[4]
print rising_time, setting_time
envisat.
rise_eclipsed = envisat.eclipsed
envisat.
set_eclipsed = envisat.eclipsed
iseclipsed = rise_eclipsed and set_eclipsed
print iseclipsed
(Latest pyephem version, Python 2.6.5, WinXP)
And deleting ephem, halifax and TLE in the Ide Python shell window, between successive executions from the Idle code window, makes no difference.