% Fast Wire Scanner with Linmot motor analysis using dc1b rotating coil
% Coil was stationary and the field was measured during a scan of the motor
%  The motor current goes from -1 to -11 during the scans.

Bx = importdata('Bx_int_data.ru1', ' ', 2);
By = importdata('By_int_data.ru1', ' ', 2);
Bx_bshield = importdata('Bx_int_data_bottom_cover.ru1', ' ', 2);
By_bshield = importdata('By_int_data_bottom cover.ru1', ' ', 2);
Calib = importdata('Calibration data.txt', ' ', 2);

dc1b_cc = 5.64737; % Coil constant

Bx_int = 10000*100*mean(Bx.data)*dc1b_cc
By_int = 10000*100*mean(By.data)*dc1b_cc
Bx_int_bottom_shield = 10000*100*mean(Bx_bshield.data)*dc1b_cc
By_int_bottom_shield = 10000*100*mean(By_bshield.data)*dc1b_cc
Calib_int = 10000*100*mean(Calib.data)*dc1b_cc % Using hall measurements the integrated field should be ~9 G-cm
