%%%%%%%%%%%%%%%%
%
%  Pump2analysis2
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1 cm steps:
%backgroundfieldfile='Backgroundfield100-0.dat'
%datafieldfile='TV-2006-03-10_20-06-12less.dat'
%figtitle1=' Side 10in from Flange BgSub';
%figtitle2=' Side 10in from Flange - noBgsub';
%datafieldfile='TV-2006-03-16_11-16-36.dat';  coil, unistrut below table, disregard.
%%%%%%%%%%%%%%%2cm steps below:
backgroundfieldfile='TV-2006-03-16_16-12-21.dat'
%
%datafieldfile='TV-2006-03-16_15-39-41.dat'   
%pumplocation= 'Pump Flange 13in aside, 6 1/8 above' 
datafieldfile='TV-2006-03-16_17-17-11.dat'
pumplocation= 'Pump Flange 13in aside, 13in above'
%datafieldfile='TV-2006-03-16_18-23-07.dat'
%pumplocation= 'Pump Flip A 13in aside,13above'  %A='connector upper side right'
%datafieldfile='TV-2006-03-16_19-03-44.dat'
%pumplocation= 'Pump Flip B 13in aside,13 1/4above'
%datafieldfile='TV-2006-03-20_11-46-09.dat'
%pumplocation= 'Pump2: Flange 13in aside, 6 1/4 above'
%
% Pump1-Pump2-Comparison
%backgroundfieldfile='TV-2006-03-16_15-39-41.dat'   
%datafieldfile='TV-2006-03-20_11-46-09.dat'
%pumplocation='Pump2-Pump1'
%
%%%%%%%%%%%%
[Vxb,Vyb,Vzb] = textread(backgroundfieldfile, ' %f %f %f ', 'headerlines',1);
d=(100:-2:0)';   % A 101x1 column for -1, or 51 for -2 step
[Vx1,Vy1,Vz1] = textread(datafieldfile, ' %f %f %f ', 'headerlines',1);
%length(d)
%length(Vxb)
A1=[d Vx1 Vy1 Vz1];     % data 
Ab=[d Vxb Vyb Vzb];    % background
Az= [d zeros(51,3)];    % zeros
%%
%fignumber=1;
%figtitle1=[pumplocation ',BgSub'];
%plot1diff(A1,Ab,fignumber, figtitle1);
%%
%fignumber=2;
%figtitle2=[pumplocation ',noBgSub'];
%plot1diff(A1,Az,fignumber, figtitle2);
%%%
%fignumber=3;
%figtitle3=' background field';
%plot1diff(Ab,Az,fignumber, figtitle3);

%fignumber=4;
%figtitle4=[pumplocation ', |B|'];
%plot1diff2(A1,Ab,fignumber, figtitle4);

%fignumber=5;
%figtitle5=[pumplocation ', |B_{xy}|'];
%plot1diff2tr(A1,Ab,fignumber, figtitle5);

fignumber=6;
figtitle6=[pumplocation ', BgSub'];
quiverplot2(A1,Ab,fignumber, figtitle6);




% All done
