% Last edited on 20191213 N.Collins
% Template file for sg_calib_constants.m, Kongsberg Document No. 4000122
% Applies to SG626_trim_sheet_build_20160121.xlsx   see thumb Jan 2020
%   edited 10 Jul 2021 s.poulos (in part - needs Title)

% basic glider and mission params
    id_str='626';
    mission_title='SG626, Mission3 PARAGON ';
    mass=54.636;% kg   Trim C9 val
    volmax=53734;% cc
    rho0=1027.500;% kg/m3

% initial hydrodynamic model params
%    hd_a=3.83600000E-03;
%    hd_b=1.00780000E-02;
%   change 6 aug 2021 due to un symmetrical dives
    hd_a=1.99526000E-03;
    hd_b=1.88500000E-02;
    hd_c=9.85000000E-06;
	
% GPCTD params - uncomment the following 2 lines if a GPCTD is installed in the glider
   %sg_configuration=3; %  selects GPCTD configuration
   %calibcomm=' GPCTD Serial #: 0022 CAL: 05-Dec-2010';%  Serial # and cal dat	

% added the following 7 lines back into this file fm trim sheet-S/w Limit counts fm thumb Jan 2020
   pitch_min_cnts=199;
    pitch_max_cnts=3921;
    roll_min_cnts=173;
    roll_max_cnts=3761;
    vbd_min_cnts=525;
    vbd_max_cnts=3961;
    vbd_cnts_per_cc=-4.076707;

% Seabird CT Sail sensor cal constants
     calibcomm=' Serial #: 273  CAL: 09-Mar-19';%  Serial # and cal date
     t_g=4.42199217e-003;
     t_h=6.44689641e-004;
     t_i=2.68627563e-005;
     t_j=3.31518656e-006;
     c_g=-1.00614071e+001;
     c_h=1.13344446e+000;
     c_i=-3.01291631e-003;
     c_j=2.96551151e-004;

     %  added the following in after failure - needed for Base V2.08 but not
     %  V2.09  the newest.    
     cpcor =-9.5700000E-08;
     ctcor =3.2500000E-06;
     sbe_cond_freq_min=2.98779E+00;% kHz, from cal for 0 salinity
     sbe_cond_freq_max=7.90435E+00;% kHz, est for greater than 32.49 sal max T
     sbe_temp_freq_min=3.51300E+00;% kHz, from cal for 1 deg T
     sbe_temp_freq_max=6.68100E+00;% kHz, from cal for 32.5 deg T   


% Seabird oxygen cal constants
     comm_oxy_type='SBE_43f';% spec "SBE_43f" or "Pumped_SBE_43f"
     calibcomm_oxygen='Serial #: 3327  Cal: 14 Oct 2017';%  Serial # and cal date
     Soc=3.301100E-04;
     Foffset=-8.522900E+02;
     o_a=-3.4987E-03;
     o_b=1.3574E-04;
     o_c=-1.9514E-06;
     o_e=3.600000E-02;
     Tau20=0.90;
     Pcor=0;

% % Aanderaa 3830 cal constants
%     comm_oxy_type = ' AA3830 ';  % type and model
%     calibcomm_optode = ' SN: 000  CAL: 31-Feb-2014 '; % serial # and cal date
% 
%     optode_PhaseCoef0=0.1;
%     optode_PhaseCoef1=0.1;
%     optode_PhaseCoef2=0.1;
%     optode_PhaseCoef3=0.1;

%     optode_C00Coef=0.1;
%     optode_C01Coef=0.1;
%     optode_C02Coef=0.1;
%     optode_C03Coef=0.1;
% 
%     optode_C10Coef=0.1;
%     optode_C11Coef=0.1;
%     optode_C12Coef=0.1;
%     optode_C13Coef=0.1;
% 
%     optode_C20Coef=0.1;
%     optode_C21Coef=0.1;
%     optode_C22Coef=0.1;
%     optode_C23Coef=0.1;
% 
%     optode_C30Coef=0.1;
%     optode_C31Coef=0.1;
%     optode_C32Coef=0.1;
%     optode_C33Coef=0.1;
% 
%     optode_C40Coef=0.1;
%     optode_C41Coef=0.1;
%     optode_C42Coef=0.1;
%     optode_C43Coef=0.1;

