%Last edited on 2021/01/19
% Template file for sg_calib_constants.m, Kongsberg Document No. 4000122
% Applies to SG513_CustomerOcean_2021015.xlsx
%   a bit of checking/editing for Diveplot - 7 apr 2021
%   slight edit mission title for PARAGON II Aug 2022 
%   slight edit for mission title for HOT341 leg 27Mar-31Mar 2023

% basic glider and mission params
    id_str='513';
    mission_title='SG513 Mission14 HOT341 27Mar 2023';
    mass=58.045;% kg
    volmax=57063;% cc
    rho0=1027.500;% kg/m3

% initial hydrodynamic model params; used only with NAV_MODE,2; 
% regression needed to obtain realistic values 
   hd_a=3.83600000E-03;
   hd_b=1.00780000E-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 for Diveplot v2.08 
%        supposedly no need for ver 2.09
    pitch_min_cnts=223;             % Software Limit (cnts)
    pitch_max_cnts=3875;
    roll_min_cnts=184;
    roll_max_cnts=3873;
    vbd_min_cnts=600;
    vbd_max_cnts=3960;
    vbd_cnts_per_cc=-4.07671;      % (conversion inverse) AD per cc

%  Seabird CT Sail sensor cal constants
     calibcomm=' Serial #: 0142  CAL: 18-AUG-2020';%  Serial # and cal date    
     t_g=4.32584198E-03;
     t_h=6.22907145E-04;
     t_i=2.31564670E-05;
     t_j=2.46928108E-06;
     c_g=-1.02358178E+01;
     c_h=1.14417338E+00;
     c_i=-1.79750452E-03;
     c_j=2.24220348E-04;

%  added the following 6 lines 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.90000E+00;% kHz, from cal for 0 salinity
     sbe_cond_freq_max=7.70000E+00;% kHz, est for greater than 34.9 sal max T
     sbe_temp_freq_min=2.20000E+00;% kHz, from cal for 1 deg T
     sbe_temp_freq_max=7.20000E+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 # 4096 CAL date 18-Feb-2022';
     Soc=3.2045E-004;
     Foffset=-851.57;
     o_a=-4.0872E-003;
     o_b=1.9424E-004;
     o_c=-2.8762E-006;
     o_c=--3.8144E-006;
     o_e=0.036;
     Tau20=1.06;
     Pcor=0;

% % CONTROS Hydroflash O2 sensor cal constants:  
%     comm_oxy_type =' Contros HydroFlash '; % type and model
%     calibcomm_contros_optode =' Serial #: DO-0816-008  CAL: 15-Aug-2016 '; %  Serial # and cal date
% %  Static constants used by all Contros Hydroflash
%     contopt_A_0=5.80871E+00;
%     contopt_A_1=3.20291E+00;
%     contopt_A_2=4.17887E+00;
%     contopt_A_3=5.1006E+00;
%     contopt_A_4=-9.86643E-02;
%     contopt_A_5=3.80369E+00;
%
%     contopt_B_0=-7.01577E-03;
%     contopt_B_1=-7.70028E-03;
%     contopt_B_2=-1.13864E-02;
%     contopt_B_3=-9.51519E-03;
%
%     contopt_C_0=-2.75915e-07;
%
% %   Contros Hydroflash sensor serial number specific constants for SN: DO-0816-008
% %   they are used to re-compute pO2 using the glider's CTD temp
%     contopt_CC_0=8.13E-03;
%     contopt_CC_1=6.40E-05;
%     contopt_CC_2=2.30E-07;
%     contopt_CC_3=6.36E-04;
%     contopt_CC_4=-5.45E-02;
%     contopt_CC_5=2.05E-02;
%     contopt_CC_6=3.33E-06;

% % 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: 887  CAL: 21.06.2020 ';%  Serial # and cal date
% 
     optode_PhaseCoef0=-1.198000E+00;
     optode_PhaseCoef1=1.0;
     optode_PhaseCoef2=0.0;
     optode_PhaseCoef3=0.0;
