% runs plots after calibration

close all
clear all
warning('off')

%% APEX DATA, FLOAT 0005
load 'C:\Documents and Settings\Lisa Taylor\My Documents\Data\APEX\0005\apex_data_comparison'

% apex_data_comparison.mat contains:
  % pressure_apex
  % temp_apex
  % sal_apex
  % oxygen_apex
  % blueRef_apex
  % blueSig_apex
  % LSSRef_apex
  % LSSSig_apex
  % theta_apex
  % sigma_apex
  % O2sat_apex
  % O2_apex
  % Chl_apex
  % B_LSS_apex
  % date_apex (y m d h m s)
  % tt_apex, which is datenum(2004,6,17)+data_apex(:,16)
  % t_apex, which is 168+data_apex(:,16);
  % B_LSS_b_apex, which is (((LSSSig_apex-51.8)*0.00004637) instrument-calibrated
  % cp_apex, which is B_LSS_apex*63;
  % cp_b_apex, which is B_LSS_b_apex*63;
  % chl_b_apex, which is (((blueSig_apex-25)*0.01079772) instrument-calibrated
  % POC_b_apex, which is 10000* the corrected B_LSS_b_apex;

  %clear unnecessary variables from workspace
clear dat0*;
clear dat1*;
clear date0*; 
clear date1*;
clear pos*; 

% strutton calibrations:
B_LSS_b_apex=B_LSS_b_apex/4.4260;
chl_b_apex=chl_b_apex/2.7350;

allApex=[date_apex, pressure_apex, temp_apex, sal_apex, oxygen_apex, chl_b_apex, B_LSS_b_apex]; % create one array to work with

%% STRUTTON CHL NIGHT ONLY
load 'C:\Documents and Settings\Lisa Taylor\My Documents\Data\COASOSU\chl_night'
% chl_night.mat contains:
  % date_night at chlNight(:,1) (needs correction, see below)
  % chl_2m_night at chlNight(:,2) 
  % chl_5m_night at chlNight(:,3)
  % chl_10m_night at chlNight(:,4)
  % chl_15m_night at chlNight(:,5)
  % chl_20m_night at chlNight(:,6)
time_strut=datenum(2004,1,1)+chlNight(:,1)-1; % Strutton date changed to 2004
% chlNightAll=[time_strut,chl_2m_night,chl_5m_night,chl_10m_night,chl_15m_night,chl_20m_night,];

%% STRUTTON DATA (other than chl night)
load 'C:\Documents and Settings\Lisa Taylor\My Documents\Data\COASOSU\ps-compile'
% ps-compile.mat contains:
  % PsCompile (6977x38), containing:
  % 1 date_pscompile (all arrays 6977x1)
  % 2 exceldate_pscompile
  % 3 year_day_pscompile
  % 4 lon_pscompile
  % 5 lat_pscompile
  % 6 flr_2m_pscompile
  % 7 chl_2m_pscompile
  % 8 flr_10m_pscompile
  % 9 chl_10m_pscompile
  % 10 flr_15m_pscompile
  % 11 chl_15m_pscompile
  % 12 b100_2m_pscompile
  % 13 b125_2m_pscompile
  % 14 b150_2m_pscompile
  % 15 b_back_2m_pscompile
  % 16 b100_10m_pscompile
  % 17 b125_10m_pscompile
  % 18 b150_10m_pscompile
  % 19 b_back_10m_pscompile
  % 20 b100_15m_pscompile
  % 21 b125_15m_pscompile
  % 22 b150_15m_pscompile
  % 23 b_back_15m_pscompile
  % 24 par_1m_pscompile
  % 25 unknown_1m_pscompile
  % 26 par_5m_pscompile
  % 27 flr_5m_pscompile
  % 28 par_10m_pscompile
  % 29 c_10m_pscompile
  % 30 par_20m_pscompile
  % 31 flr_20m_pscompile
  % 32 par_35m_pscompile
  % 33 c_35m_pscompile
  % 34 poc_bb_2m_pscompile
  % 35 poc_bb_10m_pscompile
  % 36 poc_beamc_10m_pscompile
  % 37 poc_bb_15m_pscompile
  % 38 poc_beamc_35m_pscompile

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CHLOROPHYLL PROGRAMS
% set apex depth range
I1=find(allApex(:,2)<11.1 & allApex(:,2)>4.9); % apex depths from 5 to 11m
I2=find(allApex(:,2)<17.1 & allApex(:,2)>11.9); % apex depths from 12 to 17m
I3=find(allApex(:,2)<22.1 & allApex(:,2)>17.9); % apex depths from 18 to 22m
% match strutton 24-hr night data with apex chlorophyll for 10, 15, and 20m

% get apex measurements taken between 5 and 11m
apex10m(:,1)=date_apex(I1);
apex10m(:,2)=pressure_apex(I1);
apex10m(:,3)=temp_apex(I1);
apex10m(:,4)=sal_apex(I1);
apex10m(:,5)=oxygen_apex(I1);
apex10m(:,6)=chl_b_apex(I1);
apex10m(:,7)=B_LSS_b_apex(I1);

% get apex measurements taken between 12 and 17m
apex15m(:,1)=date_apex(I2);
apex15m(:,2)=pressure_apex(I2);
apex15m(:,3)=temp_apex(I2);
apex15m(:,4)=sal_apex(I2);
apex15m(:,5)=oxygen_apex(I2);
apex15m(:,6)=chl_b_apex(I2);
apex15m(:,7)=B_LSS_b_apex(I2);

% get apex measurements taken between 18 and 22m
apex20m(:,1)=date_apex(I3);
apex20m(:,2)=pressure_apex(I3);
apex20m(:,3)=temp_apex(I3);
apex20m(:,4)=sal_apex(I3);
apex20m(:,5)=oxygen_apex(I3);
apex20m(:,6)=chl_b_apex(I3);
apex20m(:,7)=B_LSS_b_apex(I3);

%% match strutton data to within 24 hours of apex measurements by depth
%% 10m
strutbin_mean_chl_10m = nan(size(apex10m,1),size(chlNight,2)); % initialize meaned array (entire data set) to size you want
strutbin_std_chl_10m = nan(size(apex10m,1),size(chlNight,2)); % initialize std deviation arrray
hours12a=datenum(0,0,0,12,0,0); % set range of hours to include in meaned values, 12 hrs either side of apex data

for mn=1:size(apex10m,1)
   thisApexDateChl_10m=apex10m(mn,1); 
   idx10=find((time_strut>=(thisApexDateChl_10m-hours12a)) & (time_strut<=thisApexDateChl_10m+hours12a)); % get all strutton within 24hrs of apex data
   strutbin_mean_chl_10m(mn,1)=mean(chlNight(idx10,4)); % get mean of 24hr strutton at 10m
   strutbin_std_chl_10m(mn,1)=std(chlNight(idx10,4)); % get std dev of 24hr strutton at 10m
end

% put into one array for regression analysis
chlReg10m=[apex10m(:,1), apex10m(:,6), strutbin_mean_chl_10m(:,1)];

%% 15m
strutbin_mean_chl_15m = nan(size(apex15m,1),size(chlNight,2)); % initialize meaned array (entire data set) to size you want
strutbin_std_chl_15m = nan(size(apex15m,1),size(chlNight,2)); % initialize std deviation arrray

for mn=1:size(apex15m,1)
   thisApexDateChl_15m=apex15m(mn,1); 
   idx15=find((time_strut>=(thisApexDateChl_15m-hours12a)) & (time_strut<=thisApexDateChl_15m+hours12a)); % get all strutton within 24hrs of apex data
   strutbin_mean_chl_15m(mn,1)=mean(chlNight(idx15,5)); % get mean of 24hr strutton at 15m
   strutbin_std_chl_15m(mn,1)=std(chlNight(idx15,5)); % get std dev of 24hr strutton at 15m
end

% put into one array for regression analysis
chlReg15m=[apex15m(:,1), apex15m(:,6), strutbin_mean_chl_15m(:,1)];

%% 20m
strutbin_mean_chl_20m = nan(size(apex20m,1),size(chlNight,2)); % initialize meaned array (entire data set) to size you want
strutbin_std_chl_20m = nan(size(apex20m,1),size(chlNight,2)); % initialize std deviation arrray

for mn=1:size(apex20m,1)
   thisApexDateChl_20m=apex20m(mn,1); 
   idx20=find((time_strut>=(thisApexDateChl_20m-hours12a)) & (time_strut<=thisApexDateChl_20m+hours12a)); % get all strutton within 24hrs of apex data
   strutbin_mean_chl_20m(mn,1)=mean(chlNight(idx20,6)); % get mean of 24hr strutton at 20m
   strutbin_std_chl_20m(mn,1)=std(chlNight(idx20,6)); % get std dev of 24hr strutton at 20m
end

% put into one array for regression analysis
chlReg20m=[apex20m(:,1), apex20m(:,6), strutbin_mean_chl_20m(:,1)];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BACKSCATTER PROGRAMS
% match Strutton data to within 24 hours of Apex
%% 2m
strutbin_mean_b_2m = nan(size(apex10m,1),size(PsCompile,2)); % initialize meaned array (entire data set) to size you want
strutbin_std_b_2m = nan(size(apex10m,1),size(PsCompile,2)); % initialize std deviation array
hours12b=datenum(0,0,0,12,0,0); % set range of hours to include in meaned values, 12 hrs either side of apex data

for la=1:size(apex10m,1)
   thisApexDateB_2m=apex10m(la,1); 
   idx2=find((date_pscompile>=(thisApexDateB_2m-hours12b)) & (date_pscompile<=thisApexDateB_2m+hours12b)); % get all strutton within 24hrs of apex data
   strutbin_mean_b_2m(la,1)=mean(PsCompile(idx2,15)); % get mean of 24hr strutton at 2m
   strutbin_std_b_2m(la,1)=std(PsCompile(idx2,15)); % get std dev of 24hr strutton at 2m
end

% put into one array for regression analysis
bReg2m=[apex10m(:,1), apex10m(:,7), strutbin_mean_b_2m(:,1)];

%% 10m % strutton sensor may be off, try using 2m instead with apex 10m (see above)
strutbin_mean_b_10m = nan(size(apex10m,1),size(PsCompile,2)); % initialize meaned array (entire data set) to size you want
strutbin_std_b_10m = nan(size(apex10m,1),size(PsCompile,2)); % initialize std deviation arrray

for la=1:size(apex10m,1)
   thisApexDateB_10m=apex10m(la,1); 
   idx10=find((date_pscompile>=(thisApexDateB_10m-hours12b)) & (date_pscompile<=thisApexDateB_10m+hours12b)); % get all strutton within 24hrs of apex data
   strutbin_mean_b_10m(la,1)=mean(PsCompile(idx10,19)); % get mean of 24hr strutton at 10m
   strutbin_std_b_10m(la,1)=std(PsCompile(idx10,19)); % get std dev of 24hr strutton at 10m
end

% put into one array for regression analysis
bReg10m=[apex10m(:,1), apex10m(:,7), strutbin_mean_b_10m(:,1)];

%% 15m
strutbin_mean_b_15m = nan(size(apex15m,1),size(PsCompile,2)); % initialize meaned array (entire data set) to size you want
strutbin_std_b_15m = nan(size(apex15m,1),size(PsCompile,2)); % initialize std deviation arrray

for la=1:size(apex15m,1)
   thisApexDateB_15m=apex15m(la,1); 
   idx15=find((date_pscompile>=(thisApexDateB_15m-hours12b)) & (date_pscompile<=thisApexDateB_15m+hours12b)); % get all strutton within 24hrs of apex data
   strutbin_mean_b_15m(la,1)=mean(PsCompile(idx15,23)); % get mean of 24hr strutton at 10m
   strutbin_std_b_15m(la,1)=std(PsCompile(idx15,23)); % get std dev of 24hr strutton at 10m
end

% put into one array for regression analysis
bReg15m=[apex15m(:,1), apex15m(:,7), strutbin_mean_b_15m(:,1)];

%%%%%%%%%%%%%%%%%%%%%% CHLOROPHYLL PLOTS
% figure
% subplot(2,2,1) % all apex data from 5 to 11m and strutton data at 10m 
% plot(date_apex(I1),chl_b_apex(I1),'b.')
% hold on
% plot(time_strut,chl_10m_night,'rx')
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(gca,'XTick',[732099 732129 732160 732191])
% datetick('x', 'mmmyy','keeplimits','keepticks')
% title({'ASIS Buoy (10m)','Float 0005 (5-11m)'})
% hold off
% 
% subplot(2,2,2) % all apex data from 12 to 17m and strutton data at 15m
% plot(date_apex(I2),chl_b_apex(I2),'b.')
% hold on
% plot(time_strut,chl_15m_night,'rx')
% set(gca,'XTick',[732099 732129 732160 732191])
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% datetick('x', 'mmmyy','keeplimits','keepticks')
% title({'ASIS Buoy (15m)','Float 0005 (12-17m)'})
% hold off
% 
% subplot(2,2,3) % all apex data from 18 to 22m and strutton data at 20m
% plot(date_apex(I3),chl_b_apex(I3),'b.')
% hold on
% plot(time_strut,chl_20m_night,'rx')
% set(gca,'XTick',[732099 732129 732160 732191])
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% datetick('x', 'mmmyy','keeplimits','keepticks')
% title({'ASIS Buoy (20m)','Float 0005 (18-22m)'})
% hold off
% % legend('Float 0005','COASOSU')

%%%%%%%%%%%%%%%%% Strutton and Apex vs date -2 y axes
% figure
% subplot(2,2,1) % all apex data from 5 to 11m and strutton data at 10m 
% % plot(date_apex(I1),chl_b_apex(I1),'b.')
% % hold on
% % plot(time_strut,chl_10m_night,'rx')
% [AX,H1,H2] = plotyy(date_apex(I1),chl_b_apex(I1),time_strut,chl_10m_night,'plot');
% set(get(AX(1),'Ylabel'),'String','Counts')
% set(get(AX(2),'Ylabel'),'String','Chlorophyll')
% set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(1),'XTick',[732099 732129 732160 732191])
% set(AX(2),'XTick',[],'YColor','red')
% datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
% set(H1,'LineStyle','none','Marker','.')
% set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
% title({'ASIS Buoy (10m)','Float 0005 (5-11m)'})
% 
% subplot(2,2,2) % all apex data from 12 to 17m and strutton data at 15m
% plot(date_apex(I2),chl_b_apex(I2),'b.')
% [AX,H1,H2] = plotyy(date_apex(I2),chl_b_apex(I2),time_strut,chl_15m_night,'plot');
% set(get(AX(1),'Ylabel'),'String','Counts')
% set(get(AX(2),'Ylabel'),'String','Chlorophyll')
% set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(1),'XTick',[732099 732129 732160 732191])
% set(AX(2),'XTick',[],'YColor','red')
% datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
% set(H1,'LineStyle','none','Marker','.')
% set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
% title({'ASIS Buoy (15m)','Float 0005 (12-17m)'})
% 
% subplot(2,2,3) % all apex data from 18 to 22m and strutton data at 20m
% [AX,H1,H2] = plotyy(date_apex(I3),chl_b_apex(I3),time_strut,chl_20m_night,'plot');
% set(get(AX(1),'Ylabel'),'String','Counts')
% set(get(AX(2),'Ylabel'),'String','Chlorophyll')
% set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(1),'XTick',[732099 732129 732160 732191])
% set(AX(2),'XTick',[],'YColor','red')
% datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
% set(H1,'LineStyle','none','Marker','.')
% set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
% title({'ASIS Buoy (20m)','Float 0005 (18-22m)'})
% % legend('Float 0005','COASOSU')
% 
% subplot(2,2,4)
% plot(strutbin_mean_chl_10m,apex10m(:,6), 'k*')
% hold on
% plot(strutbin_mean_chl_15m,apex15m(:,6), 'k*')
% plot(strutbin_mean_chl_20m,apex20m(:,6), 'k*')
% xlabel('ASIS Buoy')
% ylabel('Float 0005')
% title({'Mean ASIS Buoy Chlorophyll Data Within','24 Hours of Float 0005'})
% % legend('10m','15m','20m')
% hold off