% Aanderaa cal constants
     comm_oxy_type=' AA4831 '; % make and model e.g. AA4831 or AA4330
     calibcomm_optode=' SN: 596  CAL: 10-Mar-2016 ';%  Serial # and cal date
 
     optode_PhaseCoef0=-1.36000E-01;
     optode_PhaseCoef1=1.00000E+00;
     optode_PhaseCoef2=0.0;
     optode_PhaseCoef3=0.0;
 
     optode_FoilCoefA0=-3.176837E-06;
     optode_FoilCoefA1=-6.413872E-06;
     optode_FoilCoefA2=1.743939E-03;
     optode_FoilCoefA3=-1.904569E-01;
     optode_FoilCoefA4=7.106918E-04;
     optode_FoilCoefA5=-5.010922E-07;
     optode_FoilCoefA6=1.056089E+01;
     optode_FoilCoefA7=-6.135393E-02;
     optode_FoilCoefA8=1.165880E-04;
     optode_FoilCoefA9=-3.871131E-07;
     optode_FoilCoefA10=-3.042181E+02;
     optode_FoilCoefA11=2.469668E+00;
     optode_FoilCoefA12=-7.050199E-03;
     optode_FoilCoefA13=-2.616267E-05;
 
     optode_FoilCoefB0=9.131562E-07;
     optode_FoilCoefB1=3.768247E+03;
     optode_FoilCoefB2=-4.024900E+01;
     optode_FoilCoefB3=1.506045E-01;
     optode_FoilCoefB4=1.097636E-03;
     optode_FoilCoefB5=-1.384983E-05;
     optode_FoilCoefB6=-3.184898E-07;
     optode_FoilCoefB7=0.0;
     optode_FoilCoefB8=0.0;
     optode_FoilCoefB9=0.0;
     optode_FoilCoefB10=0.0;
     optode_FoilCoefB11=0.0;
     optode_FoilCoefB12=0.0;
     optode_FoilCoefB13=0.0;

% % Biospherical PAR Calibration Constants and Device Properties
%     PARCalData_manufacturer='Biospherical Instruments, Inc';% Manufacturer
%     PARCalData_serialNumber=0;%  Serial #
%     PARCalData.calDate='26-May-2011';% cal date
%     PARCalData.darkOffset=10.6;% mv
%     PARCalData.scaleFactor=6.678E+00;% Volts/uE/cm^2sec

%  WETLabs wlbb2fl calibration constants.
     WETLabsCalData_wlbb2fl_calinfo = ' SN: BB2FLIRB-5372, CAL: 11/20/2018 ';
 
     % Backscattering cal constants - wavelength 470
     WETLabsCalData.wlbb2fl.Scatter470.wavelength=470;
     WETLabsCalData.wlbb2fl.Scatter470.scaleFactor=1.178E-5;
     WETLabsCalData.wlbb2fl.Scatter470.darkCounts=48;
     WETLabsCalData.wlbb2fl.Scatter470.resolution=1.0;
 
     % Backscattering cal constants - wavelength 700
     WETLabsCalData.wlbb2fl.Scatter700.wavelength=700;
     WETLabsCalData.wlbb2fl.Scatter700.scaleFactor=3.331E-6;
     WETLabsCalData.wlbb2fl.Scatter700.darkCounts=44;
     WETLabsCalData.wlbb2fl.Scatter700.resolution=1.2;
 
     % Chlorophyll cal constants
     WETLabsCalData.wlbb2fl.Chlorophyll.wavelength=695;
     WETLabsCalData.wlbb2fl.Chlorophyll.darkCounts=48;
     WETLabsCalData.wlbb2fl.Chlorophyll.scaleFactor=0.0121;
     WETLabsCalData.wlbb2fl.Chlorophyll.maxOutput=4130;
     WETLabsCalData.wlbb2fl.Chlorophyll.resolution=1.0;
     WETLabsCalData.wlbb2fl.Chlorophyll.calTemperature=20.8;

% % WETLabs wlbb3 calibration constants.
%     WETLabsCalData_wlbb3_calinfo = ' SN: BB3IRB-991, CAL: 01-May-2014 ';
% 
%     % Backscattering cal constants - wavelength 532
%     WETLabsCalData.wlbb3.Scatter532.wavelength=532;
%     WETLabsCalData.wlbb3.Scatter532.scaleFactor=7.560E-06;
%     WETLabsCalData.wlbb3.Scatter532.darkCounts=49;
%     WETLabsCalData.wlbb3.Scatter532.resolution=1.5;
% 
%     % Backscattering cal constants - wavelength 650
%     WETLabsCalData.wlbb3.Scatter650.wavelength=650;
%     WETLabsCalData.wlbb3.Scatter650.scaleFactor=3.703E-06;
%     WETLabsCalData.wlbb3.Scatter650.darkCounts=43;
%     WETLabsCalData.wlbb3.Scatter650.resolution=1.2;
% 
%     % Backscattering cal constants - wavelength 880
%     WETLabsCalData.wlbb3.Scatter880.wavelength=800;
%     WETLabsCalData.wlbb3.Scatter880.scaleFactor=2.139E-06;
%     WETLabsCalData.wlbb3.Scatter880.darkCounts=60;
%     WETLabsCalData.wlbb3.Scatter880.resolution=1.3;

