

cd /Volumes/arguk/ASFS/asfs_efoy_labtest1_feb13/

x = importdata('ASFS_Test_ASFS_sumfile.dat');

efoy10_dn = datenum(char(x.textdata(5:end,1)),'yyyy-mm-dd HH:MM:SS');
efoy10_error_code = x.data(:,30);
efoy10_fuel = x.data(:,29)./10;
efoy10_T = x.data(:,28)./10;
efoy10_load = x.data(:,27)./10;
efoy10_V = x.data(:,26)./10;

x = importdata('ASFS_Test_ASFS_1min_part1.dat');
dn1 = datenum(char(x.textdata(3:end,1)),'yyyy-mm-dd HH:MM:SS');
PTemp1 = x.data(:,2);
batt_volt1 = x.data(:,3);
counts_main1 = x.data(:,4);
call_time1 = x.data(:,8);
rh1 = x.data(:,27);
t1 = x.data(:,29);
efoy_fuel1 = dn1.*NaN;
efoy_T1 = dn1.*NaN;
efoy_load1 = dn1.*NaN;
efoy_V1 = dn1.*NaN;
efoy_ec1 = dn1.*NaN;

x = importdata('ASFS_Test_ASFS_1min_part2.dat');
dn2 = datenum(char(x.textdata(3:end,1)),'yyyy-mm-dd HH:MM:SS');
PTemp2 = x.data(:,2);
batt_volt2 = x.data(:,3);
counts_main2 = x.data(:,4);
call_time2 = x.data(:,8);
rh2 = x.data(:,27);
t2 = x.data(:,29);
efoy_fuel2 = x.data(:,end-1);
efoy_T2 = x.data(:,end-2);
efoy_load2 = x.data(:,end-3);
efoy_V2 = x.data(:,end-4);
efoy_ec2 = x.data(:,end);

dn = [dn1;dn2];
PTemp = [PTemp1;PTemp2];
batt_volt = [batt_volt1;batt_volt2];
counts_main = [counts_main1;counts_main2];
call_time = [call_time1;call_time2];
rh = [rh1;rh2];
t = [t1;t2];
efoy_fuel = [efoy_fuel1;efoy_fuel2]; efoy_fuel(136) = NaN;
efoy_T = [efoy_T1;efoy_T2]; efoy_T(136) = NaN;
efoy_load = [efoy_load1;efoy_load2]; efoy_load(136) = NaN;
efoy_V = [efoy_V1;efoy_V2]; efoy_V(136) = NaN;
efoy_ec = [efoy_ec1;efoy_ec2]; efoy_ec(136) = NaN;

cd /Volumes/arguk/ASFS/asfs_efoy_labtest1_feb13/plots/

plot(efoy10_dn,efoy10_T,'linewidth',2); hold on;
plot(dn,efoy_T,'linewidth',2);
plot(dn,PTemp,'linewidth',2);
plot(dn,t,'linewidth',2);
legend('EFOY 10 min','EFOY 1 min','PTemp','Vaisala (room)','location','northwest');
xlabel('Time [DDHH]');
ylabel('Temperature [C]');
title('ASFS CIRES Lab Test, Feb 13-14');
grid on;
set(gca,'ytick',20:2:46,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
xlim([datenum([2019 2 13 18 0 0]) datenum([2019 2 14 9 0 0])]);
datetick('x','ddhh','keepticks','keeplimits');
set(gca,'fontname','times','fontsize',12);
set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 20 16]);      % 1 column, square
print -dpng temps.png


yyaxis left
plot(efoy10_dn,efoy10_V,'linewidth',2); hold on;
plot(dn,efoy_V,'linewidth',2);
ylabel('Battery Voltage [V]');
set(gca,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
set(gca,'fontname','times','fontsize',12);
ylim([25 26]);
yyaxis right
plot(dn,batt_volt,'linewidth',2);
legend('EFOY 10 min','EFOY 1 min','Logger','location','northwest');
xlabel('Time [DDHH]');
ylabel('Battery Voltage [V]');
title('ASFS CIRES Lab Test, Feb 13-14');
ylim([12 13]);
grid on;
set(gca,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
xlim([datenum([2019 2 13 18 0 0]) datenum([2019 2 14 9 0 0])]);
datetick('x','ddhh','keepticks','keeplimits');
set(gca,'fontname','times','fontsize',12);
set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 20 16]);      % 1 column, square
print -dpng volts.png



