Demostration file to learn to run an asymmetric wiggler.
Download and compile the program btraj.f
An asymmetric wiggler is an insertion device where the magnetic field in the vertical direction is not a sine function (the usual case). Here the magnetic field can be input from either a file containint the magnetic fiield in function of distance for for a single profile or from a file containing the harmonic expansion of the magnetic field.
Asymmetric and elliptic (i.e. when the magnetic field has an
horizontal component) simultaneously is not yet allowed.
When creating an ID with shadow, one normally starts with make_id
which is a script that calls first epath and then nphoton.
To run the asymmetric wiggler one have to run a new program
called btraj insted epath. Then run nphoton and GO source as
always.
expgd.shadow<81> btraj Wiggler trajectory calculation from: [0] An input file (2-column) with the magnetic field of one period. 1st column: y[m]; 2nd column: B[T] [1] A file with magnetic field hatmonic data: 1st column: # (harmonic number); 2nd column: B[T] 0 Input file ? mag_field.b 257 points read from file Period of the ID is : 0.21000000000000 Enter number of periods : 8 Electron energy [GeV] ? 6 beta = v/c = 0.99999999637248 Integral of B = 2.6809179379121D-06 [Tm] Output file with parameters ? btraj1.par Output file with the trajectory ? btraj1.traj All done expgd.shadow<82> cat btraj1.par ########### Data from btraj ############## Period of the ID is : 0.21000000000000 [m] Number of periods : 8 Number of points per periods : 257 beta = v/c = 0.99999999637248 Electro energy [GeV] = 6.0000000000000 Magnetic field profile from file: mag_field.b Integral of B = -1.3404589689560D-07[Tm] expgd.shadow<83> expgd.shadow<83>
expgd.shadow<83> expgd.shadow<83> expgd.shadow<83> cat mag_field.harm 1 .3509 2 .3181 3 .1551 4 .0861 5 -.0280 6 .0371 7 .0173 8 0. 9 0. 10 -.0104 expgd.shadow<84> expgd.shadow<84> expgd.shadow<84> btraj Wiggler trajectory calculation from: [0] An input file (2-column) with the magnetic field of one period. 1st column: y[m]; 2nd column: B[T] [1] A file with magnetic field hatmonic data: 1st column: # (harmonic number); 2nd column: B[T] 1 Input file ? mag_field.harm Enter wiggler wavelength [m] : .21 Enter number of periods : 8 10 harmonics read from file Enter number of points per period : 31 Electron energy [GeV] ? 6 beta = v/c = 0.99999999637248 Integral of B = 5.2717134763380D-19 [Tm] Output file with parameters ? btraj2.par Output file with the trajectory ? btraj2.par traj Do you want to write the magnetic field in a file ? [0/1] 0 All done expgd.shadow<85> expgd.shadow<85> expgd.shadow<85> expgd.shadow<85> cat btraj2.par ########### Data from btraj ############## Period of the ID is : 0.21000000000000 [m] Number of periods : 8 Number of points per periods : 31 beta = v/c = 0.99999999637248 Electro energy [GeV] = 6.0000000000000 Magnetic field harmonics from file mag_field.harm Number of harmonics: 10 expgd.shadow<86> expgd.shadow<86>
expgd.shadow<86> expgd.shadow<86> expgd.shadow<86> nphoton ************************ WIGGLER RADIATION ************************* Name of input file : btraj2.traj Type of Wiggler. Enter: for normal wiggler [1] for elliptical wiggler [2] Then? 1 Read 241 points from input file. Beam energy (GeV) = 6.0000040656855 Radius of curvature (max.) = 522.27909111997 m (min.) = 21.608013555985 m Critical Energy (max.) = 22166.987987439 eV (min.) = 917.10463825158 eV Initial photon energy [ eV ] : 20000 Final photon energy [ eV ] : 20020 Name of output file : wig.sha Total no.of photons = 1055510798576.1 expgd.shadow<87> expgd.shadow<87> /* And more and more ...... */ expgd.shadow<87> expgd.shadow<87> expgd.shadow<87> exit exit