Create pyephem satellite object in scheduling.py
parent
e0d68bea0f
commit
3603bc15a0
|
@ -180,8 +180,7 @@ def next_pass(observer, satellite):
|
|||
'tca_alt': pass_elevation}
|
||||
|
||||
|
||||
def predict_available_observation_windows(station, min_horizon, satellite,
|
||||
start_date, end_date, sat):
|
||||
def predict_available_observation_windows(station, min_horizon, tle, start_date, end_date, sat):
|
||||
'''
|
||||
Calculates available observation windows for a certain station and satellite during
|
||||
the given time period.
|
||||
|
@ -189,6 +188,8 @@ def predict_available_observation_windows(station, min_horizon, satellite,
|
|||
Returns list of passes found and list of available observation windows
|
||||
'''
|
||||
passes_found = []
|
||||
# Initialize pyehem Satellite for propagation
|
||||
satellite = ephem.readtle(*tle)
|
||||
# Initialize pyephem Observer for propagation
|
||||
observer = ephem.Observer()
|
||||
observer.lon = str(station.lng)
|
||||
|
|
|
@ -424,9 +424,6 @@ def prediction_windows(request):
|
|||
start_date = make_aware(datetime.strptime(start_date, '%Y-%m-%d %H:%M'), utc)
|
||||
end_date = make_aware(datetime.strptime(end_date, '%Y-%m-%d %H:%M'), utc)
|
||||
|
||||
# Initialize pyehem Satellite for propagation
|
||||
satellite = ephem.readtle(*tle)
|
||||
|
||||
data = []
|
||||
|
||||
stations = Station.objects.filter(status__gt=0)
|
||||
|
@ -448,7 +445,7 @@ def prediction_windows(request):
|
|||
for station in available_stations:
|
||||
station_passes, station_windows = predict_available_observation_windows(station,
|
||||
min_horizon,
|
||||
satellite,
|
||||
tle,
|
||||
start_date,
|
||||
end_date,
|
||||
sat)
|
||||
|
|
Loading…
Reference in New Issue