ocelot.utils.acc_utils
¶
Module Contents¶
Functions¶
|
|
|
Method calculate R56, T566, U5666 and path length of the reference particle for chicanes ‘s’ and ‘c’ type |
|
Function calculates bunching factor for wavelength lambda_mod |
|
Function calculates bunching factor for wavelength lambda_mod |
|
Function calculates mismatch and mismatch phase using two twiss lists. |
|
Function calculates beam parameters: the final beam energy, chirp, curvature, skewness, |
|
Function calculates RF parameters: cavities (first and high harmonic) voltage [GV] and phase [deg] |
|
wrapped up function for EuXFEL linacs |
|
wrapped up function for EuXFEL linacs |
-
ocelot.utils.acc_utils.
RTU_56
(LB, LD, r, m)¶
-
ocelot.utils.acc_utils.
chicane_RTU
(yoke_len, dip_dist, r, type)¶ Method calculate R56, T566, U5666 and path length of the reference particle for chicanes ‘s’ and ‘c’ type
- Parameters
yoke_len – dipole yoke length
dip_dist – distance between 1st and 2nd dipoles on Z-axis (not a particle path but projection on Z-axis)
r – radii of the dipoles
type – type of the chicane “s” or “c”
- Returns
R56, T566, U5666, Sref (distance between magnet 2 and 3 is 0)
-
ocelot.utils.acc_utils.
bunching
(p_array, lambda_mod, smooth_sigma=None)¶ Function calculates bunching factor for wavelength lambda_mod
$b(lambda) =
rac{1}{N_0}left| langle e^{- i rac{ 2 pi}{lambda} s} N(s) angle ight|$
- param p_array
ParticleArray
- param lambda_mod
wavelength
- param smooth_sigma
smoothing parameter
- return
bunching factor
-
ocelot.utils.acc_utils.
slice_bunching
(tau, charge, lambda_mod, smooth_sigma=None)¶ Function calculates bunching factor for wavelength lambda_mod
$b(lambda) =
rac{1}{N_0}left| langle e^{- i rac{ 2 pi}{lambda} s} N(s) angle ight|$
- param p_array
ParticleArray
- param lambda_mod
wavelength
- param smooth_sigma
smoothing parameter
- return
bunching factor
-
ocelot.utils.acc_utils.
calculate_mismatch
(tws_des, tws_err)¶ Function calculates mismatch and mismatch phase using two twiss lists. Result is saved in tws_err list as M_x, M_y, psi_x, psi_y
- Parameters
tws_des – list, design twiss parameters
tws_err – list, error twiss parameters
- Returns
(Mx, My, phi_x, phi_y) mismatch at the end of lattice
-
ocelot.utils.acc_utils.
rf2beam
(v1, phi1, vh, phih, n=3, freq=1300000000.0, E0=0.00675, zeta1=0.0, zeta2=0.0, zeta3=0.0)¶ Function calculates beam parameters: the final beam energy, chirp, curvature, skewness, from the RF parameters: voltages and phases. Note: in EuXFEL case, L1: E0 = 130 MeV, to get correct Sum Voltage for L1/L2, E1’ = E1 - E0
- Parameters
v1 – voltage [GeV] of the first harmonic cavity
phi1 – phase [deg] of the first harmonic cavity
vh – voltage [GeV] of the high harmonic cavity
phih – phase [deg] of the high harmonic cavity
n – 3, number of harmonic of the high harmonic cavity. If n = 0 the high harmonic cavity does not exist
freq – frequency [Hz] of the first harmonic cavity
E0 – initial beam energy [GeV] (from the gun)
zeta1 – initial beam chirp (from the gun)
zeta2 – initial beam curvature (from the gun)
zeta3 – initial beam skewness (from the gun)
- Returns
E1, chirp, curvature, skewness
-
ocelot.utils.acc_utils.
beam2rf
(E1, chirp, curvature, skewness, n, freq, E0=0.00675, zeta1=0.0, zeta2=0.0, zeta3=0.0)¶ Function calculates RF parameters: cavities (first and high harmonic) voltage [GV] and phase [deg] from the final beam energy, chirp, curvature, skewness.
- Parameters
E1 – the beam energy [GeV] after RF system
chirp – the beam chirp
curvature – the beam curvature
skewness – the beam skewness
n – 3, number of harmonic of the high harmonic cavity. If n = 0 the high harmonic cavity does not exist.
freq – frequency [Hz] of the first harmonic cavity
E0 – initial beam energy [GeV] (from the gun)
zeta1 – initial beam chirp (from the gun)
zeta2 – initial beam curvature (from the gun)
zeta3 – initial beam skewness (from the gun)
- Returns
v1, phi1, vh, phih
-
ocelot.utils.acc_utils.
beam2rf_xfel_linac
(sum_voltage, chirp, init_energy=0.13)¶ wrapped up function for EuXFEL linacs
- Parameters
sum_voltage – in control system [GeV]
chirp – in control system [GeV]
init_energy – for L1 it is 0.13 GeV, L2 = 0.7 GeV
- Returns
v1, phi1
-
ocelot.utils.acc_utils.
rf2beam_xfel_linac
(v, phi, init_energy=0.13)¶ wrapped up function for EuXFEL linacs
- Parameters
v –
phi –
init_energy – for L1 it is 0.13 GeV, L2 = 0.7 GeV
- Returns