% this file takes ADCP data from rdradcp process,
% file trims time sequence, depth, rotates to major/minor axis,
% 
% Justin Rogers, stanford efml, 9/2012

run presentation_plot
clc, clear all, close all;

files=dir('ADCP_Processed*');

%% select file to plot
load(files(1).name);

%% plots

p=figure(1);
plot([-1 1],[0 0],'--k',[0 0],[-1 1],'--k'); 
hold on;
scatter(U,V)
title('Figure 1, Depth-Averaged Velocity');
xlabel('Depth-Avg East (u) (m/s)');
ylabel('Depth-Avg North (v) (m/s)');
axis([-0.5 0.5 -0.5 0.5]);
hgsave('figure1.fig');

p=figure(2);
plot([-1 1],[0 0],'--k',[0 0],[-1 1],'--k');
hold on;
scatter(Urot,Vrot)
title('Figure 2, Depth Averaged Rotated Velocity');
xlabel('Depth-Avg Major (u) (m/s)');
ylabel('Depth-Aveg Minor (v) (m/s)');
axis([-0.5 0.5 -0.5 0.5]);
hgsave('figure2.fig');

%% plot vertical profiles

p=figure(3);
subplot(3,1,1),
imagesc(mtime_proc,bin_height_good,maj_vel_avg_rot); colormap('french');shading flat;
set(gca,'ydir','normal');
hold on; plot(mtime_proc,depth_proc,'-b');
ylim([min(bin_height_good) max(depth_proc)]);
q=colorbar; caxis([-0.35 0.35])
datetickzoom('x');
ylabel(q,'Alongshore (m/s)'); 
ylabel('MAB (m)');
title('Figure 3 Velocity Profiles (10 min filter)');

subplot(3,1,2),
imagesc(mtime_proc,bin_height_good,min_vel_avg_rot); colormap('french');shading flat;
set(gca,'ydir','normal');
q=colorbar; %caxis([-0.25 0.25])
datetickzoom('x');
ylabel(q,'Cross Shore (m/s)'); 
ylabel('MAB (m)');

subplot(3,1,3),
imagesc(mtime_proc,bin_height_good,vert_vel_avg); colormap('french');shading flat;
set(gca,'ydir','normal');
q=colorbar; %caxis([-0.06 0.06])
datetickzoom('x');
ylabel(q,'w (m/s)'); 
xlabel('Date'); ylabel('MAB (m)');

hgsave('figure3.fig');

%%
figure(4)
subplot(2,1,1); plot(mtime_proc,U)
datetick('x')
ylabel('U-east (m/s)')
subplot(2,1,2); plot(mtime_proc,V)
datetick('x')
ylabel('V-north (m/s)')
xlabel('date')
hgsave('figure4.fig');

%%
figure(5)
subplot(2,1,1); plot(mtime_proc,Urot)
datetick('x')
ylabel('U-major (m/s)')
subplot(2,1,2); plot(mtime_proc,Vrot)
datetick('x')
ylabel('V-minor (m/s)')
xlabel('date')
hgsave('figure5.fig');