% corrcoef(strutbin_mean_chl_10m,apex10m(:,6)) 

%%%%%%%%%%%%%%%%%%%%%% BACKSCATTER PLOTS
% figure
% % subplot(2,2,1)% all apex data from 5 to 11m and strutton data at 2m
% plot(date_apex(I1),(B_LSS_b_apex(I1)),'b.')
% hold on
% plot(date_pscompile,b_back_2m_pscompile,'rx')
% set(gca,'XTick',[732099 732129 732160 732191])
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% datetick('x', 'mmmyy','keeplimits')
% % xlabel('Date')
% ylabel('bb')
% title({'ASIS Buoy (2m)','Float 0005 (5-11m)'})
% % legend('Float 0005','Strutton')
% hold off
% 
% figure
% % subplot(2,2,2)% all apex data from 5 to 11m and strutton data at 10m
% plot(date_apex(I1),(B_LSS_b_apex(I1)),'b.')
% hold on
% plot(date_pscompile,b_back_10m_pscompile,'rx')
% set(gca,'XTick',[732099 732129 732160 732191])
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% datetick('x', 'mmmyy','keeplimits')
% % xlabel('Date')
% ylabel('Backscatter')
% title({'ASIS Buoy (10m)','Float 0005 (5-11m)'})
% % legend('Float 0005','Strutton')
% hold off
% 
% figure
% % subplot(2,2,3)% all apex data from 12 to 17m and strutton data at 15m
% plot(date_apex(I2),B_LSS_b_apex(I2),'b.')
% hold on
% plot(date_pscompile,b_back_15m_pscompile,'rx')
% set(gca,'XTick',[732099 732129 732160 732191])
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% datetick('x', 'mmmyy','keeplimits')
% xlabel('Date')
% ylabel('bb')
% title({'ASIS Buoy (15m)','Float 0005 (12-17m)'})
% % legend('Float 0005','ASIS Buoy')
% hold off
% 
% figure
% % subplot(2,2,4)
% plot(strutbin_mean_b_2m,apex10m(:,7),'r*')
% hold on
% % plot(strutbin_mean_b_10m,apex10m(:,7),'b*')
% plot(strutbin_mean_b_15m,apex15m(:,7),'g*')
% xlabel('Float 0005')
% ylabel('ASIS Buoy')
% title({'Mean ASIS Buoy bb Data Within','24 Hours of Float 0005'})
% legend('10m','15m','20m')
% hold off

