Skip to content

Commit

Permalink
fixed minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Apr 9, 2021
1 parent e00d1be commit 2b9db8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def main():
kwargs['prediction_sea_level_descent_rate'] = float(args.prediction_descent_rate)

if args.prediction_float_altitude is not None:
kwargs['prediction_float_altitude'] = float(args.prediction_descent_rate)
kwargs['prediction_float_altitude'] = float(args.prediction_float_altitude)

if args.prediction_float_duration is not None:
kwargs['prediction_float_duration'] = timedelta(seconds=float(args.prediction_float_duration))
Expand Down
4 changes: 2 additions & 2 deletions packetraven/predicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def get(self) -> {str: Any}:
response = response.json()
if 'error' not in response:
# TODO tawhiri currently does not include descent when querying a float profile
# this code runs another prediction query with a standard profile and extracts the descent stage to append to the response from the original query
if self.profile == FlightProfile.float:
# this code runs another prediction query with a standard profile and extracts the descent stage to append to the response from the original query
for stage in response['prediction']:
# if a descent stage exists, we don't need to do anything
if stage['stage'] == 'descent':
Expand Down Expand Up @@ -414,7 +414,7 @@ def get_predictions(
if len(packets_at_float_altitude) > 0 and packets_at_float_altitude[-1].time == packet_track.times[-1]:
float_start_time = packets_at_float_altitude[0].time
descent_only = False
elif packet_track.ascent_rates[-1] > 0:
elif packet_track.ascent_rates[-1] >= 0:
float_start_time = prediction_start_time + timedelta(seconds=(float_altitude - prediction_start_location[2]) / ascent_rate)
descent_only = False
else:
Expand Down

0 comments on commit 2b9db8f

Please sign in to comment.