Skip to content

Commit

Permalink
fix case where prediction site time satisfied multiple packets
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Jul 10, 2021
1 parent caff2c6 commit 419a9f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packetraven/predicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
"""

if not isinstance(launch_site, Point):
launch_site = Point(launch_site)
launch_site = Point(*launch_site)

if name is None:
name = 'prediction'
Expand Down Expand Up @@ -432,8 +432,12 @@ def get_predictions(
if prediction_start_location is None:
try:
prediction_start_location = packet_track[prediction_start_time].coordinates
if len(prediction_start_location.shape) > 1:
prediction_start_location = prediction_start_location[0, :]
except KeyError:
prediction_start_location = packet_track[-1].coordinates
if len(prediction_start_location) == 2:
prediction_start_location = (*prediction_start_location, 0)

if float_altitude is not None and not packet_track.falling:
packets_at_float_altitude = packet_track[numpy.abs(float_altitude - packet_track.altitudes) < float_altitude_uncertainty]
Expand Down

0 comments on commit 419a9f1

Please sign in to comment.