%**************************************************************************
%This function plots the field integral as a function of position.
%
%Input:
%plt_file, plot file for results
%param, parameter structure
%pos, position of measurement (m)
%integ, field integral (Tm or Tm^2)
%
%Zachary Wolf, 9/5/08

function [] = long_coil_plot_integ(plt_file, param, pos, integ)

%Initialize
if strcmp(param.meas_type, 'I1YVSX')  %Iy vs x
    title_str = 'Int By dz vs X';
    x_str = 'X Position (m)';
    y_str = 'Int By dz (Tm)';
elseif strcmp(param.meas_type, 'I2YVSX')
    title_str = 'Int Int By dz dz vs X';
    x_str = 'X Position (m)';
    y_str = 'Int Int By dz dz (Tm^2)';
elseif strcmp(param.meas_type, 'I1XVSX')  %Ix vs x
    title_str = 'Int Bx dz vs X';
    x_str = 'X Position (m)';
    y_str = 'Int Bx dz (Tm)';
elseif strcmp(param.meas_type, 'I2XVSX')
    title_str = 'Int Int Bx dz dz vs X';
    x_str = 'X Position (m)';
    y_str = 'Int Int Bx dz dz (Tm^2)';
elseif strcmp(param.meas_type, 'I1YVSY')  %Iy vs y
    title_str = 'Int By dz vs Y';
    x_str = 'Y Position (m)';
    y_str = 'Int By dz (Tm)';
elseif strcmp(param.meas_type, 'I2YVSY')
    title_str = 'Int Int By dz dz vs Y';
    x_str = 'Y Position (m)';
    y_str = 'Int Int By dz dz (Tm^2)';
elseif strcmp(param.meas_type, 'I1XVSY')  %Ix vs y
    title_str = 'Int Bx dz vs Y';
    x_str = 'Y Position (m)';
    y_str = 'Int Bx dz (Tm)';
elseif strcmp(param.meas_type, 'I2XVSY')
    title_str = 'Int Int Bx dz dz vs Y';
    x_str = 'Y Position (m)';
    y_str = 'Int Int Bx dz dz (Tm^2)';
else
    title_str = 'Unknown Measurement Type';  %Other
    x_str = 'Position (m)';
    y_str = 'Field Integral (Tm or Tm^2)';
end

%Plot the data
figure;
hold on;
plot(pos, integ, 'b*', 'linewidth', .5);
title(title_str);
xlabel(x_str);
ylabel(y_str);
grid on;
zoom on;
hold off;
util_print_fig(plt_file);

%Done
