% Reads upstream flood wave text files and plots them

clear 

%% Input files

fpath = ['/Users/Colin/Documents/MATLAB/DFlow/roughness_investigation/'...
    'floods/'];
s180name = 's180peak.csv';
s300name = 's300peak.csv';
m180name = 'm180peak.csv';
m300name = 'm300peak.csv';
l180name = 'l180peak.csv';
l300name = 'l300peak.csv';

s180 = csvread(strcat(fpath,s180name));
s300 = csvread(strcat(fpath,s300name));
m180 = csvread(strcat(fpath,m180name));
m300 = csvread(strcat(fpath,m300name));
l180 = csvread(strcat(fpath,l180name));
l300 = csvread(strcat(fpath,l300name));

%% Plot

h = figure(1);
set(gcf,'color','w');
fsize = 14;
h.Units = 'inches';
%h.Position = [1 1 11 15];
h.PaperSize = [7 6];

hold on
ax = gca;
ax.ColorOrderIndex = 3;
plot(s180(:,1)/60,s180(:,2),'-')
ax = gca;
ax.ColorOrderIndex = 3;
plot(m180(:,1)/60,m180(:,2),'--')
ax = gca;
ax.ColorOrderIndex = 3;
plot(l180(:,1)/60,l180(:,2),'-.')
ax = gca;
ax.ColorOrderIndex = 4;
plot(s300(:,1)/60,s300(:,2),'-')
ax = gca;
ax.ColorOrderIndex = 4;
plot(m300(:,1)/60,m300(:,2),'--')
ax = gca;
ax.ColorOrderIndex = 4;
plot(l300(:,1)/60,l300(:,2),'-.')
hold off
axis([0 92 0 300]);
xlabel('Time (hrs)');
ylabel('Discharge (m^3s^{-1})');
set(gca,'fontsize',fsize)

legend('Moderate 1 day','Moderate 1.5 day','Moderate 3 day',...
    'Major 1 day','Major 1.5 day','Major 3 day')
legend('Location','Northeast')
legend('boxoff')

print('-fillpage',['/Users/Colin/Documents/MATLAB/DFlow/'...
    'mass_Mo_chap3/figures/upstream_waves_d3'],'-dpdf');
