function [ww] = Wrapper_pH_adj_fulltimeseries(file,k2,Pcoefs,warmup,mindepth,maxdepth, savefile)
%WRAPPER_PH_ADJ_FULLTIMESERIES This wrapper is built specifically for the
%full timeseries files sent by Jacob Partida on 7/15/24. readncTHOON
%converts the nc file into a matfile with appropriate variable names and
%adds some necessary variables for canyonB. THOONK0Calc recalculates k0
%using estimate insitu pH from canyonB. Since the files are so large, only
%using 70 to 74 m in canyonB. THOONpH_adj recalculates pH using the new k0
%that is the mean of the entire timeseries from the specified depths. We
%use the deepest water available because pH is more stable at depth and
%canyonB algorithm has higher accuracy.
[ww] = readncTHOON(file,k2,Pcoefs,0); % read nc file, don't save
[ww] = THOONK0Calc(ww,warmup,mindepth,maxdepth); % recalculate k0 from 70 - 74 m with CanyonB estimated pH
[ww] = THOONpH_adj(ww); % recalculate pH with new k0 coefficient
filename = char(file);
filename = filename(1:end-3);
% Save the struct as a .mat file
if savefile==1
    save([filename,'.mat'], 'ww');
end
end

