% sg_calib_constants.m
% establishes glider calibration constants

% This fils is an example and MUST be changed apprpriately for your
% own glider.

% Edited by ESDU, SAMS, 1st Sep 2017

id_str = '604';

mission_title ='OSNAP 10';
% calibcomm = 'SBE s/n 0231, calibration 19 October 2012';

%From NOCS trimsheet
mass	=	53.3276	;	% from sum on trim sheet
volmax	=	52794	;	% from ballast worksheet final table
rho0	=	1.027700	;	% from ballast worksheet for "new" environment
				
% 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	=	222	;
pitch_max_cnts	=	3875	;
roll_min_cnts	=	257	;
roll_max_cnts	=	3875	;
vbd_min_cnts	=	500	;
vbd_max_cnts	=	3957	;
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	;


% CT coefficients - S/N 0231
% Calibrated 14-Apr-17

t_g =  4.40981070e-03 ;
t_h =  6.45100711e-04 ;
t_i =  2.61904361e-05 ; 
t_j =  3.21008852e-06 ;

% Minimum and maximum frequencies (kHz) for reasonable
%  oceanographic values of temperature from SBE calibration
calibcomm='CTD S/N 0231  CAL: 14-Apr-17';
sbe_temp_freq_min = 3.4; % kHz, from cal for 1 deg T
sbe_temp_freq_max = 6.6; % kHz, from cal for 32.5 deg T

c_g = -9.70478687e+00 ;
c_h =  1.12257647e+00 ;
c_i = -8.50182620e-04 ;
c_j =  1.46707251e-04 ;

% Minimum and maximum frequencies (kHz) for reasonable
%  oceanographic values of conductivity SBE calibration
sbe_cond_freq_min = 2.9; % kHz, from cal for 0 salinity
sbe_cond_freq_max = 7.9; % kHz, est for T greater than 32.5 

cpcor = -9.5700e-08 ;
ctcor = 3.2500e-06 ;


comm_oxy_type	='	AA4831	';	% spec  Aa_optode
calibcomm_oxygen	='Optode S/N 327  CAL: 13-Feb-14	';	% SN 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	=	 1.684659E-03	;	
optode_FoilCoefA3	=	-1.857173E-01	;	
optode_FoilCoefA4	=	 6.784399E-04	;	
optode_FoilCoefA5	=	-5.597908E-07	;	
optode_FoilCoefA6	=	 1.040158E+01	;	
optode_FoilCoefA7	=	-5.986907E-02	;	
optode_FoilCoefA8	=	 1.360425E-04	;	
optode_FoilCoefA9	=	-4.776977E-07	;	
optode_FoilCoefA10	=	-3.032937E+02	;	
optode_FoilCoefA11	=	 2.530496E+00	;	
optode_FoilCoefA12	=	-1.267045E-02	;	
optode_FoilCoefA13	=	 1.040454E-04	;
optode_FoilCoefB0	=	-3.560390E-07   ;
optode_FoilCoefB1	=	 3.816713E+03   ;	
optode_FoilCoefB2	=	-4.475507E+01	;	
optode_FoilCoefB3	=	 4.386164E-01	;	
optode_FoilCoefB4	=	-7.146342E-03	;	
optode_FoilCoefB5	=	 8.906236E-05   ;	
optode_FoilCoefB6	=	-6.343012E-07	;	
optode_FoilCoefB7	=	0;
optode_FoilCoefB8	=	0;
optode_FoilCoefB9	=	0;
optode_FoilCoefB10	=	0;
optode_FoilCoefB11	=	0;
optode_FoilCoefB12	=	0;
optode_FoilCoefB13	=	0;

% Wetlab Aft cal Constants - Sensor SN 791, Cal 10-Feb-2014
%  Chlorophyll cal Constants
WETLabsCalData.Chlorophyll.darkCounts=48;
WETLabsCalData.Chlorophyll.scaleFactor=0.0122;
WETLabsCalData.Chlorophyll.maxOutput=4130;
WETLabsCalData.Chlorophyll.resolution=1.0;
WETLabsCalData.Chlorophyll.calTemperature=22.0;
%CDOM or Scattering cal Constants
WETLabsCalData.CDOM.maxOutput=4130;
WETLabsCalData.CDOM.scaleFactor=0.0820;
WETLabsCalData.CDOM.darkCounts=44;
WETLabsCalData.CDOM.resolution=1.0;
WETLabsCalData.CDOM.calTemperature=22.0;
% Scattering Sensor 650
WETLabsCalData.Scatter700.wavelength=650;
WETLabsCalData.Scatter700.scaleFactor=3.941E-06;
WETLabsCalData.Scatter700.darkCounts=47;
WETLabsCalData.Scatter700.resolution=1.4;
