%**************************************************************************
%This function writes the parameter information to the data file.
%
%Input:
%dat_file, data file for results
%param, structure containing program parameters
%
%Zachary Wolf
%8/7/13

function [] = gen_dat_param(dat_file, param)

%Write the parameter information to the data file
fid = fopen(dat_file, 'a');
fprintf(fid, '\r\n');
fprintf(fid, 'Program Parameters:\r\n');
fprintf(fid, 'Undulator polarization mode = %s\r\n', param.pol_mode);
fprintf(fid, 'Undulator period = %f m\r\n', param.lambda_u);
fprintf(fid, 'Number of periods = %i\r\n', param.num_per);
fprintf(fid, 'Peak Field Strength = %f T\r\n', param.b_0);
fprintf(fid, 'Undulator kx^2 value = %f 1/m^2\r\n', param.kx^2);
fprintf(fid, 'Undulator ky^2 value = %f 1/m^2\r\n', param.ky^2);
fprintf(fid, 'Magnetic Center At Xc = %f m\r\n', param.x_c);
fprintf(fid, 'Magnetic Center At Yc = %f m\r\n', param.y_c);
fprintf(fid, 'Field At X = %f m\r\n', param.x);
fprintf(fid, 'Field At Y = %f m\r\n', param.y);
fclose(fid);
