% Last edited 7 Marb 16 by Steve fixing the 
%    wrong CTD Cal data- for their water tests
% Last edited on 2/5/16 Ross
% Template file for sg_calib_constants.m, Kongsberg Document No. 4000122
% Applies to SG146_trim_sheet_ocean_for_mission_xxx_yyyymmdd.xlsx

% basic glider and mission params
    id_str='146';
    mission_title='sg146 Mission12:';
    mass=52.688;% kg
    volmax=51812;% cc
    rho0=1027.5;% kg/m3

% initial hydrodynamic model params
    hd_a=3.83600000E-03;
    hd_b=1.00780000E-02;
    hd_c=9.85000000E-06;
    therm_expan=7.05000000E-05;
    temp_ref=1.50000000E+01;
    abs_compress=4.18000000E-06;
    pitchbias=0.00000000E+00;

% software limits from cal sheet
    pitch_min_cnts=485;
    pitch_max_cnts=3757;
    roll_min_cnts=175;
    roll_max_cnts=3800;
    vbd_min_cnts=477;
    vbd_max_cnts=3951;
    vbd_cnts_per_cc=-4.076707;

% pump parameters
    pump_rate_intercept=1.275;
    pump_rate_slope=-0.00015;
    pump_power_intercept=17.4033;
    pump_power_slope=0.017824;

% % Seabird CT Sail sensor cal constants corrected in the file-8mar2016
     calibcomm=' Serial #: 136  CAL: 25-Dec-2015';%  Serial # and cal date
      t_g =4.32659049E-03;
      t_h =6.21476151E-04;
      t_i =2.26590544E-05;
      t_j =2.35110254E-06;
      c_g =-9.81608332E+00;
      c_h =1.08595035+00;
      c_i =-1.47675403E-03;
      c_j =1.94903130E-04;
      cpcor =-9.5700000E-08;
      ctcor =3.2500000E-06;
      sbe_cond_freq_min=3.01024E+00;% kHz, from cal for 0 salinity
      sbe_cond_freq_max=8.04815E+00;% kHz, est for greater than 34.9 sal max T
      sbe_temp_freq_min=3.107569E+00;% kHz, from cal for 1 deg T
      sbe_temp_freq_max=6.005955E+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 #: 0171  CAL: 13-Oct-2015';%  Serial # and cal date

     Soc=3.4886E-04;
     Foffset=-8.1718E+02;
     o_a=-4.0586E-003;
     o_b=2.1399E-004;
     o_c=-3.3884E-006;
     o_e=0.036;
     Tau20=1.49;
     Pcor=0;

% % Aanderaa 3830 cal constants
     comm_oxy_type = ' AA3830 ';  % type and model
     calibcomm_optode = ' Serial #: 19  CAL: 16-Oct-2015 '; % serial # and cal date
 
     optode_PhaseCoef0=-7.54593E+00;
     optode_PhaseCoef1=1.22715E+00;
     optode_PhaseCoef2=0.0;
     optode_PhaseCoef3=0.0;

     optode_C00Coef=4.270193E+03;
     optode_C01Coef=-1.327236E+02;
     optode_C02Coef=2.156297E+00;
     optode_C03Coef=-1.402758E-02;
 
     optode_C10Coef=-2.297296E+02;
     optode_C11Coef=5.742421E+00;
     optode_C12Coef=-6.853578E-02;
     optode_C13Coef=1.886123E-04;
 
     optode_C20Coef=5.064016E+00;
     optode_C21Coef=-9.620849E-02;
     optode_C22Coef=5.221808E-04;
     optode_C23Coef=7.708897E-06;
 
     optode_C30Coef=-5.263322E-02;
     optode_C31Coef=7.154674E-04;
     optode_C32Coef=3.311850E-06;
     optode_C33Coef=-1.861240E-07;
 
     optode_C40Coef=2.109168E-04;
     optode_C41Coef=-1.840878E-06;
     optode_C42Coef=-4.286455E-08;
     optode_C43Coef=1.111203E-09;

