% oc404_ctd_oxyCalc.m
% Oxygen concentration (ml/l) from  SBE 43 voltage 6, Oxygen
% 
% INPUT:
%
% V = voltage output from SBE-43 (voltage 6, Oxygen)
% T = ocean temperature (degC) from CTD
% S = ocean salinity (psu) from CTD
% P = ocean pressure (dbar) from CTD
%
% SBE 43 OXYGEN CALIBRATION DATA and COEFFICIENTS
% SOURCE: Calibration file for oc404 cruise,
% filename oc404_conreport.txt, date: 06/09/2004,
% ASCII file C:\cruise\oc404-1\oc404.con - 
% Configuration report for SBE 911.917 plus CTD,
% A/D voltage 6, Oxygen, SBE 43
% 
% Sensor Serial number: 0264
% Calibration date    : 04-Mar-2004
% Soc                 : 3.8530e-001;
% Boc                 : 0.0000
% Voffset             : -0.5697
% Tcor                : 0.0005
% Pcor                : 1.35e-004
% Tau                 : 0.0

Soc = 3.8530e-1;
Voffset = -0.5697;
Tcor = 0.0005;
Pcor = 1.35e-4;

% Oxygen saturation  (ml/l).
Oxsat=sw_satO2(S,T);

% Oxygen (ml/l). 
OX=(Soc * (V + Voffset)) .* exp(Tcor * T) .* Oxsat .* exp(Pcor*P);

% Oxygen Saturation  (%).
parSt = OX ./Oxsat  *100;
