function dp = Omega05dp(v,units)
% Omega25dp  Convert voltage to pressure for Omega model PX653-0.5D5V transducer
%            Calibration is for serial number 10523258
%            Output is 1 to 5 Volts for pressure range 0 to 0.5 inch H20
%
% Synopsis:  dp = Omega05dp
%            dp = Omega05dp(v)
%            dp = Omega05dp(v,units)
%
% Input:  v = voltage output of transducer  
%         units = (string) to indicate the system of units for pressure.
%                   If units = 'SI', (default) then dp is in Pascals
%                   If units = 'BG', dp is in inches of H20
%                 Default: units = 'SI'. Other value is units = 'BG'
%
% Output:  dp = EITHER the calibration uncertainty for the pressure
%               transducer or the pressure differential across the transducer
%               dp = Omega05dp; (with no input arguments) returns the
%               estimate of the calibration uncertainty.  dp = Omega05dp(v)
%               returns the pressure differential for voltage v

inchH2O_toPa = 998*9.8*2.54e-2;  % multiplier to convert inch H2O to Pa
if nargin<1
  dp = 0.0015*inchH2O_toPa;  % calibration uncertainty in Pascal
  return
end
if nargin<2, units='SI';  end

% -- Range check on transducer output
if any(v<1 | v>5)
  fprintf('\nWarning in %s:\n',mfilename);
  fprintf('\tv = %g (volts) is out of range\n',v(v<1|v>5));
end
% --- Calibration equation
h = 0.125039641376784 * v - 0.124734996011382;  % delta p, inch H20
if strcmpi(units(1:2),'SI')
  dp = h*inchH2O_toPa;                     % convert inch H2O to Pa
else
  dp = h;
end
