%CPF_sci_plot1.m

clear;

fp = '2016Aug23';
path = sprintf( '../%s/parsed/CPF%s.mat',fp,fp);
load(path);


for i=1:size(P,1)
    for j=1:size(P,2)
        X(i,j)=i;
    end
end

for i=1:size(FL,1)
    for j=1:size(FL,2)
        if(FL(i,j)> 500)FL(i,j)=NaN;end
    end
end

maxdepth = max(max(P));
maxdepth = 70;

figure(1); title('CPF 23MAR16');
subplot(2,2,1); hold on;
hold on;
for i=1:size(P,1)
    t(1:size(P,2))=CPtime(i);
     %scatter(X(i,:),-P(i,:),25,T(i,:),'filled');
     scatter(t,-P(i,:),25,T(i,:),'filled');
end
colorbar;
%contour(X(:,:),-P(:,:),T(:,:));
ylabel('dBar');
%xlabel('cast');
title('degC');
axis([min(CPtime) max(CPtime) -(maxdepth+5) 0]);
datetick('x','HH','keeplimits');
caxis([5 20])

subplot(2,2,2); hold on;
for i=1:size(P,1)
    t(1:size(P,2))=CPtime(i);
    scatter(t,-P(i,:),25,S(i,:),'filled');
end
colorbar;
ylabel('dBar');
%xlabel('cast');
title('PSU');
axis([min(CPtime) max(CPtime) -(maxdepth+5) 0]);
datetick('x','HH','keeplimits');
caxis([32.5 34])

subplot(2,2,3); hold on;
for i=1:size(O2,1)
    t(1:size(P,2))=CPtime(i);
    scatter(t,O2d(i,:),25,O2(i,:),'filled','s');
end
colorbar;
title('O2');
ylabel('dBar');
%xlabel('cast');
axis([min(CPtime) max(CPtime) -(maxdepth+5) 0]);
datetick('x','HH','keeplimits');

subplot(2,2,4); hold on;
for i=1:size(FL,1)
    t(1:size(P,2))=CPtime(i); 
    scatter(t,FLd(i,:),25,FL(i,:),'filled');
end
colorbar;
title('flbb');
ylabel('dBar');
%xlabel('cast');
axis([min(CPtime) max(CPtime) -(maxdepth+5) 0]);
datetick('x','HH','keeplimits');


figure;
subplot(3,1,1); hold on;
for i=1:size(FL,1)
    t(1:size(P,2))=CPtime(i); 
    scatter(t,FLd(i,:),15,FL(i,:),'filled');
end
colorbar;
title('flr sig');
ylabel('dBar');
%xlabel('cast');
axis([min(CPtime) max(CPtime) -(maxdepth+5) 0]);
datetick('x','HH','keeplimits');
grid on;

subplot(3,1,2); hold on;
for i=1:size(BBnm700,1)
    t(1:size(P,2))=CPtime(i); 
    scatter(t,FLd(i,:),15,BBnm700(i,:),'filled');
end
colorbar;
title('700nm sig');
ylabel('dBar');
%xlabel('cast');
axis([min(CPtime) max(CPtime) -(maxdepth+5) 0]);
caxis([0 500]);
datetick('x','HH','keeplimits');
grid on;

subplot(3,1,3); hold on;
for i=1:size(BBnm470,1)
    t(1:size(P,2))=CPtime(i); 
    scatter(t,FLd(i,:),15,BBnm470(i,:),'filled');
end
colorbar;
title('470nm sig');
ylabel('dBar');
%xlabel('cast');
axis([min(CPtime) max(CPtime) -(maxdepth+5) 0]);
caxis([0 200]);
datetick('x','HH','keeplimits');
grid on;
xlabel('Time');

