function cal = get_cpf_cals_mc(MBARI_ID_str,dirs)
% function cal = get_cpf_cals(MBARI_ID_str, dirs)
% MC, eventually turn into a function
% w input from yui on pH and Nitrate cals
% -------------------------------------------------------------------------
% PURPOSE: Create cal structure for CPF003 sensors, 
%          mimicking data structure from Argo Processing
% -------------------------------------------------------------------------
% will do manually for now
%
%% OXYGEN
% O.type='4330';
% O.SN='2707';
% O.TCoef=[6.9144e-04 2.5355e-04 4.5396e-07 1.0818e-07];
% O.PCoef=[1.0513 -0.0015 0.3662 -0.2408 1.5918 0.1035 NaN 6.1931e-05];

% O.PolyDegT % 'FoilPolyDegT'

% % From Cal .xls file
% TempCoef,4330,2707,2.427231E+01,-3.144028E-02,2.932177E-06,-4.291377E-09,0.000000E+00,0.000000E+00  
% PhaseCoef,4330,2707,6.919999E-01,1.000000E+00,0.000000E+00,0.000000E+00

% NOTE: calc_O2_4ARGO.m seems to ask for Fcoef and PolyDegT, in addition to
% TCoef and PCoef

% Load cal structure from Tanya
load calCPF003.mat
O=calCPF003.O;

%% identified a float w aircal
% filename='~/Documents/MBARIprojects/w_ctd/floats/coreArgo_uw/runt.ocean.washington.edu/argo/data/19644/19644.010.msg';
% data=parse_APEXmsg4ARGO(filename);
% trying to identify what data should go in  aircal and air from parse_msg?

%% FLBB
CHL.type = 'FLBB';
CHL.SN = '4592';
CHL.ChlDC = 44 ; % counts
CHL.ChlScale = 0.0073; % ?g/l/count

BB.type    = CHL.type;
BB.SN      = CHL.SN;
BB.BetabDC = 44 ; % counts
BB.BetabScale = 1.610E-06; % (m^-1 sr^-1)/counts

% SensorCal Data for CPF003:
% //atlas.shore.mbari.org/ProjectLibrary/CPF/CPF003/SensorData
% /Volumes/CPF/CPF003/SensorData

%% pH 

% transcribed calibraiton data from cal sheets
pH.type = 'SBE';
pH.SN = 'C04';
pH.k0 = -1.42259;
pH.k2 = -1.1416E-3;
%pH.fP = [-3.7606E-03; 2.038E-05; -3.1889E-08; 3.2171E-11; -1.871E-14; 5.7894E-18; -7.3622E-22];
pH.fP = [2.038E-05; -3.1889E-08; 3.2171E-11; -1.871E-14; 5.7894E-18; -7.3622E-22]; %TM SBE f(0) not used (9/21/21)
pH.pcoefs =pH.fP; % ? to work with code from Tanya and Josh (in process_APEX_float)

%% NO3

% cpf_dir = '\\atlas\projectlibrary\cpf\cpf003\';
% cpf_dir = '/Volumes/CPF/CPF003/';
NO3cal_fp = [dirs.cal,'/Nitrate/112420_CPF003_Spec115202Calib_updated.cal'];

% extract calibration data
N = parseNO3cal(NO3cal_fp);

%% OUTPUT Cal structure
cal.O=O;
cal.CHL=CHL;
cal.BB=BB;
cal.pH=pH;
cal.N=N;

clear CHL O BB calCPF003 N pH

save('calCPF003_allBGC.mat','cal')