-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplotFilterResiduals.m
More file actions
68 lines (63 loc) · 3.63 KB
/
plotFilterResiduals.m
File metadata and controls
68 lines (63 loc) · 3.63 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
function [] = plotFilterResiduals(measurements, prefits, postfits, startStopIndices, varargin);
%% Handle optional arguments
numVarArgs = length(varargin);
if numVarArgs > 2
error('plotResiduals:TooManyInputs', 'requires at most 2 optional arguments');
end
optArgs = {[], []};
optArgs(1:numVarArgs) = varargin;
[ylimRange, ylimRangeRate] = optArgs{:};
%%
startIndex = startStopIndices(1);
stopIndex = startStopIndices(2);
figure
subplot(211); hold on
r1 = scatter(measurements(startIndex:stopIndex,1)./86400, prefits(1,:,1), '.','DisplayName', 'Range Pre-fits, Station 1');
r2 = scatter(measurements(startIndex:stopIndex,1)./86400, prefits(1,:,2), '.','DisplayName', 'Range Pre-fits, Station 2');
r3 = scatter(measurements(startIndex:stopIndex,1)./86400, prefits(1,:,3), '.','DisplayName', 'Range Pre-fits, Station 3');
b1 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [3*5/1000, 3*5/1000], 'k--', 'DisplayName', '3\sigma Bounds');
b2 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [-3*5/1000, -3*5/1000], 'k--'); hold off
if nargin>4
ylim(ylimRange)
end
legend([r1 r2 r3 b1])
ylabel('[km]')
title('Pre-fits');
subplot(212); hold on
rr1 = scatter(measurements(startIndex:stopIndex,1)./86400, prefits(2,:,1), '.','DisplayName', 'Range-Rate Pre-fits, Station 1');
rr2 = scatter(measurements(startIndex:stopIndex,1)./86400, prefits(2,:,2), '.','DisplayName', 'Range-Rate Pre-fits, Station 2');
rr3 = scatter(measurements(startIndex:stopIndex,1)./86400, prefits(2,:,3), '.','DisplayName', 'Range-Rate Pre-fits, Station 3');
b1 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [3*0.5/1e6, 3*0.5/1e6], 'k--', 'DisplayName', '3\sigma Bounds');
b2 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [-3*0.5/1e6, -3*0.5/1e6], 'k--'); hold off
if nargin>4
ylim(ylimRangeRate)
end
legend([rr1 rr2 rr3 b1])
ylabel('[km/s]')
xlabel('Time [days]')
figure
subplot(211); hold on
r1 = scatter(measurements(startIndex:stopIndex,1)./86400, postfits(1,:,1), '.','DisplayName', 'Range Pre-fits, Station 1');
r2 = scatter(measurements(startIndex:stopIndex,1)./86400, postfits(1,:,2), '.','DisplayName', 'Range Pre-fits, Station 2');
r3 = scatter(measurements(startIndex:stopIndex,1)./86400, postfits(1,:,3), '.','DisplayName', 'Range Pre-fits, Station 3');
b1 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [3*5/1000, 3*5/1000], 'k--', 'DisplayName', '3\sigma Bounds');
b2 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [-3*5/1000, -3*5/1000], 'k--'); hold off
if nargin>4
ylim(ylimRange)
end
legend([r1 r2 r3 b1])
ylabel('[km]')
title('Post-fits');
subplot(212); hold on
rr1 = scatter(measurements(startIndex:stopIndex,1)./86400, postfits(2,:,1), '.','DisplayName', 'Range-Rate Post-fits, Station 1');
rr2 = scatter(measurements(startIndex:stopIndex,1)./86400, postfits(2,:,2), '.','DisplayName', 'Range-Rate Post-fits, Station 2');
rr3 = scatter(measurements(startIndex:stopIndex,1)./86400, postfits(2,:,3), '.','DisplayName', 'Range-Rate Post-fits, Station 3');
b1 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [3*0.5/1e6, 3*0.5/1e6], 'k--', 'DisplayName', '3\sigma Bounds');
b2 = plot([measurements(startIndex,1), measurements(stopIndex,1)]./86400, [-3*0.5/1e6, -3*0.5/1e6], 'k--'); hold off
if nargin>4
ylim(ylimRangeRate)
end
legend([rr1 rr2 rr3 b1])
ylabel('[km/s]')
xlabel('Time [days]')
end