% Script loads multiple runs for SXU1 tension coil runs and plots them and
% then does some analysis.
Plot_gap_int_plt(1)
Plot_gap_int_plt(2)
close all
% plot integrals
figure
plot(Time_plus1, Integral_plus_mean1, marker_make3(1))
hold
plot(Time_plus2+Time_plus1(end)+0.25, Integral_plus_mean2, marker_make3(2))
legend('Run 1 Plus Integral', 'Run 2 Plus Integral')
hline(GI_run1.corr_Integral_plus_mean, 'b-',['Mean Plus Integral = ', num2str(GI_run1.corr_Integral_plus_mean)]);
hline(GI_run2.corr_Integral_plus_mean, 'r-',['Mean Plus Integral = ', num2str(GI_run2.corr_Integral_plus_mean)]);
xlabel('Time (hours)');
xlabel('Plus Integral (Vs)');
title('Plus Integral vs Time for Multiple Runs');

% plot temperatures
figure
plot(Time_plus1, Temp_Ambient_mean_plus1, marker_make3(1))
hold
plot(Time_plus2+Time_plus1(end)+0.25, Temp_Ambient_mean_plus2, marker_make3(2))
plot(Time_plus1, Temp_Module_mean_plus1, marker_make3(3))
plot(Time_plus2+Time_plus1(end)+0.25, Temp_Module_mean_plus2, marker_make3(4))

legend('Ambient Temp Run 1', 'Ambient Temp Run 2', 'Carrier Temp Run 1', 'Carrier Temp Run 2')

xlabel('Time (hours)');
xlabel('Temperature (C)');
title('Temperatures vs Time for Multiple Runs');



 %% SXU Temperatures and Integral on same plot      
     figure('units','normalized','outerposition',[0 0 1 1])
     plot(Time_plus1, Temp_Ambient_mean_plus1, marker_make3(1))
     hold
     plot(Time_plus2+Time_plus1(end)+0.25, Temp_Ambient_mean_plus2, marker_make3(2))
     plot(Time_plus1, Temp_Module_mean_plus1, marker_make3(3))
      plot(Time_plus2+Time_plus1(end)+0.25, Temp_Module_mean_plus2, marker_make3(4))
     xlabel('Time (Hours)');
     ylabel('SXU1 Temperatures (C)');
     title('SXU1 Temperatures and Integral vs Time Run '); 
     yyaxis right
     
     plot(Time_plus1, Integral_plus_mean1, marker_make3(5))
     plot(Time_plus2+Time_plus1(end)+0.25, Integral_plus_mean2, marker_make3(6))
     legend()
%      hline(GI_run1.corr_Integral_plus_mean, marker_make3(5),['Mean Plus Integral = ', num2str(GI_run1.corr_Integral_plus_mean)]);
%      hline(GI_run2.corr_Integral_plus_mean,  marker_make3(6),['Mean Plus Integral = ', num2str(GI_run2.corr_Integral_plus_mean)]);
     ylabel('Plus Integral - No Temp Corr (Vs)');
     
     legend('Ambient Temp Run 1', 'Ambient Temp Run 2', 'Carrier Temp Run 1', 'Carrier Temp Run 2', 'Run 1 Plus Integral', 'Run 2 Plus Integral', 'Location','northeast')
     print(strcat('Temp and Int vs Time SXU1 TCRM.png'), '-dpng', '-r0');
      fig_name = gcf;
      
      
      set(fig_name,'Name', 'Temp and Int vs Time SXU1 TCRM');