%%%%%%%%%%%%%%% with 2 y axes
% figure
% subplot(2,2,1) % all apex data from 5 to 11m and strutton data at 2m 
% [AX,H1,H2] = plotyy(date_apex(I1),B_LSS_b_apex(I1),date_pscompile,b_back_2m_pscompile,'plot');
% set(get(AX(1),'Ylabel'),'String','Counts')
% set(get(AX(2),'Ylabel'),'String','bb')
% set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(1),'XTick',[732099 732129 732160 732191])
% set(AX(2),'XTick',[],'YColor','red')
% datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
% set(H1,'LineStyle','none','Marker','.')
% set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
% title({'ASIS Buoy (2m)','Float 0005 (5-11m)'})
% 
% subplot(2,2,2) %  all apex data from 5 to 11m and strutton data at 10m
% plot(date_apex(I1),chl_b_apex(I1),'b.')
% [AX,H1,H2] = plotyy(date_apex(I1),chl_b_apex(I1),time_strut,chl_10m_night,'plot');
% set(get(AX(1),'Ylabel'),'String','Counts')
% set(get(AX(2),'Ylabel'),'String','Chlorophyll')
% set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(1),'XTick',[732099 732129 732160 732191])
% set(AX(2),'XTick',[],'YColor','red')
% datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
% set(H1,'LineStyle','none','Marker','.')
% set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
% title({'ASIS Buoy (10m)','Float 0005 (12-17m)'})
% 
% subplot(2,2,3) % all apex data from 12 to 17m and strutton data at 15m
% [AX,H1,H2] = plotyy(date_apex(I2),B_LSS_b_apex(I2),date_pscompile,b_back_15m_pscompile,'plot');
% set(get(AX(1),'Ylabel'),'String','Counts')
% set(get(AX(2),'Ylabel'),'String','bb')
% set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% set(AX(1),'XTick',[732099 732129 732160 732191])
% set(AX(2),'XTick',[],'YColor','red')
% datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
% set(H1,'LineStyle','none','Marker','.')
% set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
% title({'ASIS Buoy (15m)','Float 0005 (12-17m)'})
% % legend('Float 0005','COASOSU')

