1
0
Fork 0

prediction_windows: Code cleanup (3)

merge-requests/637/head
Fabian P. Schmidt 2018-12-10 23:13:31 +01:00
parent 7860d9a3b7
commit d7cb17f1ee
1 changed files with 10 additions and 7 deletions

View File

@ -568,14 +568,17 @@ def prediction_windows(request, sat_id, transmitter, start_date, end_date,
gs_data = Observation.objects \
.filter(ground_station=station) \
.filter(end__gt=now())
windows = resolve_overlaps(station, gs_data, window_start, window_end)
windows, windows_changed = resolve_overlaps(station, gs_data, window_start, window_end)
if len(windows[0]) > 0:
for window in windows[0]:
station_windows.extend(create_station_window(
window, windows[1], azr, azs, elevation, max_elevation_time,
observer, satellite, sat.latest_tle, station
))
if len(windows) == 0:
# No non-overlapping windows found
continue
for window in windows:
station_windows.extend(create_station_window(
window, windows_changed, azr, azs, elevation, max_elevation_time,
observer, satellite, sat.latest_tle, station
))
if station_windows:
data.append({'id': station.id,