% WETLabs wlbbfl2 calibration constants.
     WETLabsCalData_wlbbfl2_calinfo = ' SN: BBFL2IRB-1405, CAL: 23-Mar-2016 ';
 
     % Backscattering cal constants - wavelength 650
     WETLabsCalData.wlbbfl2.Scatter650.wavelength=650;
     WETLabsCalData.wlbbfl2.Scatter650.scaleFactor=3.523E-06;
     WETLabsCalData.wlbbfl2.Scatter650.darkCounts=36;
     WETLabsCalData.wlbbfl2.Scatter650.resolution=1.2;
 
     % Chlorophyll cal constants
     WETLabsCalData.wlbbfl2.Chlorophyll.wavelength=695;
     WETLabsCalData.wlbbfl2.Chlorophyll.darkCounts=47;
     WETLabsCalData.wlbbfl2.Chlorophyll.scaleFactor=1.2100E-02;
     WETLabsCalData.wlbbfl2.Chlorophyll.maxOutput=4130;
     WETLabsCalData.wlbbfl2.Chlorophyll.resolution=1.0;
     WETLabsCalData.wlbbfl2.Chlorophyll.calTemperature=23.2;
 
     % CDOM cal constants
     WETLabsCalData.wlbbfl2.CDOM.wavelength=460;
     WETLabsCalData.wlbbfl2.CDOM.maxOutput=4130;
     WETLabsCalData.wlbbfl2.CDOM.scaleFactor=9.1100E-02;
     WETLabsCalData.wlbbfl2.CDOM.darkCounts=47;
     WETLabsCalData.wlbbfl2.CDOM.resolution=1.0;
     WETLabsCalData.wlbbfl2.CDOM.calTemperature=23.2;

% % WETLabs wlfl3 calibration constants.
%     WETLabsCalData_wlfl3_calinfo = ' SN: FL3IRB-2884, CAL: 30-Apr-2014 ';
% 
%     % Chlorophyll cal constants ug/l/count
%     WETLabsCalData.wlfl3.Chlorophyll.wavelength=695;
%     WETLabsCalData.wlfl3.Chlorophyll.darkCounts=38;
%     WETLabsCalData.wlfl3.Chlorophyll.scaleFactor=1.2000E-02;
%     WETLabsCalData.wlfl3.Chlorophyll.maxOutput=4130;
%     WETLabsCalData.wlfl3.Chlorophyll.resolution=1;
%     WETLabsCalData.wlfl3.Chlorophyll.calTemperature=21.0;
% 
%     % CDOM cal constants ppb/count
%     WETLabsCalData.wlfl3.CDOM.wavelength=460;
%     WETLabsCalData.wlfl3.CDOM.maxOutput=4130;
%     WETLabsCalData.wlfl3.CDOM.scaleFactor=9.8400E-02;
%     WETLabsCalData.wlfl3.CDOM.darkCounts=49;
%     WETLabsCalData.wlfl3.CDOM.resolution=1.0;
%     WETLabsCalData.wlfl3.CDOM.calTemperature=21.0;
% 
%     % Phycoerythrin cal constants ppb/count
%     WETLabsCalData.wlfl3.Phycoerythrin.wavelength=570;
%     WETLabsCalData.wlfl3.Phycoerythrin.maxOutput=4130;
%     WETLabsCalData.wlfl3.Phycoerythrin.scaleFactor=4.3200E-02;
%     WETLabsCalData.wlfl3.Phycoerythrin.darkCounts=46;
%     WETLabsCalData.wlfl3.Phycoerythrin.resolution=1.0;
%     WETLabsCalData.wlfl3.Phycoerythrin.calTemperature=21.0;
%
%     % Uranine cal constants ppb/count - wavelength 530 nm
%     WETLabsCalData.wlfl3.Uranine.wavelength=530;
%     WETLabsCalData.wlfl3.Uranine.maxOutput=4130;
%     WETLabsCalData.wlfl3.Uranine.scaleFactor=4.3200E-02;
%     WETLabsCalData.wlfl3.Uranine.darkCounts=46;
%     WETLabsCalData.wlfl3.Uranine.resolution=1.0;
%     WETLabsCalData.wlfl3.Uranine.calTemperature=21.0;
%
%     % Rhodamine cal constants ppb/count - wavelength 570 nm
%     WETLabsCalData.wlfl3.Rhodamine.wavelength=570;
%     WETLabsCalData.wlfl3.Rhodamine.maxOutput=4130;
%     WETLabsCalData.wlfl3.Rhodamine.scaleFactor=4.3200E-02;
%     WETLabsCalData.wlfl3.Rhodamine.darkCounts=46;
%     WETLabsCalData.wlfl3.Rhodamine.resolution=1.0;
%     WETLabsCalData.wlfl3.Rhodamine.calTemperature=21.0;
%
%     % Phycocyanin cal constants ppb/count - wavelength 680 nm
%     WETLabsCalData.wlfl3.Phycocyanin.wavelength=680;
%     WETLabsCalData.wlfl3.Phycocyanin.maxOutput=4130;
%     WETLabsCalData.wlfl3.Phycocyanin.scaleFactor=4.3200E-02;
%     WETLabsCalData.wlfl3.Phycocyanin.darkCounts=46;
%     WETLabsCalData.wlfl3.Phycocyanin.resolution=1.0;
%     WETLabsCalData.wlfl3.Phycocyanin.calTemperature=21.0;