% 
     optode_FoilCoefA0=-2.679283E-06;
     optode_FoilCoefA1=-7.483597E-06;
     optode_FoilCoefA2=1.960006E-03;
     optode_FoilCoefA3=-2.072853E-01;
     optode_FoilCoefA4=6.012464E-04;
     optode_FoilCoefA5=-6.604266E-07;
     optode_FoilCoefA6=1.118020E+01;
     optode_FoilCoefA7=-5.148064E-02;
     optode_FoilCoefA8=6.898503E-05;
     optode_FoilCoefA9=8.465012E-07;
     optode_FoilCoefA10=-3.143506E+02;
     optode_FoilCoefA11=2.051116E+00;
     optode_FoilCoefA12=-2.987026E-03;
     optode_FoilCoefA13=-4.449771E-06;
 
     optode_FoilCoefB0=-1.861349E-06;
     optode_FoilCoefB1=3.814899E+03;
     optode_FoilCoefB2=-3.222806E+01;
     optode_FoilCoefB3=-1.678000E-01;
     optode_FoilCoefB4=1.894820E-02;
     optode_FoilCoefB5=-6.901433E-04;
     optode_FoilCoefB6=1.042693E-05;
     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;
%
%     optode_SVU_enabled
     optode_SVUCoef0=2.767689E-03;
     optode_SVUCoef1=1.185705E-04;
     optode_SVUCoef2=2.145839E-06;
     optode_SVUCoef3=1.218725E+02;
     optode_SVUCoef4=-2.019990E-01;
     optode_SVUCoef5=-2.804543E+01;
     optode_SVUCoef6=2.433343E+00;
%
     optode_ConcCoef0=0.000000E+00;
     optode_ConcCoef1=1.000000E+00;

% % Rinko ARO-FT Dissolved Oxygen Sensor
%    comm_oxy_type = ' Rinko ARO-FT ';
%    calibcomm.aroft.optode =' SN: 0AA1011, CAL: 27-May-2016 ';
%     aroft_c0=3.020188e-03
%     aroft_c1=1.239442e-04
%     aroft_c2=3.275705e-06
%     aroft_d0=5.928457e-04
%     aroft_d1=-1.461642e-01
%     aroft_d2=1.850662e-01
%     aroft_d3=0.000000e+00
%     aroft_d4=0.000000e+00
%     aroft_e0=1.000000e+00
%     aroft_A=-1.274236e+01
%     aroft_B=1.483120e-03
%     aroft_C=-2.661703e-08
%     aroft_D=6.236005e-13
%     aroft_E=-7.944576e-18
%     aroft_F=5.142597e-23
%     aroft_G=0.000000e+00
%     aroft_H=0.000000e+00

% % 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-6382, CAL: 23-Feb-2022 ';
% 
%      Backscattering cal constants - wavelength 470
     WETLabsCalData.wlbb2fl.Scatter470.wavelength=470;
     WETLabsCalData.wlbb2fl.Scatter470.scaleFactor=1.298E-05;
     WETLabsCalData.wlbb2fl.Scatter470.darkCounts=50;
     WETLabsCalData.wlbb2fl.Scatter470.resolution=1;
% 
     % Backscattering cal constants - wavelength 700
     WETLabsCalData.wlbb2fl.Scatter700.wavelength=700;
     WETLabsCalData.wlbb2fl.Scatter700.scaleFactor=3.508E-06;
     WETLabsCalData.wlbb2fl.Scatter700.darkCounts=46;
     WETLabsCalData.wlbb2fl.Scatter700.resolution=1;
% 
     % Chlorophyll cal constants
     WETLabsCalData.wlbb2fl.Chlorophyll.wavelength=695;
     WETLabsCalData.wlbb2fl.Chlorophyll.darkCounts=46;
     WETLabsCalData.wlbb2fl.Chlorophyll.scaleFactor=0.0120;
     WETLabsCalData.wlbb2fl.Chlorophyll.maxOutput=4130;
     WETLabsCalData.wlbb2fl.Chlorophyll.resolution=1;
     WETLabsCalData.wlbb2fl.Chlorophyll.calTemperature=22.0;

