% program to plot WOD01 data exported from OCD
clear all
close('all')
load all-chl-ctd
%array allData contains WOD01 ctd data:
date_wod01_ctd=allData(:,1);        %date
lon_wod01_ctd=allData(:,2);         %longitude
lat_wod01_ctd=allData(:,3);         %latitude
dep_wod01_ctd=allData(:,4);         %sample depth
depqf_wod01_ctd=allData(:,5);       %sample depth qualifer flag
temp_wod01_ctd=allData(:,6);        %temperature degrees C
tempqf_wod01_ctd=allData(:,7);      %temperature qualifier flag
sal_wod01_ctd=allData(:,8);         %salinity psu
salqf_wod01_ctd=allData(:,9);       %salinity qualifier flag
o2_wod01_ctd=allData(:,10);         %oxygen ml/l
o2qf_wod01_ctd=allData(:,11);       %oxygen qualifier flag
chl_wod01_ctd=allData(:,12);        %chlorophyll ~$m~#g/l
chlqf_wod01_ctd=allData(:,13);      %chlorophyll qualifier flag
biomass_wod01_ctd=allData(:,14);    %plankton/biomass
biomassqf_wod01_ctd=allData(:,15);  %plankton/biomass qualifier flag
%
load 'C:\Documents and Settings\Lisa Taylor\My Documents\Data\APEX\0005\apex_date_plots'    
% apex_date_plots contains:
% P=dateAdded(:,1);
% T=dateAdded(:,2);
% S=dateAdded(:,3);
% O=dateAdded(:,4);
% BlueRef=dateAdded(:,5);
% BlueSig=dateAdded(:,6);
% LSSRef=dateAdded(:,7);
% LSSSig=dateAdded(:,8);
% theta=dateAdded(:,9);
% sigma=dateAdded(:,10);
% O2sat=dateAdded(:,11);
% O2=dateAdded(:,12);
% Chl=dateAdded(:,13);
% B_LSS=dateAdded(:,14);
% date=dateAdded(:,16);
% B_LSS_b=(LSSSig-51.8)*0.00004637;
% cp=B_LSS*63;
% cp_b=B_LSS_b*63;
% Chl_b=(BlueSig-29)*0.01079772;
% POC_b=10000*B_LSS_b;
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plots WOD01 temperature vs salinity takes awhile
% I=find(salqf_wod01_ctd<8 & tempqf_wod01_ctd<8 & dep_wod01_ctd<201); % find all sal,temp with qualifier flags not equal to 8
% scatter(sal_wod01_ctd(I),temp_wod01_ctd(I),3,-dep_wod01_ctd(I),'filled'),colorbar
% title({'T-S' 'WOD01 Data'})
% ylabel('Temperature [C]')
% xlabel('Salinity [PSU]')
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plots APEX temperature vs salinity
% scatter(S,T,3,-P,'filled'),colorbar
% title({'T-S' 'APEX Data'})
% ylabel('Temperature [C]')
% xlabel('Salinity [PSU]')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% plots WOD01 and APEX temperature vs salinity
% K=find(P<201);
% scatter(S(K),T(K),'mx')
% hold on
% I=find(salqf_wod01_ctd<8 & tempqf_wod01_ctd<8 & dep_wod01_ctd<201); % find all sal with qualifier flags not equal to 8
% scatter(sal_wod01_ctd(I),temp_wod01_ctd(I),3,'b.')
% title({'T-S'})
% ylabel('Temperature [C]')
% xlabel('Salinity [PSU]')
% legend('APEX Data','WOD01Data')
% hold off
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%figure
%subplot(2,2,1)
%hist(temp);
%title({'WOD01 CTD Data','Temperature'});
%subplot(2,2,2)
%hist(dep);
%title({'WOD01 CTD Data','Depth'});
%subplot(2,2,3)
%hist(chl);
%title({'WOD01 CTD Data','Chlorophyll'});
%subplot(2,2,4)
%hist(sal);
%title({'WOD01 CTD Data','Salinity'});
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% figure
% % subplot(2,2,1)
% scatter(temp,-dep,'.');
% xlabel('Temperature [C]')
% ylabel('Depth [ft]')
% title({'WOD01 CTD Data','Temperature vs. Depth'})
% subplot(2,2,2)
% scatter(sal,-dep,'.');
% xlabel('Salinity [C]')
% ylabel('Depth [ft]')
% title({'WOD01 CTD Data','Salinity vs. Depth'})
% subplot(2,2,3)
% scatter(chl,temp,'.');
% xlabel('Chlorophyll [mg/l]')
% ylabel('Temperature [C]')
% title({'WOD01 CTD Data','Chlorophyll vs. Temperature'})
% subplot(2,2,4)
% scatter(chl,-dep,'.');
% xlabel('Chlorophyll [mg/l]')
% ylabel('Depth [ft]')
% title({'WOD01 CTD Data','Chlorophyll vs. Depth'})
% subplot(2,3,5)
% scatter(chl,-dep,'.');
% axis([min(chl),max(chl),-1000,-800])
% xlabel('Chlorophyll [mg/l]')
% ylabel('Depth [ft]')
% title({'WOD01 CTD Data','Chlorophyll vs. Depth'})
% subplot(2,3,6)
% scatter(chl,-dep,'.');
% axis([min(chl),max(chl),-200,-0])
% xlabel('Chlorophyll [mg/l]')
% ylabel('Depth [ft]')
% title({'WOD01 CTD Data','Chlorophyll vs. Depth'})
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% figure
% scatter(date,chl,'.');
% datetick('x','mmmyy')
% axis([min(date),max(date),min(chl),max(chl)])
% xlabel('Date')
% ylabel('Chlorophyll [mg/l]')
% title({'WOD01 CTD Data','Chlorophyll vs. Date'})
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% figure
% hist(temp);
% I=find(temp>0);
% hist(temp(I));
% I=find(chlqf==0);
% I=find(chlqf==8);
% hist(dep(I));
% I=find(800<dep<1000);
% scatter(temp(I),-dep(I),'.');
% axis([min(temp),max(temp),-1000,-800])
% scatter(chl,-dep,'.');
% axis([min(chl),max(chl),-1000,-800])
% axis([min(chl),max(chl),-200,-0])
% scatter(date,chl,'.');
% scatter(date(chlqf==8),chl(chlqf==8),'.');
% scatter(date(dep>900),chl(dep>900),'.');
% datetick('x','mmmyy')
% title({'Chlorophyll OSD Data'})
% title({'Line 1','Line 2, Line 2'})
% xlabel('Concentration [mg/m^3]')
% ylabel('Depth (ft)') 
