% Hall probe integration calibration

Bhall_calib = importdata('Hall probe from 1.4 to 0.3 G changing field.ru2', ' ', 1);

plot( Bhall_calib.data(:,1), Bhall_calib.data(:,3), 'bo');
xlabel('Time (Sec)');
ylabel('By Alalog Volt (V)');
title('Hall Analog Voltage from Probe for 1.4 to 0.3 G changing field');
saveas(gcf,'By Hall Analog Voltage from Probe Calibration.png')

Bhall_calib_gauss = 10*(max(Bhall_calib.data(:,3)) - min(Bhall_calib.data(:,3))) % The maximum field at the probe, which should be 1.4-0.3 = 1.1 G 

% Now use Bhall_calib_gauss data to calculate the the intergral field that would be measured by the hall probe and the coil (See function FWS_coil_analysis) 
Bhall = [(Bhall_calib_gauss/64), (Bhall_calib_gauss/32), (Bhall_calib_gauss/16),(Bhall_calib_gauss/8), (Bhall_calib_gauss/4), (Bhall_calib_gauss/2), Bhall_calib_gauss,  (Bhall_calib_gauss/2), (Bhall_calib_gauss/4), (Bhall_calib_gauss/8), (Bhall_calib_gauss/16), (Bhall_calib_gauss/32), (Bhall_calib_gauss/64)];
dx = 2.54;

Bhall_int_check = integrate(Bhall, dx) % G-cm

