% Plot FP 0.060 vs distributed QAR

clear

max_dist = 27000;
min_t = 7200; % plots start at 2 hour
max_t = 96 * 3600; % hours * seconds in an hour - gives seconds
peak_index = [180; 300; 180; 300; 180; 300];

load(['/Users/Colin/Documents/MATLAB/DFlow/influences_chap2/QAR_cells/'...
    'xs_fp060_cell.mat']);
load(['/Users/Colin/Documents/MATLAB/DFlow/influences_chap2/QAR_cells/'...
    'xs_fpdist_cell.mat']);

%% Plot attenuation ratio
h = figure(1);
h.Units = 'inches';
%h.Position = [1 1 11 15];
h.PaperSize = [8.5 11];
set(gcf,'color','white');
xs_dist = (250:250:max_dist)/1000;
for i = 1:6
        
    fp060_attenuation = xs_fp060_cell{i,9};
    fpdist_attenuation = xs_fpdist_cell{i,9};
    
    max_dist_id = max_dist/250;
    
    subplot(3,2,i);
    p1=plot(xs_dist(1:max_dist_id),...
        fp060_attenuation(1:max_dist_id,1),'k-');
    hold on
    p2=plot(xs_dist(1:max_dist_id),...
        fpdist_attenuation(1:max_dist_id,1),'r-');
    if i == 1
        ylim([0.7 1]);
    elseif i == 2
        ylim([0.7 1]);
    elseif i == 3
        ylim([0.8 1]);
        ylabel('Discharge Attenuation Ratio');
    elseif i == 4
        ylim([0.8 1]);
    elseif i == 5 
        ylim([0.9 1]);
        xlabel('Downstream distance (km)');
        legend([p1 p2 p3 p4],'FP 0.040','FP 0.060','FP 0.080',...
            'FP 0.100','Location','southwest');
        legend('boxoff');
    elseif i == 6
        ylim([0.9 1]);
        xlabel('Downstream distance (km)');
        legend([p5 p6 p7],'B 0.040','B 0.80','B 0.100',...
            'Location','southwest');
        legend('boxoff');
    end
    xlim([0 28]);
    set(gca,'Fontsize',14);
    
end