%**************************************************************************
%This function sets the program parameters.
%
%Output:
%param, structure containing program parameters
%
%Zachary Wolf
%9/17/14

function [param] = gen_epu_param()

%Set program parameters-----

%File information
param.output_file_dir = 'C:\Magdata\Gen EPU Data\';     

%Undulator parameters
lambda_u = 32.e-3;  %(m)
num_per = 200;
ku = 2 * pi / lambda_u;
phi_0 = (1.25 / 4) * sqrt(2) / ku;  %(Tm), Bund = 1.25 T in vertical field mode

%Corrector coil
add_corr = false;
bx_corr = 0;
by_corr = 3.0995e-5;

%Put undulator parameters into a structure
param.lambda_u = lambda_u;
param.num_per = num_per;
param.phi_0 = phi_0;
% param.z_01 = .012;  %(m)
% param.z_02 = -.004;  %(m)
% param.z_03 = -.004;  %(m)
% param.z_04 = -.004;  %(m)
param.z_01 = .008;  %(m)
param.z_02 = 0;  %(m)
param.z_03 = 0;  %(m)
param.z_04 = -.008;  %(m)
param.z = -.25 : 200.e-6 : num_per * lambda_u + .25;  %(m)
param.add_corr = add_corr;
param.bx_corr = bx_corr;
param.by_corr = by_corr;
