more agressive ascent rate drops

This commit is contained in:
xss 2022-03-17 15:15:08 +11:00
parent 44e10ef9f3
commit a23bc0d87c

View File

@ -718,7 +718,7 @@ async def run_predictions_for_serial(sem, serial, value, reverse_predictions, la
# No reverse prediction data! # No reverse prediction data!
# We can only run a reverse prediction with a sonde on ascent. # We can only run a reverse prediction with a sonde on ascent.
#print(f"{serial}: {value['rate']}") #print(f"{serial}: {value['rate']}")
if value['rate'] > 0.5: if value['rate'] > ASCENT_RATE_THRESHOLD:
# Try and run a reverse prediction # Try and run a reverse prediction
logging.info(f"Running reverse predict for {serial}") logging.info(f"Running reverse predict for {serial}")
@ -777,9 +777,14 @@ async def run_predictions_for_serial(sem, serial, value, reverse_predictions, la
#print(_flight_profile) #print(_flight_profile)
logging.debug(f"Running prediction for {serial} using flight profile {str(_flight_profile)}.") logging.debug(f"Running prediction for {serial} using flight profile {str(_flight_profile)}.")
# skip when close to 0.
if value['rate'] < ASCENT_RATE_THRESHOLD and value['rate'] > -ASCENT_RATE_THRESHOLD:
logging.debug(f"Skipping {serial} due to ascent rate limiting.")
return False
# Determine current ascent rate # Determine current ascent rate
# If the value is < 0.5 (e.g. we are on descent, or not moving), we just use a default value. # If the value is < 0.5 (e.g. we are on descent, or not moving), we just use a default value.
ascent_rate=value['rate'] if value['rate'] > 0.5 else _flight_profile['ascent_rate'] ascent_rate=value['rate'] if value['rate'] > ASCENT_RATE_THRESHOLD else _flight_profile['ascent_rate']
# If we are on descent, estimate the sea-level descent rate from the current descent rate # If we are on descent, estimate the sea-level descent rate from the current descent rate
# Otherwise, use the flight profile descent rate # Otherwise, use the flight profile descent rate
@ -787,7 +792,7 @@ async def run_predictions_for_serial(sem, serial, value, reverse_predictions, la
# If the resultant sea-level descent rate is very small, it means we're probably landed # If the resultant sea-level descent rate is very small, it means we're probably landed
# so dont run a prediction for this sonde. # so dont run a prediction for this sonde.
if descent_rate < 0.5: if descent_rate < ASCENT_RATE_THRESHOLD:
return False return False
# Now to determine the burst altitude # Now to determine the burst altitude