%%%%%%%%%%%%%%%%% Poster Plots
figure
% subplot(3,2,1) % all apex data from 5 to 11m and strutton data at 10m 
% plot(date_apex(I1),chl_b_apex(I1),'b.')
% hold on
% plot(time_strut,chl_10m_night,'rx')
[AX,H1,H2] = plotyy(date_apex(I1),chl_b_apex(I1),time_strut,chl_10m_night,'plot');
set(get(AX(1),'Ylabel'),'String','Counts')
set(get(AX(2),'Ylabel'),'String','Chlorophyll')
set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
set(AX(1),'XTick',[732099 732129 732160 732191])
set(AX(2),'XTick',[],'YColor','red')
datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
set(H1,'LineStyle','none','Marker','.')
set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
title({'ASIS Buoy (10m)','Float 0005 (5-11m)'})

figure
% subplot(3,2,2) % all apex data from 12 to 17m and strutton data at 15m
plot(date_apex(I2),chl_b_apex(I2),'b.')
[AX,H1,H2] = plotyy(date_apex(I2),chl_b_apex(I2),time_strut,chl_15m_night,'plot');
set(get(AX(1),'Ylabel'),'String','Counts')
set(get(AX(2),'Ylabel'),'String','Chlorophyll')
set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
set(AX(1),'XTick',[732099 732129 732160 732191])
set(AX(2),'XTick',[],'YColor','red')
datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
set(H1,'LineStyle','none','Marker','.')
set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
title({'ASIS Buoy (15m)','Float 0005 (12-17m)'})

