def calc_estimator_status_metrics(self) -> Dict[str, list]:
        """
        calculates the estimator status metrics
        :return:
        """
        estimator_status_metrics = dict()

        estimator_status_data = self.ulog.get_dataset('estimator_status').data

        # add windowed metrics
        estimator_status_metrics['{:s}_percentage_red_windowed'.format(self._check_id)] = \
            calculate_windowed_mean_per_airphase(
                estimator_status_data, 'estimator_status', self._test_ratio_name,
                self._in_air_detector, threshold=params.ecl_red_thresh(),
                window_len_s=params.ecl_window_len_s())

        estimator_status_metrics['{:s}_percentage_amber_windowed'.format(self._check_id)] = \
            calculate_windowed_mean_per_airphase(
                estimator_status_data, 'estimator_status', self._test_ratio_name,
                self._in_air_detector, threshold=params.ecl_amb_thresh(),
                window_len_s=params.ecl_window_len_s())

        estimator_status_metrics['{:s}_test_windowed_mean'.format(self._check_id)] = \
            calculate_windowed_mean_per_airphase(
                estimator_status_data, 'estimator_status', self._test_ratio_name,
                self._in_air_detector, window_len_s=params.ecl_window_len_s())

        return estimator_status_metrics
    def calc_estimator_statistics(self) -> None:
        """
        :return:
        """

        if self._test_ratio_name is None:
            return

        estimator_status_data = self.ulog.get_dataset('estimator_status').data
        estimator_status_metrics = self.calc_estimator_status_metrics()

        innov_red_pct = self.add_statistic(
            CheckStatisticType.INNOVATION_RED_PCT, statistic_instance=0)
        innov_red_pct.value = float(
            calculate_stat_from_signal(
                estimator_status_data, 'estimator_status',
                self._test_ratio_name, self._in_air_detector,
                lambda x: 100.0 * np.mean(x > params.ecl_red_thresh())))

        #TODO: remove subtraction of innov_red_pct and tune parameters
        innov_amber_pct = self.add_statistic(
            CheckStatisticType.INNOVATION_AMBER_PCT, statistic_instance=0)
        innov_amber_pct.value = float(
            calculate_stat_from_signal(
                estimator_status_data, 'estimator_status',
                self._test_ratio_name, self._in_air_detector, lambda x: 100.0 *
                np.mean(x > params.ecl_amb_thresh()))) - innov_red_pct.value
        innov_amber_pct.thresholds.warning = thresholds.ecl_amber_warning_pct(
            self._check_id)
        innov_amber_pct.thresholds.failure = thresholds.ecl_amber_failure_pct(
            self._check_id)

        innov_red_windowed_pct = self.add_statistic(
            CheckStatisticType.INNOVATION_RED_WINDOWED_PCT,
            statistic_instance=0)
        innov_red_windowed_pct.value = float(
            max([
                np.max(metric) for _, metric in estimator_status_metrics[
                    '{:s}_percentage_red_windowed'.format(self._check_id)]
            ]))

        innov_amber_windowed_pct = self.add_statistic(
            CheckStatisticType.INNOVATION_AMBER_WINDOWED_PCT,
            statistic_instance=0)
        innov_amber_windowed_pct.value = float(
            max([
                np.max(metric) for _, metric in estimator_status_metrics[
                    '{:s}_percentage_amber_windowed'.format(self._check_id)]
            ]))

        # the max and mean ratio of samples above / below std dev
        test_ratio_max = self.add_statistic(
            CheckStatisticType.ESTIMATOR_FAILURE_MAX, statistic_instance=0)
        test_ratio_max.value = float(
            calculate_stat_from_signal(estimator_status_data,
                                       'estimator_status',
                                       self._test_ratio_name,
                                       self._in_air_detector, np.amax))

        test_ratio_avg = self.add_statistic(
            CheckStatisticType.ESTIMATOR_FAILURE_AVG, statistic_instance=0)
        test_ratio_avg.value = float(0.0)

        if test_ratio_max.value > 0.0:
            test_ratio_avg.value = float(
                calculate_stat_from_signal(estimator_status_data,
                                           'estimator_status',
                                           self._test_ratio_name,
                                           self._in_air_detector, np.mean))

        test_ratio_windowed_avg = self.add_statistic(
            CheckStatisticType.ESTIMATOR_FAILURE_WINDOWED_AVG,
            statistic_instance=0)

        test_ratio_windowed_avg.value = float(
            max([
                float(np.mean(metric))
                for _, metric in estimator_status_metrics[
                    '{:s}_test_windowed_mean'.format(self._check_id)]
            ]))