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

function [] = gen_dat_epu_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, 'Output file directory = %s\r\n', param.output_file_dir);
fprintf(fid, 'Number of periods = %i\r\n', param.num_per);
fprintf(fid, 'Undulator period = %f m\r\n', param.lambda_u);
fprintf(fid, 'Undulator parameter ku = %f 1/m\r\n', param.ku);
fprintf(fid, 'Undulator parameter kx = %f 1/m\r\n', param.kx);
fprintf(fid, 'Undulator parameter ky = %f 1/m\r\n', param.ky);
fprintf(fid, 'Undulator parameter kr = %f 1/m\r\n', param.kr);
fprintf(fid, 'Undulator parameter ks = %f 1/m\r\n', param.ks);
fprintf(fid, 'Peak field strength = %f T\r\n', param.b_0);
fprintf(fid, 'Peak scalar potential strength = %f Tm\r\n', param.phi_0);
fprintf(fid, 'Quadrant 1 z-position = %f m\r\n', param.z_01);
fprintf(fid, 'Quadrant 2 z-position = %f m\r\n', param.z_02);
fprintf(fid, 'Quadrant 3 z-position = %f m\r\n', param.z_03);
fprintf(fid, 'Quadrant 4 z-position = %f m\r\n', param.z_04);
fclose(fid);