plot(efoy10_dn,efoy10_error_code,'linewidth',2); hold on;
plot(dn,efoy_ec,'linewidth',2);
legend('EFOY 10 min','EFOY 1 min','location','northwest');
xlabel('Time [DDHH]');
ylabel('Error Code');
title('ASFS CIRES Lab Test, Feb 13-14');
grid on;
set(gca,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
xlim([datenum([2019 2 13 18 0 0]) datenum([2019 2 14 9 0 0])]);
datetick('x','ddhh','keepticks','keeplimits');
set(gca,'fontname','times','fontsize',12);
set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 20 16]);      % 1 column, square
print -dpng efoy_error.png


plot(efoy10_dn,efoy10_fuel,'linewidth',2); hold on;
plot(dn,efoy_fuel,'linewidth',2);
legend('EFOY 10 min','EFOY 1 min','location','southwest');
xlabel('Time [DDHH]');
ylabel('Fuel Remaining [%]');
title('ASFS CIRES Lab Test, Feb 13-14');
grid on; ylim([0 100]);
set(gca,'ytick',0:5:100,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
xlim([datenum([2019 2 13 18 0 0]) datenum([2019 2 14 9 0 0])]);
datetick('x','ddhh','keepticks','keeplimits');
set(gca,'fontname','times','fontsize',12);
set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 20 16]);      % 1 column, square
print -dpng efoy_fuel.png



plot(efoy10_dn,efoy10_load,'linewidth',2); hold on;
plot(dn,efoy_load,'linewidth',2);
legend('EFOY 10 min','EFOY 1 min','location','southwest');
xlabel('Time [DDHH]');
ylabel('EFOY Load [A]');
title('ASFS CIRES Lab Test, Feb 13-14');
grid on;
set(gca,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
xlim([datenum([2019 2 13 18 0 0]) datenum([2019 2 14 9 0 0])]);
datetick('x','ddhh','keepticks','keeplimits');
set(gca,'fontname','times','fontsize',12);
set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 20 16]);      % 1 column, square
print -dpng efoy_load.png


plot(efoy10_dn,efoy10_load,'linewidth',2); hold on;
plot(dn,efoy_load,'linewidth',2);
legend('EFOY 10 min','EFOY 1 min','location','south');
xlabel('Time [HHMM]');
ylabel('EFOY Load [A]');
title('ASFS CIRES Lab Test, Feb 13-14');
grid on;
set(gca,'xtick',datenum([2019 2 13 22 0 0]):5/1440:datenum([2019 2 13 23 0 0]));
xlim([datenum([2019 2 13 22 0 0]) datenum([2019 2 13 23 0 0])]);
datetick('x','hhMM','keepticks','keeplimits');
set(gca,'fontname','times','fontsize',12);
set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 20 16]);      % 1 column, square
print -dpng efoy_load_zoom.png



yyaxis left
plot(dn,rh,'linewidth',2); hold on; %ylim([0 100]);
ylabel('Room RH [%]');
set(gca,'ytick',0:1:100,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
set(gca,'fontname','times','fontsize',12);
yyaxis right
plot(dn,t,'linewidth',2); hold on;
ylabel('Room Temperature [%]');
xlabel('Time [DDHH]');
ylabel('Temperature [C]');
title('ASFS CIRES Lab Test, Feb 13-14');
grid on;
set(gca,'xtick',datenum([2019 2 13 18 0 0]):1/24:datenum([2019 2 14 9 0 0]));
xlim([datenum([2019 2 13 18 0 0]) datenum([2019 2 14 9 0 0])]);
datetick('x','ddhh','keepticks','keeplimits');
set(gca,'fontname','times','fontsize',12);
set(gcf,'PaperPositionMode','manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 20 16]);      % 1 column, square
print -dpng room.png