% % 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: BBFL2VMT-817, CAL: 28-Mar-2011 ';
% 
%     % Backscattering cal constants - wavelength 532
%     WETLabsCalData.wlbbfl2.Scatter532.wavelength=532;
%     WETLabsCalData.wlbbfl2.Scatter532.scaleFactor=8.618E-06;
%     WETLabsCalData.wlbbfl2.Scatter532.darkCounts=43;
%     WETLabsCalData.wlbbfl2.Scatter532.resolution=1.0;
% 
%     % Chlorophyll cal constants
%     WETLabsCalData.wlbbfl2.Chlorophyll.wavelength=695;
%     WETLabsCalData.wlbbfl2.Chlorophyll.darkCounts=44;
%     WETLabsCalData.wlbbfl2.Chlorophyll.scaleFactor=1.2200E-02;
%     WETLabsCalData.wlbbfl2.Chlorophyll.maxOutput=4130;
%     WETLabsCalData.wlbbfl2.Chlorophyll.resolution=1.0;
%     WETLabsCalData.wlbbfl2.Chlorophyll.calTemperature=21.5;
% 
%     % CDOM cal constants
%     WETLabsCalData.wlbbfl2.CDOM.wavelength=460;
%     WETLabsCalData.wlbbfl2.CDOM.maxOutput=4130;
%     WETLabsCalData.wlbbfl2.CDOM.scaleFactor=8.9000E-02;
%     WETLabsCalData.wlbbfl2.CDOM.darkCounts=45;
%     WETLabsCalData.wlbbfl2.CDOM.resolution=0.9;
%     WETLabsCalData.wlbbfl2.CDOM.calTemperature=21.5;

% % 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;

% % WETLabs SeaOWL calibration constants.
%     WETLabsCalData_wlseaowl_calinfo = ' SN: SEAOWL2K-011, CAL: 12-SEPT-2016 ';
% 
%     % Backscattering cal constants - wavelength 700
%     WETLabsCalData.wlseaowl.Scatter700.wavelength=700;
%     WETLabsCalData.wlseaowl.Scatter700.scaleFactor=2.521E-07;
%     WETLabsCalData.wlseaowl.Scatter700.darkCounts=48;
%     WETLabsCalData.wlseaowl.Scatter700.maxOutput=4.03e-02  
% 
%     % Chlorophyll cal constants
%     WETLabsCalData.wlseaowl.Chlorophyll.wavelength=690;
%     WETLabsCalData.wlseaowl.Chlorophyll.darkCounts=49;
%     WETLabsCalData.wlseaowl.Chlorophyll.scaleFactor=1.601E-03;
%     WETLabsCalData.wlseaowl.Chlorophyll.maxOutput=4130;
%     WETLabsCalData.wlseaowl.Chlorophyll.resolution=1.5;
%    
%     % FDOM cal constants
%     WETLabsCalData.wlseaowl.FDOM.wavelength=460;
%     WETLabsCalData.wlseaowl.FDOM.maxOutput=1270;
%     WETLabsCalData.wlseaowl.FDOM.scaleFactor=7.935e-03;
%     WETLabsCalData.wlseaowl.FDOM.darkCounts=49;
%     WETLabsCalData.wlseaowl.FDOM.resolution=1.6;

% % WETLabs wlflntu calibration constants.
%    WETLabsCalData.wlflntu.calinfo = ' SN: FLNTUIRB - 4409, CAL: 20-July-2016 ';
%
%     Chlorophyll cal constants - wavelength 695 nm
%      WETLabsCalData.wlflntu.Chlorophyll.wavelength=695;
%      WETLabsCalData.wlflntu.Chlorophyll.darkCounts=55;
%      WETLabsCalData.wlflntu.Chlorophyll.scaleFactor=1.2100E-02;
%      WETLabsCalData.wlflntu.Chlorophyll.maxOutput=4130;
%      WETLabsCalData.wlflntu.Chlorophyll.resolution=1.2;
%      WETLabsCalData.wlflntu.Chlorophyll.calTemperature=22.3;
%
%     NTU cal constants - wavelength 700 nm
%      WETLabsCalData.wlflntu.NT.wavelength=700;
%      WETLabsCalData.wlflntu.NT.maxOutput=4130;
%      WETLabsCalData.wlflntu.NT.scaleFactor=6.1000E-02;
%      WETLabsCalData.wlflntu.NT.darkCounts=50;
%      WETLabsCalData.wlflntu.NT.resolution=1.1;
%      WETLabsCalData.wlflntu.NT.calTemperature=22.3;
