%**************************************************************************
%pid_anal_param
%This file contains all the parameters required by the analysis program.
%
%Zachary Wolf
%12/05/06, 08/04/07

%Input file information
INPUT_FILE_DIR = 'C:\Magdata\Sn04_Run015\';     %Directory where data is located, results go there also
INPUT_FILE_NAME = 'x+00000_y+000_bscanz.dat';   %Name of data file to analyze
INPUT_FILE_TYPE = 'ZVXYBXYH';                   %File type, gives format: ZVXYBXYH, ZBXYH, ZBYH, ZVYH, ZBYH_ANL, ZBYH_DESY

%Measurement data correction information
%Bx_corr = CORR_BX_MULT * Bx + CORR_BX_ADD + CORR_BX_ADD_FILE
%By_corr = CORR_BY_MULT * By + CORR_BY_ADD + CORR_BY_ADD_FILE
CORR_REQUIRED = true;                           %Logical variable whether to apply a correction to the measured fields
CORR_BX_MULT = 1.;                              %Multiplicative correction factor for Bx
CORR_BY_MULT = 1.;                              %Multiplicative correction factor for By
CORR_BX_ADD = -0.000014;                        %Additive constant correction for Bx (T)
CORR_BY_ADD = 0.000010;                        %Additive constant correction for By (T)
CORR_BXY_ADD_FILE = 'none';                     %No Bx or By correction from a file
%CORR_BXY_ADD_FILE = 'c:\Magdata\Earth Field Correction\earth_field_corr.dat';  %Name of file containing additive correction data for Bx and By (T), 'none' for no correction
CORR_BXY_ADD_FILE_TYPE = 'CORR_ZBXY';           %File type, gives format

%Analysis Parameters
ELEC_GAMMA = 26625.06;                          %Electron Lorentz factor
NOM_LAMBDA_U = .03;                             %Nominal undulator period (m)
NOM_K_VALUE = 2.252513;                         %Nominal K value that the undulator is shimmed to
NOM_LAMBDA_R = (1 / (2 * ELEC_GAMMA^2)) * (1 + (1 / 2) * NOM_K_VALUE^2) * NOM_LAMBDA_U; %Nominal radiation wavelength (m)
NUM_POLES = 226;                                %Number of poles
NUM_END_POLES = 4;                              %Number of poles to neglect at ends for averages, etc.
CELL_LENGTH = 3.656;                            %Undulator cell length (m)
NOM_PHASE_CELL = 113 * 2 * pi;                  %Nominal phase change through the cell (rad)
%Phase Matching Parameter
%NOM_PHASE_MATCH = ideal phase at the pole after the end poles
%Ninterior = NUM_POLES - (2 * NUM_END_POLES)
%Nbetween_interior = Ninterior - 1
%NOM_PHASE_MATCH + (NUM_POLES - (2 * NUM_END_POLES) - 1) * pi + NOM_PHASE_MATCH = NOM_PHASE_CELL
%2 * NOM_PHASE_MATCH = NOM_PHASE_CELL - (NUM_POLES - (2 * NUM_END_POLES) - 1) * pi
%NOM_PHASE_MATCH = (NOM_PHASE_CELL - (NUM_POLES - (2 * NUM_END_POLES) - 1) * pi) / 2
NOM_PHASE_MATCH = (NOM_PHASE_CELL - (NUM_POLES - (2 * NUM_END_POLES) - 1) * pi) / 2;

%Final results data set
SAVE_AS_FINAL_RESULT = false;                   %Save output as a final result, true or false
RESULT_FILE_DIR = 'c:\magdata\slac_und_2\';     %Directory where final results are stored
RESULT_FILE_NAME = 'zscan_xn0060yp0002.dat';    %Name of file for final result

%General
FIG_CLOSE_ON_EXIT = false;                      %Close figures when program exits, true or false
FIG_VIS = true;                                 %Figures visible on the screen, true or false

%Done
