function [B] = loadBOG(file)
%LOADBOG Summary of this function goes here
%   Detailed explanation goes here
if nargin ~= 1
    filepath = fullfile('\\atlas.shore.mbari.org','BOG_Archive','DataArchives','Regions','NortheastPacific','CruiseData','ALK_DIC_pH','O2_TCO2_ALK_pH_loadcheck.xlsm');
    try % Atlas filepath
        opts = detectImportOptions(filepath);
    catch % Local path
        filepath = fullfile('C:','Users','bwerb','Documents','Spray_crossovers','BOG','O2_TCO2_ALK_pH_loadcheck.xlsm');
        opts = detectImportOptions(filepath);
    end
else
    filepath = file;
    opts = detectImportOptions(filepath);
end
B = readtable(filepath,opts);
B.DATE_TIME.TimeZone = "UTC";
% var names to match spray data
B = renamevars(B, 'pH', 'pH20atm'); 
B = renamevars(B, 'PRESSURE', 'pres'); 
B = renamevars(B, 'TMP', 'tc'); 
B = renamevars(B, 'SAL', 'psal');
B = renamevars(B, 'O2', 'doxy');
B = renamevars(B, 'ALK', 'ta');

% ta = 2270; % estimate. Can also use canyonB.
% trex = CO2SYSv3(ta, B.pH20atm, 1, 3, B.psal, 20, 25, B.pres, 0, B.SIO4, B.PO4, 0, 0, 1, 10, 1, 2, 2); % convert from pH20atm to pH25atm
% CO2SYS with TCO2 and pH20


% TCO2 and pH
trex = CO2SYSv3(B.TCO2, B.pH20atm, 2, 3, B.psal, 20, 25, 0, 0, B.SIO4, B.PO4, 0, 0, 1, 10, 1, 2, 2); % convert from pH20atm to pH25atm
B.pH25atm = reshape(trex(:,20), size(B.pres));
B.pH25atm(B.pH25atm == -999) = NaN;

trex = CO2SYSv3(B.TCO2, B.pH20atm, 2, 3, B.psal, 20, B.tc, 0, B.pres, B.SIO4, B.PO4, 0, 0, 1, 10, 1, 2, 2); % convert from pH20atm to pH25atm
B.pHin = reshape(trex(:,20), size(B.pres));
B.pHin(B.pHin == -999) = NaN;


end