From eb6086cc39093f254153f41e6dff65a7bbe9f459 Mon Sep 17 00:00:00 2001 From: JohannesBrand Date: Sun, 20 May 2018 01:25:48 +0200 Subject: [PATCH] ecl-ekf-tools: fix a bug related to time index calculation (#9489) - fix start and end time indices calculation --- Tools/ecl_ekf/analyse_logdata_ekf.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Tools/ecl_ekf/analyse_logdata_ekf.py b/Tools/ecl_ekf/analyse_logdata_ekf.py index 064ef19a97..cb4edf1e5f 100644 --- a/Tools/ecl_ekf/analyse_logdata_ekf.py +++ b/Tools/ecl_ekf/analyse_logdata_ekf.py @@ -999,19 +999,19 @@ def analyse_ekf(estimator_status, ekf2_innovations, sensor_preflight, check_leve # Do some automated analysis of the status data # find a late/early index range from 5 sec after in_air_transtion_time to 5 sec before on-ground transition time for mag and optical flow checks to avoid false positives # this can be used to prevent false positives for sensors adversely affected by close proximity to the ground - late_start_index = np.argmin(status_time[np.where(status_time > (in_air_transition_time + 5.0))]) - early_end_index = np.argmax(status_time[np.where(status_time < (on_ground_transition_time - 5.0))]) + late_start_index = np.amin(np.where(status_time > (in_air_transition_time + 5.0))) + early_end_index = np.amax(np.where(status_time < (on_ground_transition_time - 5.0))) num_valid_values_trimmed = (early_end_index - late_start_index + 1) # normal index range is defined by the flight duration - start_index = np.argmin(status_time[np.where(status_time > in_air_transition_time)]) - end_index = np.argmax(status_time[np.where(status_time < on_ground_transition_time)]) + start_index = np.amin(np.where(status_time > in_air_transition_time)) + end_index = np.amax(np.where(status_time < on_ground_transition_time)) num_valid_values = (end_index - start_index + 1) # also find the start and finish indexes for the innovation data - innov_late_start_index = np.argmin(innov_time[np.where(innov_time > (in_air_transition_time + 5.0))]) - innov_early_end_index = np.argmax(innov_time[np.where(innov_time < (on_ground_transition_time - 5.0))]) + innov_late_start_index = np.amin(np.where(innov_time > (in_air_transition_time + 5.0))) + innov_early_end_index = np.amax(np.where(innov_time < (on_ground_transition_time - 5.0))) innov_num_valid_values_trimmed = (innov_early_end_index - innov_late_start_index + 1) - innov_start_index = np.argmin(innov_time[np.where(innov_time > in_air_transition_time)]) - innov_end_index = np.argmax(innov_time[np.where(innov_time < on_ground_transition_time)]) + innov_start_index = np.amin(np.where(innov_time > in_air_transition_time)) + innov_end_index = np.amax(np.where(innov_time < on_ground_transition_time)) innov_num_valid_values = (innov_end_index - innov_start_index + 1) # define dictionary of test results and descriptions test_results = {