Fix pass_duration bug

merge-requests/25/head
Cees Bassa 2019-05-12 11:31:11 +02:00
parent 6869ce2635
commit 897e96572b
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