% % Aanderaa cal constants
%     comm_oxy_type=' AA4831 '; make and model e.g. AA4831 or AA4330
%     calibcomm_optode=' SN: 332  CAL: 13-Feb-2014 ';%  Serial # and cal date
% 
%     optode_PhaseCoef0=0.0;
%     optode_PhaseCoef1=1.0;
%     optode_PhaseCoef2=0.0;
%     optode_PhaseCoef3=0.0;
% 
%     optode_FoilCoefA0=-2.988314E-06;
%     optode_FoilCoefA1=-6.137785E-06;
%     optode_FoilCoefA2=0.001684659;
%     optode_FoilCoefA3=-0.1857173;
%     optode_FoilCoefA4=0.0006784399;
%     optode_FoilCoefA5=-5.597908E-07;
%     optode_FoilCoefA6=10.40158;
%     optode_FoilCoefA7=-0.05986907;
%     optode_FoilCoefA8=0.0001360425;
%     optode_FoilCoefA9=-4.776977E-07;
%     optode_FoilCoefA10=-303.2937;
%     optode_FoilCoefA11=2.530496;
%     optode_FoilCoefA12=-0.01267045;
%     optode_FoilCoefA13=0.0001040454;
% 
%     optode_FoilCoefB0=-3.56039E-07;
%     optode_FoilCoefB1=3816.713;
%     optode_FoilCoefB2=-44.75507;
%     optode_FoilCoefB3=0.4386164;
%     optode_FoilCoefB4=-0.007146342;
%     optode_FoilCoefB5=8.906236E-05;
%     optode_FoilCoefB6=-6.343012E-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 wlbb2f calibration constants.
     WETLabsCalData_wlbb2fl_calinfo = ' SN: BB2FVMG-398, CAL: 29-OCT-2015 ';
 
     % Backscattering cal constants - wavelength 470
     WETLabsCalData.wlbb2fl.Scatter470.wavelength=470;
     WETLabsCalData.wlbb2fl.Scatter470.scaleFactor=1.957E-05;
     WETLabsCalData.wlbb2fl.Scatter470.darkCounts=51;
     WETLabsCalData.wlbb2fl.Scatter470.resolution=1.0;
 
     % Backscattering cal constants - wavelength 700
     WETLabsCalData.wlbb2fl.Scatter700.wavelength=700;
     WETLabsCalData.wlbb2fl.Scatter700.scaleFactor=3.226E-06;
     WETLabsCalData.wlbb2fl.Scatter700.darkCounts=50;
     WETLabsCalData.wlbb2fl.Scatter700.resolution=1.6;
 
     % Chlorophyll cal constants
     WETLabsCalData.wlbb2fl.Chlorophyll.wavelength=695;
     WETLabsCalData.wlbb2fl.Chlorophyll.darkCounts=50;
     WETLabsCalData.wlbb2fl.Chlorophyll.scaleFactor=1.5800E-02;
     WETLabsCalData.wlbb2fl.Chlorophyll.maxOutput=4120;
     WETLabsCalData.wlbb2fl.Chlorophyll.resolution=2.3;
     WETLabsCalData.wlbb2fl.Chlorophyll.calTemperature=21.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: BBFL2IRB-1386, CAL: 13-Jan-2016 ';
 
     % Backscattering cal constants - wavelength 650
     WETLabsCalData.wlbbfl2.Scatter650.wavelength=650;
     WETLabsCalData.wlbbfl2.Scatter650.scaleFactor=3.522E-06;
     WETLabsCalData.wlbbfl2.Scatter650.darkCounts=36;
     WETLabsCalData.wlbbfl2.Scatter650.resolution=1.3;
 
     % Chlorophyll cal constants
     WETLabsCalData.wlbbfl2.Chlorophyll.wavelength=695;
     WETLabsCalData.wlbbfl2.Chlorophyll.darkCounts=47;
     WETLabsCalData.wlbbfl2.Chlorophyll.scaleFactor=1.2000E-02;
     WETLabsCalData.wlbbfl2.Chlorophyll.maxOutput=4130;
     WETLabsCalData.wlbbfl2.Chlorophyll.resolution=1.0;
     WETLabsCalData.wlbbfl2.Chlorophyll.calTemperature=22.3;
 
     % CDOM cal constants
     WETLabsCalData.wlbbfl2.CDOM.wavelength=460;
     WETLabsCalData.wlbbfl2.CDOM.maxOutput=4130;
     WETLabsCalData.wlbbfl2.CDOM.scaleFactor=8.99E-02;
     WETLabsCalData.wlbbfl2.CDOM.darkCounts=46;
     WETLabsCalData.wlbbfl2.CDOM.resolution=1.0;
     WETLabsCalData.wlbbfl2.CDOM.calTemperature=22.3;

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