forked from mit-ll/em-processing-opensky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdentifyOutliers.m
27 lines (22 loc) · 978 Bytes
/
IdentifyOutliers.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function [isGood, isOut, isOutAcc, isOutPsi, isOutSpeed, isOutVertRate] = IdentifyOutliers(inTrack,p)
% Copyright 2018 - 2020, MIT Lincoln Laboratory
% SPDX-License-Identifier: BSD-2-Clause
%% Identify outliers
% Acceleration
isOutAcc = abs(inTrack.dv_estimate_kt_s) > p.Results.outlierAccel_kts_s;
% Turn Rate
isOutPsi = abs(inTrack.dpsi_deg_s) > p.Results.outlierTurnRate_deg_s;
% Speed
isOutSpeed = abs(inTrack.speed_estimate_kt) > p.Results.outlierSpeed_kt;
% Altitude
switch p.Results.altMode
case 'baro'
isOutVertRate = abs(inTrack.dh_baro_ft_s) > p.Results.outlierVertRate_ft_s;
case 'geo'
isOutVertRate = abs(inTrack.dh_geo_ft_s) > p.Results.outlierVertRate_ft_s;
case 'both'
isOutVertRate = (abs(inTrack.dh_baro_ft_s) > p.Results.outlierVertRate_ft_s) | (abs(inTrack.dh_geo_ft_s) > p.Results.outlierVertRate_ft_s);
end
%% Aggregate all outlier logicals
isOut = isOutAcc | isOutPsi | isOutSpeed | isOutVertRate;
isGood = ~isOut;