%**************************************************************************
%epu_anal_get_meas
%This function gets the header information and the measurements from
%the input data file.
%
%Input:
%param, parameter structure
%
%Output:
%header, header information from data file
%zm, Z positions of the measurements in bench coordinates (m)
%bx, measured horizontal field component Bx (T)
%by, measured vertical field component By (T)
%bz, measured longitudinal field component Bz (T)
%temp, measured temperature (C)
%
%Zachary Wolf
%12/23/05

function [header, zm, bx, by, bz, temp] = epu_anal_get_meas(param)

%Construct the input file
input_file = strcat(param.input_file_dir, param.input_file_name);

%Read the input file
if strcmp(param.input_file_type, 'ZVXYZBXYZH')
    [header, zm, bx, by, bz] = read_meas_zvxyzbxyzh(input_file);
    temp = 0;
elseif strcmp(param.input_file_type, 'ZVXYBXYH')
    [header, zm, bx, by] = read_meas_zvxybxyh(input_file);
    bz = zeros(1, length(zm));
    temp = 0;
elseif strcmp(param.input_file_type, 'ZVXYBXYHT')
    [header, zm, bx, by] = read_meas_zvxybxyht(input_file);
    bz = zeros(1, length(zm));
    temp = 0;
elseif strcmp(param.input_file_type, 'ZBXYH')
%    [header, zm, bx, by] = read_meas_zbxyh(input_file);
    [header, zm, bx, by] = read_meas_zbyxh(input_file);
    bz = zeros(1, length(zm));
    temp = 0;
elseif strcmp(param.input_file_type, 'ZBXYZH')
    [header, zm, bx, by, bz] = read_meas_zbxyzh(input_file);
    temp = 0;
elseif strcmp(param.input_file_type, 'HD_RADIA')
    [header, zm, bx, by, bz] = read_meas_hd_radia(input_file);
    temp = 0;
else
    error('Unknown input file type.');
end

%Done