figure
% subplot(3,2,3) % all apex data from 18 to 22m and strutton data at 20m
[AX,H1,H2] = plotyy(date_apex(I3),chl_b_apex(I3),time_strut,chl_20m_night,'plot');
set(get(AX(1),'Ylabel'),'String','Counts')
set(get(AX(2),'Ylabel'),'String','Chlorophyll')
set(AX(1),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
set(AX(2),'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
set(AX(1),'XTick',[732099 732129 732160 732191])
set(AX(2),'XTick',[],'YColor','red')
datetick(AX(1),'x', 'mmmyy','keeplimits','keepticks')
set(H1,'LineStyle','none','Marker','.')
set(H2,'LineStyle','none','Marker','x','MarkerEdgeColor','red')
title({'ASIS Buoy (20m)','Float 0005 (18-22m)'})
% legend('Float 0005','COASOSU')

figure
% subplot(3,2,4)
plot(strutbin_mean_chl_10m,apex10m(:,6), 'r*')
hold on
plot(strutbin_mean_chl_15m,apex15m(:,6), 'g*')
plot(strutbin_mean_chl_20m,apex20m(:,6), 'b*')
plot([0 10],[0 10]);
xlabel('ASIS Buoy')
ylabel('Float 0005')
title({'Mean ASIS Buoy Chlorophyll Data Within','24 Hours of Float 0005'})
% legend('10m','15m','20m')
hold off

figure
% subplot(3,2,5)% all apex data from 5 to 11m and strutton data at 2m
plot(date_apex(I1),(B_LSS_b_apex(I1)),'b.')
hold on
plot(date_pscompile,b_back_2m_pscompile,'rx')
set(gca,'XTick',[732099 732129 732160 732191])
set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
datetick('x', 'mmmyy','keeplimits')
% xlabel('Date')
ylabel('bb')
title({'ASIS Buoy (2m)','Float 0005 (5-11m)'})
% legend('Float 0005','Strutton')
hold off

% figure
% % subplot(2,2,2)% all apex data from 5 to 11m and strutton data at 10m
% plot(date_apex(I1),(B_LSS_b_apex(I1)),'b.')
% hold on
% plot(date_pscompile,b_back_10m_pscompile,'rx')
% set(gca,'XTick',[732099 732129 732160 732191])
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% datetick('x', 'mmmyy','keeplimits')
% % xlabel('Date')
% ylabel('Backscatter')
% title({'ASIS Buoy (10m)','Float 0005 (5-11m)'})
% % legend('Float 0005','Strutton')
% hold off

% figure
% % subplot(2,2,3)% all apex data from 12 to 17m and strutton data at 15m
% plot(date_apex(I2),B_LSS_b_apex(I2),'b.')
% hold on
% plot(date_pscompile,b_back_15m_pscompile,'rx')
% set(gca,'XTick',[732099 732129 732160 732191])
% set(gca,'xlim',[datenum('01 jun 2004') datenum('01 sep 2004')])
% datetick('x', 'mmmyy','keeplimits')
% xlabel('Date')
% ylabel('bb')
% title({'ASIS Buoy (15m)','Float 0005 (12-17m)'})
% % legend('Float 0005','ASIS Buoy')
% hold off

figure
% subplot(3,2,6)
plot(strutbin_mean_b_2m,apex10m(:,7),'r*')
hold on
% plot(strutbin_mean_b_10m,apex10m(:,7),'b*')
plot(strutbin_mean_b_15m,apex15m(:,7),'g*')
plot([0 0.01],[0 0.01]);
xlabel('Float 0005')
ylabel('ASIS Buoy')
title({'Mean ASIS Buoy bb Data Within','24 Hours of Float 0005'})
% legend('10m','15m','20m')
hold off