1 | function z = wigtable(fname, L, Nslice, filename, method) |
---|
2 | % wigtable(fname, L, Nslice, filename, method) |
---|
3 | % |
---|
4 | % FamName family name |
---|
5 | % Length length[m] |
---|
6 | % Nslice number of slices (1 means the wiggler is represented by a |
---|
7 | % single kick in the center of the device). |
---|
8 | % filename name of file with wiggler tracking tables. |
---|
9 | % method name of the function to use for tracking |
---|
10 | % |
---|
11 | % The tracking table is described in |
---|
12 | % P. Elleaume, "A new approach to the electron beam dynamics in undulators |
---|
13 | % and wigglers", EPAC92. |
---|
14 | % |
---|
15 | % returns assigned address in the FAMLIST that is uniquely identifies |
---|
16 | % the family |
---|
17 | |
---|
18 | %--------------------------------------------------------------------------- |
---|
19 | % Modification Log: |
---|
20 | % ----------------- |
---|
21 | % |
---|
22 | %--------------------------------------------------------------------------- |
---|
23 | |
---|
24 | ElemData.FamName = fname; % add check for identical family names |
---|
25 | ElemData.Length = L; |
---|
26 | ElemData.Nslice = Nslice; |
---|
27 | ElemData.MaxOrder = 3; |
---|
28 | ElemData.NumIntSteps = 10; |
---|
29 | ElemData.R1 = diag(ones(6,1)); |
---|
30 | ElemData.R2 = diag(ones(6,1)); |
---|
31 | ElemData.T1 = zeros(1,6); |
---|
32 | ElemData.T2 = zeros(1,6); |
---|
33 | ElemData.PassMethod = method; |
---|
34 | |
---|
35 | load(filename); |
---|
36 | ElemData.xtable = x; |
---|
37 | ElemData.ytable = y; |
---|
38 | ElemData.xkick = xkick; |
---|
39 | ElemData.ykick = ykick; |
---|
40 | |
---|
41 | global FAMLIST |
---|
42 | z = length(FAMLIST)+1; % number of declare families including this one |
---|
43 | FAMLIST{z}.FamName = fname; |
---|
44 | FAMLIST{z}.NumKids = 0; |
---|
45 | FAMLIST{z}.KidsList= []; |
---|
46 | FAMLIST{z}.ElemData= ElemData; |
---|