ocelot.rad.radiation_py
¶
Module Contents¶
Classes¶
A class for storing and retrieving the coordinates of the n-th particle from the table with all trajectories. |
Functions¶
|
|
|
|
|
transform coordinates for gauss integration |
|
|
|
|
|
|
|
rate of energy diffusion |
|
|
|
|
|
|
|
|
|
|
|
screen format screen->ReEx[ypoint*xpoint*je + xpoint*jy + jx] += EreX; |
|
Function to calculate radation from the electron beam. |
|
Function to calculate radiation from the electron beam. |
|
Function calculates the electron trajectory |
can read different types of files. By default, mag_file is in [mm] . for python version, only vertical component of magnetic field (By) is taken into account. In order to overcome this limitation, someone have to change function radiation_py.field_map2field_func(z, By). Sergey Tomin 04.11.2016.
-
ocelot.rad.radiation_py.
_logger
¶
-
ocelot.rad.radiation_py.
nb_flag
= True¶
-
class
ocelot.rad.radiation_py.
Motion
¶
-
class
ocelot.rad.radiation_py.
BeamTraject
(beam_trajectories)¶ A class for storing and retrieving the coordinates of the n-th particle from the table with all trajectories. method: x(n=0) - array, horizontal coordinates of the n-th particle method: y(n=0) - array, vertical coordinates of the n-th particle method: xp(n=0) - array, x’ = dx/dz coordinates of the n-th particle method: yp(n=0) - array, y’ = dy/dz coordinates of the n-th particle method: z(n=0) - array, longitudinal coordinates in Cartesian coordinate system of the n-th particle method: s(n=0) - array, longitudinal coordinates in moving coordinate system of the n-th particle
-
n
(self)¶
-
check
(self, n)¶
-
x
(self, n=0)¶
-
y
(self, n=0)¶
-
z
(self, n=0)¶
-
xp
(self, n=0)¶
-
yp
(self, n=0)¶
-
p
(self, n=0)¶
-
s
(self, n=0)¶
-
p_array_end
(self, p_array)¶
-
-
ocelot.rad.radiation_py.
bspline
(x, y, x_new)¶
-
ocelot.rad.radiation_py.
integ_beta2
(x, y)¶
-
ocelot.rad.radiation_py.
x2xgaus
(X)¶ transform coordinates for gauss integration | | | | -> | x x x . x x x . x x x | | - coordinate x - new coordinate . - removed coordinate |
- Parameters
X – array
- Returns
new array
-
ocelot.rad.radiation_py.
traj2motion
(traj)¶
-
ocelot.rad.radiation_py.
und_field_py
(x, y, z, lperiod, Kx, nperiods=None)¶
-
ocelot.rad.radiation_py.
und_field
¶
-
ocelot.rad.radiation_py.
energy_loss_und
(energy, Kx, lperiod, L, energy_loss=False)¶
-
ocelot.rad.radiation_py.
sigma_gamma_quat
(energy, Kx, lperiod, L)¶ rate of energy diffusion
- Parameters
energy – electron beam energy
Kx – undulator parameter
lperiod – undulator period
L – length
- Returns
sigma_gamma/gamma
-
ocelot.rad.radiation_py.
quantum_diffusion
(energy, Kx, lperiod, L, quantum_diff=False)¶
-
ocelot.rad.radiation_py.
field_map2field_func
(z, By)¶
-
ocelot.rad.radiation_py.
gintegrator
(Xscr, Yscr, Erad, motion, screen, n, n_end, gamma, half_step)¶ - Parameters
Xscr –
Yscr –
Erad –
motion –
screen –
n –
n_end –
gamma –
half_step –
- Returns
-
ocelot.rad.radiation_py.
gintegrator_over_traj_py
(Nmotion, Xscr, Yscr, Erad, n_end, gamma, half_step, Distance, x, y, z, bx, by, XbetaI2, YbetaI2, Bx, By, arReEx, arImEx, arReEy, arImEy, arPhase)¶
-
ocelot.rad.radiation_py.
gintegrator_over_traj
¶
-
ocelot.rad.radiation_py.
wrap_gintegrator
(Nmotion, Xscr, Yscr, Erad, motion, screen, n_end, gamma, half_step)¶
-
ocelot.rad.radiation_py.
radiation_py
(gamma, traj, screen)¶ screen format screen->ReEx[ypoint*xpoint*je + xpoint*jy + jx] += EreX;
-
ocelot.rad.radiation_py.
calculate_radiation
(lat, screen, beam, energy_loss=False, quantum_diff=False, accuracy=1, end_poles=False)¶ Function to calculate radation from the electron beam.
- Parameters
lat – MagneticLattice should include element Undulator
screen – Screen class
beam – Beam class, the radiation is calculated from one electron
energy_loss – False, if True includes energy loss after each period
quantum_diff – False, if True introduces random energy kick
accuracy – 1, scale for trajectory points number
end_poles – False, if True includes end poles with 1/4, -3/4, 1, …
- Returns
-
ocelot.rad.radiation_py.
coherent_radiation
(lat, screen, p_array, energy_loss=False, quantum_diff=False, accuracy=1, end_poles=False, verbose=True)¶ Function to calculate radiation from the electron beam.
- Parameters
lat – MagneticLattice should include element Undulator
screen – Screen class
p_array – ParticleArray - the radiation is calculated for the each particles in the ParticleArray and field components is summing up afterwards.
energy_loss – False, if True includes energy loss after each period
quantum_diff – False, if True introduces random energy kick
accuracy – 1, scale for trajectory points number
verbose – True, print progress
- Returns
-
ocelot.rad.radiation_py.
track4rad_beam
(p_array, lat, energy_loss=False, quantum_diff=False, accuracy=1, end_poles=False)¶ Function calculates the electron trajectory
- Parameters
beam – Beam class
lat – MagneticLattice class
energy_loss – False, flag to calculate energy loss
quantum_diff – False, flag to calculate quantum diffusion
accuracy – 1, accuracy
- Returns
U, E; U - list of u, u is 9xN array (6 coordinats and 3 mag field), E - list of energies
-
ocelot.rad.radiation_py.
x
¶