load('\\atlas.shore.mbari.org\ProjectLibrary\901805_Coastal_Biogeochemical_Sensing\Spray_Data\24403401\sat_files\24403401_sat.mat');

%%
full = load('\\atlas.shore.mbari.org\ProjectLibrary\901805_Coastal_Biogeochemical_Sensing\Spray_Data\24403401\QC\24403401_QC.mat','s');
%%
secs = eng.secs(:,117:end);
mins = secs ./ 60;
pres = eng.pres(:,117:end);
profs = eng.divenum_ec;
%%
for idx = 117:150
    figure(1)
    clf
    plot(mins(:,idx),pres(:,idx))
    title([num2str(idx)])
    ylim([0 600])
    pause(.1)
end
% set(gca,'ZDir','reverse')
%% 117:150 are loiters
pres_full = full.s.pres;
pH25_full = full.s.pH25atm;
secs_full = full.s.secs;
% idx = 539


%%
idx = 120;
[B] = loadBOG();
BOG2Plot = filterBOG(B, full.s, idx, 50, 1, 10, 1, 1, 0);
figure(1)
clf
plot(full.s.pHin(:,idx),pres_full(:,idx),Color='red')
hold on
plot(full.s.pHin_canb(:,idx),pres_full(:,idx),Color='blue')
scatter(BOG2Plot.pHin,BOG2Plot.pres,Color='green')
set(gca,'YDir','reverse')
title(['prof ',num2str(idx)])
ylim([0 600])
legend('spray','canb','BOG',Location='southeast')
%%
idx = 539;
[B] = loadBOG();
BOG2Plot = filterBOG(B, full.s, idx, 10, 1, 10, 1, 1, 0);
figure(1)
clf
plot(full.s.pHin(:,idx),pres_full(:,idx),Color='red')
hold on
plot(full.s.doxy(:,idx),pres_full(:,idx))
plot(full.s.pHin_canb(:,idx),pres_full(:,idx),Color='blue')
scatter(BOG2Plot.pHin,BOG2Plot.pres,Color='green')
set(gca,'YDir','reverse')
title(['prof ',num2str(idx)])
ylim([0 600])
legend('spray','BOG','canb',Location='southeast')