function [new_oxy,Soc,Voffset,Boc,tcor,pcor,p1]=...
    oxy_fit_linear(volt,OXSAT,temp,press,sta,bot_oxy, ...
		Soc,Voffset,Boc,tcor,pcor,p1);
%OXY_FIT_LINEAR - oxygen coeffs from voltage and bottle Oxygen (linear trend)

% $Revision: 1.6 $
% $Date: 2008/04/09 14:12:38 $
% $Id: oxy_fit_linear.m,v 1.6 2008/04/09 14:12:38 duncombe Exp duncombe $

x=[volt OXSAT temp press sta];
beta(1,1)=Soc;
beta(1,2)=Voffset;
beta(1,3)=Boc;
beta(1,4)=tcor;
beta(1,5)=pcor;
beta(1,6)=p1;
beta0=non_lin_fit(x,bot_oxy,'oxygen_fit_linear',beta);
Soc=beta0(1);
Voffset=beta0(2);
Boc=beta0(3);
tcor=beta0(4);
pcor=beta0(5);
p1=beta0(6);

new_oxy=((Soc.*(volt+Voffset))+Boc.*exp(-0.03.*temp)+(p1.*sta)).* ...
	exp(tcor.*temp).*OXSAT.*exp(pcor.*press);;

return;

