function fanCurveMan2(nfit,verbose)
% fanCurveMan2  Data reduction for fan curve using the flowBench function.
%               Data entered manually via the myFanData function
%
% Synopsis:  fanCurveManual2
%            fanCurveManual2(nfit)
%            fanCurveManual2(nfit,verbose)
%
% Input:  nfit = (optional) degree of polynomial curve fit to fan curve
%                Default:  nfit = 4;
%         verbose = (optional) flag to control printing of raw and
%                   reduced data.  Default: verbose = false, no printing
if nargin<1 || isempty(nfit), nfit=4;  end
if nargin<2,  verbose = false;  end

% --- Get data and convert it
[dn,dplen,vdpp,vdpn,emf,rzone,patm,name] = myFanData(verbose);
[Q,dp] = flowBench(dn,vdpp,vdpn,emf,rzone,patm,dplen,verbose);

% --- Obtain curve fit, plot data 
c = polyfit(Q,dp,nfit);
Qfit = linspace(0,max(Q));
dpfit = polyval(c,Qfit);
plot(Q,dp,'o',Qfit,dpfit,'--');
legend('Data',sprintf('Degree %d fit',nfit));
xlabel('Q  (m^3/s)');    ylabel('\Delta p  (Pa)');

% --- Print curve fit coefficients
fprintf('\nPolynomial coefficients in fit to fan curve data:\n');
for i=1:length(c)
  fprintf('\t%20.11e  Q^(%d)\n',c(i),nfit-i+1);
end