-
Notifications
You must be signed in to change notification settings - Fork 2
/
sanitiseParameters.m
34 lines (27 loc) · 961 Bytes
/
sanitiseParameters.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
28
29
30
31
32
33
function LogOut = sanitiseParameters(LogIn)
%sanitiseParameters
excludeParams = {'STAT_RUNTIME', 'STAT_FLTTIME','GND_ABS_PRESS'};
PARM = LogIn.PARM;
PARM.Name(PARM.Name==char(0)) = char(32);
PARM.Name = string(PARM.Name);
PARM.Name = strtrim(PARM.Name);
idx = ismember(PARM.Name, excludeParams);
PARM.Name(idx) = [];
PARM.TimeUS(idx) = [];
PARM.TimeS(idx) = [];
PARM.LineNo(idx) = [];
PARM.Value(idx) = [];
PARM.Time(idx) = [];
PARM.DatenumUTC(idx) = [];
% Remove repeated params (MP sends twice)
idx = find(strcmp(PARM.Name(1:end-1), PARM.Name(2:end)) & PARM.Value(1:end-1)==PARM.Value(2:end) & abs(PARM.Time(1:end-1) - PARM.Time(2:end))<1);
PARM.Name(idx) = [];
PARM.TimeUS(idx) = [];
PARM.TimeS(idx) = [];
PARM.LineNo(idx) = [];
PARM.Value(idx) = [];
PARM.Time(idx) = [];
PARM.DatenumUTC(idx) = [];
LogOut = LogIn;
LogOut.PARM = PARM;
end