Commit 7ca0b02b authored by Martin Vítek's avatar Martin Vítek
Browse files

Add more graphs

parent 41fccf67
......@@ -97,6 +97,10 @@ out.nativeout(7,:) = get_fit_exp_exp_w_correction( cutted.nativeout.tem
% plot_overlay(104, "Native In", data.time, out.nativein, illumination, threshold);
% plot_overlay(105, "Native Out", data.time, out.nativeout, illumination, threshold);
%% Plot it - comparison of IN and OUT
plot_two_temperatures(150, "Native Exp+Exp+Corr", data.time, out.nativein(7,:), out.nativeout(7,:), illumination, threshold);
plot_two_temperatures(151, "Nickel Exp+Exp+Corr", data.time, out.nickelin(7,:), out.nickelout(7,:), illumination, threshold);
plot_two_temperatures(152, "Gold Exp+Exp+Corr", data.time, out.goldin(7,:), out.goldout(7,:), illumination, threshold);
%% Plot it with Peter's graphs
% Calculate averages
......@@ -150,12 +154,23 @@ end
% plot_diff_orbit(131, "Gold", diff.gold, orbittime, illumination);
% plot_diff_orbit(132, "Native", diff.native, orbittime, illumination);
% plot_diffs_orbit(133, "Differences Synchronized With Orbit", diff, orbittime, illumination);
plot_diffs_orbit_compare(134, "Differences Synchronized With Orbit: Gold", diff.gold, orbittime, illumination);
plot_diffs_orbit_compare(135, "Differences Synchronized With Orbit: Nickel", diff.nickel, orbittime, illumination);
plot_diffs_orbit_compare(136, "Differences Synchronized With Orbit: Native", diff.native, orbittime, illumination);
% plot_diffs_orbit_compare(134, "Differences Synchronized With Orbit: Gold", diff.gold, orbittime, illumination);
% plot_diffs_orbit_compare(135, "Differences Synchronized With Orbit: Nickel", diff.nickel, orbittime, illumination);
% plot_diffs_orbit_compare(136, "Differences Synchronized With Orbit: Native", diff.native, orbittime, illumination);
%% Difference on average
plot_diff_on_avg(140, "Nickel", avg.nickel, diff.nickel);
plot_diff_on_avg(141, "Gold", avg.gold, diff.gold);
plot_diff_on_avg(142, "Native", avg.native, diff.native);
% plot_diff_on_avg(140, "Nickel", avg.nickel, diff.nickel);
% plot_diff_on_avg(141, "Gold", avg.gold, diff.gold);
% plot_diff_on_avg(142, "Native", avg.native, diff.native);
%% Differences between two methods
plot_two_diffs(160, "Native", diff.native(6,:), diff.native(7,:), orbittime);
plot_two_diffs(161, "Nickel", diff.nickel(6,:), diff.nickel(7,:), orbittime);
plot_two_diffs(162, "Gold", diff.gold(6,:), diff.gold(7,:), orbittime);
%% Differences of differences between two methods
plot_two_diffs_of_diffs(170, "Native", diff.native(6,:), diff.native(7,:), orbittime);
plot_two_diffs_of_diffs(171, "Nickel", diff.nickel(6,:), diff.nickel(7,:), orbittime);
plot_two_diffs_of_diffs(172, "Gold", diff.gold(6,:), diff.gold(7,:), orbittime);
function plot_two_diffs(num, name, diff1, diff2, orbittime)
figure(num);
clf;
% t = tiledlayout(1,3);
% title(t, name);
% xlabel (t, {'Orbit [-]'})
% ylabel (t, {'Tdiff [°C]'})
subplot(1,2,1);
% nexttile
plot(orbittime, diff1, '.')
ylim([-2 2])
title(name + ": Exp+Exp");
grid on
grid minor
subplot(1,2,2);
% nexttile
plot(orbittime, diff2, '.')
ylim([-2 2])
title(name + ": Exp+Exp+Correction");
grid on
grid minor
end
\ No newline at end of file
function plot_two_diffs_of_diffs(num, name, diff1, diff2, orbittime)
% Delete equal elements
i=1;
while i <= length(diff1)
if (diff1(i) == diff2(i))
diff1(i) = [];
diff2(i) = [];
orbittime(i) = [];
else
i = i+1;
end
end
figure(num);
clf;
% t = tiledlayout(1,3);
% title(t, name);
% xlabel (t, {'Orbit [-]'})
% ylabel (t, {'Tdiff [°C]'})
subplot(1,2,1);
% nexttile
plot(orbittime, diff1, '.')
ylim([-2 2])
title(name + ": Exp+Exp");
grid on
grid minor
subplot(1,2,2);
% nexttile
plot(orbittime, diff2, '.')
ylim([-2 2])
title(name + ": Exp+Exp+Correction");
grid on
grid minor
end
\ No newline at end of file
function plot_two_temperatures(num, name, time, data_in, data_out, illumination, threshold)
thx = [0 time(end)];
thy = [threshold threshold];
area_color = "#d9d9d9";
figure(num);
clf;
hold on;
area(illumination.value(1:time(end)), -100, 'FaceColor', area_color, 'EdgeColor', area_color);
alpha(0.6)
plot(thx, thy, '-', 'Color', '#b5b5b5');
plot(time, data_in, '.-', 'MarkerSize', 10);
plot(time, data_out, '.-', 'MarkerSize', 10);
hold off
xlim([1, time(end)]);
ylim([-75 95]);
xlabel("t [s]");
ylabel("T [°C]");
title("Fits Comparison: " + name);
legend("Sunshine", "Threshold", "Temp IN", "Temp OUT");
grid on;
grid minor;
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment