% Load the positions of the Casts
load Z:\oc415_2\adcp\positions\station.dat
sta_lat = station(1:7,3);
sta_lon = station(1:7,4);

% % Load all data for E-W CTD section (stations 1-7)
% for ii=1:7
%     eval(['load Z:\oc415_2\ctd\process\oc41520', num2str(ii),'.mat'])
%     for jj=1:700
%         index = find( press>(jj-1) & press<=jj );
%         t0_mat(jj,ii) = mean(t0(index));
%         t1_mat(jj,ii) = mean(t1(index));
%         c0_mat(jj,ii) = mean(c0(index));
%         c1_mat(jj,ii) = mean(c1(index));
%         chl_mat(jj,ii)=mean(chl(index));
%         o2_mat(jj,ii) = mean(o2(index));
%         pres_mat(jj,ii) = mean(press(index));
%         par_mat(jj,ii)=mean(par(index));
%         s0_mat(jj,ii) = mean(s0(index));
%         s1_mat(jj,ii) = mean(s1(index));
%     end
% end

% Make a depth vector of all the plots (y-axis)
depth = [1:700];

% Make a contour plot of the loaded temp data
h411 = subplot(411);
contourf(sta_lon,depth,t0_mat,12,'LineStyle','none');
set(gca,'ydir', 'rev')
set(h411,'fontsize',8)
set(h411,'ytick', [100 300 500 700])
pos1 = get(h411,'Position');
pos1(3) = 0.4;
set(h411, 'Position', pos1)
set(h411, 'xtick', [])
h411t = title({'OC415-2, EW CTD Survey, 20Jul2005';'Temperature (C)'});
pos1t = get(h411t,'Position');
pos1t(2) = -65;
set(h411t,'Position', pos1t)
h411c = colorbar;
set(h411c, 'fontsize', 7)
%ylabel('Pressure Depth (db)')
%xlabel('Longitude')
% Add the locations of the profiles
surface=ones(1,7);
sta_num=[1:7];
hold on
plot(sta_lon,surface,'dk', 'MarkerFaceColor','k', 'MarkerSize', 5)
text(sta_lon,(surface*(-45)),int2str(sta_num'),'fontsize',5);
hold off

% Add a salinity plot
h412 = subplot(412);
contourf(sta_lon,depth,s0_mat,[35.9:0.1:37.1],'LineStyle','none')
set(gca,'ydir', 'rev')
set(h412,'fontsize',8)
set(h412,'ytick', [100 300 500 700])
pos2 = get(h412,'Position');
pos2(3) = 0.4;
set(h412, 'Position', pos2)
set(h412, 'xtick', [])
h412t = title('Salinity');
pos2t = get(h412t,'Position');
pos2t(2) = -65;
set(h412t,'Position', pos2t)
h412c = colorbar;
set(h412c, 'fontsize', 7)
%ylabel('Pressure Depth (db)')
%xlabel('Longitude')
% Add the locations of the profiles
surface=ones(1,7);
sta_num=[1:7];
hold on
plot(sta_lon,surface,'dk', 'MarkerFaceColor','k', 'MarkerSize', 5)
text(sta_lon,(surface*(-45)),int2str(sta_num'),'fontsize',5);
hold off

% Add an oxygen saturation plot
h413 = subplot(413);
contourf(sta_lon,depth,o2_mat,15,'LineStyle','none')
set(h413,'fontsize',8)
set(h413,'ytick', [100 300 500 700])
set(gca,'ydir', 'rev')
pos3 = get(h413,'Position');
pos3(3) = 0.4;
set(h413, 'Position', pos3)
set(h413, 'xtick', [])
h413t = title('Oxygen Saturation (%)');
pos3t = get(h413t,'Position');
pos3t(2) = -65;
set(h413t,'Position', pos3t)
h413c = colorbar;
set(h413c, 'fontsize', 7)
hY = ylabel('                                 Pressure Depth (db)');
set(hY, 'FontWeight', 'bold');
%xlabel('Longitude')
% Add the locations of the profiles
surface=ones(1,7);
sta_num=[1:7];
hold on
plot(sta_lon,surface,'dk', 'MarkerFaceColor','k', 'MarkerSize', 5)
text(sta_lon,(surface*(-45)),int2str(sta_num'),'fontsize',5);
hold off

% Add an Chlorophyll Fluorescence plot
h414 = subplot(414);
h414p = contourf(sta_lon,depth,chl_mat,[0:0.1:0.7],'LineStyle','none');
set(gca,'ydir', 'rev')
set(h414,'fontsize',8)
set(h414,'ytick', [100 300 500 700])
pos4 = get(h414,'Position');
pos4(3) = 0.4;
set(h414, 'Position', pos4)
h414t = title('Chlorophyll Flourescence (ug/m^3)');
pos4t = get(h414t,'Position');
pos4t(2) = -65;
set(h414t,'Position', pos4t)
h414c = colorbar;
set(h414c, 'fontsize', 7)
%ylabel('Pressure Depth (db)')
hX = xlabel('Longitude');
set(hX, 'FontWeight', 'bold')
% Add the locations of the profiles
surface=ones(1,7);
sta_num=[1:7];
hold on
plot(sta_lon,surface,'dk', 'MarkerFaceColor','k', 'MarkerSize', 5)
text(sta_lon,(surface*(-45)),int2str(sta_num'),'fontsize',5);
hold off

