% Plots water surface elevations of historical and 2010 Rio Grande,
% assuming his_extract_chap1.m has been run

% f1=figure(1);
% set(f1,'Color','white');
% 
% for i=1:folder_num
% 
%     max_wse_hist = obs_wse_hist_cell{i,5};
%     max_wse_2010 = obs_wse_2010_cell{i,5};
%     obs_dist_2010 = obs_wse_2010_cell{i,6};
%     obs_dist_hist = obs_wse_hist_cell{i,6};
%     
%     subplot(3,2,i)
%     plot(obs_dist_hist(:,1),max_wse_hist(:,3))
%     hold on
%     plot(obs_dist_2010(:,1),max_wse_2010(:,3))
%     
% end

% Plot attenuation of WSE
f2=figure(2);
set(f2,'Color','white');

for j=1:folder_num

    max_wse_hist = obs_wse_hist_cell{j,8};
    max_wse_2010 = obs_wse_2010_cell{j,8};
    max_wse_2010lidar = obs_wse_2010lidar_cell{j,8};
    max_wse_prelidar = obs_wse_prelidar_cell{j,8};
    obs_dist_2010 = obs_wse_2010_cell{j,6};
    obs_dist_hist = obs_wse_hist_cell{j,6};
    obs_dist_2010lidar = obs_wse_2010lidar_cell{j,6};
    obs_dist_prelidar = obs_wse_prelidar_cell{j,6};
    
%     subplot(3,2,j)
%     plot(obs_dist_hist(:,1)/1000,max_wse_hist(:,1))
%     hold on
%     plot(obs_dist_2010(:,1)/1000,max_wse_2010(:,1))
%     plot(obs_dist_prelidar(:,1)/1000,max_wse_prelidar(:,1),'--')
%     plot(obs_dist_2010lidar(:,1)/1000,max_wse_2010lidar(:,1),'--')
%     if mod(j,2) == 1
%         ylim([0.9 1]);
%     elseif mod(j,2) == 0
%         ylim([0.95 1]);
%     end
% 
%     if j == 5
%         xlabel('Distance downstream (km)');
%     elseif j == 3
%         ylabel('Stage Attenuation Ratio');
%     elseif j == 6
%         xlabel('Distance downstream (km)');
%         columnlegend(2,{'HC','CC','PL','CL'},'Location','SouthEast');
%     end
%     xlim([0 27])
%     set(gca,'FontSize',14);

    subplot(3,2,j)
    plot(obs_dist_hist(obs_dist_hist(:,1)~=12250,1)/1000,...
        max_wse_hist(obs_dist_hist(:,1)~=12250,1))
    hold on
    plot(obs_dist_2010(:,1)/1000,max_wse_2010(:,1),'--')
    plot(obs_dist_prelidar(:,1)/1000,max_wse_prelidar(:,1),'-.')
    plot(obs_dist_2010lidar(:,1)/1000,max_wse_2010lidar(:,1),':')
    if mod(j,2) == 1
        ylim([0.9 1]);
    elseif mod(j,2) == 0
        ylim([0.9 1]);
    end

    if j == 5
        xlabel('Distance downstream (km)');
    elseif j == 3
        ylabel('Stage Attenuation Ratio');
    elseif j == 6
        xlabel('Distance downstream (km)');
        columnlegend(2,{'HC','CC','PL','CL'},'Location','SouthEast');
    end
    xlim([0 27])
    set(gca,'FontSize',14);
end