Fix pass_duration bug

merge-requests/26/head
cgbsat 2019-05-12 09:31:44 +00:00
parent 6869ce2635
commit a7f477db9b
1 changed files with 2 additions and 2 deletions

View File

@ -258,14 +258,14 @@ def find_passes(satellites, observer, tmin, tmax, minimum_altitude, min_pass_dur
break
passid += 1
pass_duration = (ts.datetime() - tr.datetime()) / timedelta(minutes=1)
pass_duration = ts.datetime() - tr.datetime()
# show only if >= configured horizon and till tmax,
# and not directly overhead (tr < ts see issue 199)
if tr < ephem.date(tmax):
if (float(elevation) >= minimum_altitude and tr < ts and
pass_duration > min_pass_duration):
pass_duration > timedelta(minutes=min_pass_duration)):
valid = True
# invalidate passes that start too soon