at.physics.energy_loss#
Functions
|
Computes the energy loss per turn |
|
Adjust the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. |
|
Get the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. |
Classes
|
methods for the computation of energy losses |
- class ELossMethod(value)[source]#
Bases:
Enum
methods for the computation of energy losses
- INTEGRAL = 1#
The losses are obtained from \(E_{loss}=C_\gamma/2\pi . E^4 . I_2\). Takes into account bending magnets and wigglers.
- TRACKING = 2#
The losses are obtained by tracking without cavities. Needs radiation ON, takes into account all radiating elements
- get_energy_loss(ring, method=ELossMethod.INTEGRAL)[source]#
Computes the energy loss per turn
- Parameters:
ring (Lattice) – Lattice description
method (ELossMethod | None) – Method for energy loss computation. See
ELossMethod
.
- Returns:
eloss (float) – Energy loss per turn [eV]
- get_timelag_fromU0(ring, method=ELossMethod.TRACKING, cavpts=None, divider=4, ts_tol=1e-09)[source]#
Get the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. An error occurs if all cavities do not have the same frequency. Used in set_cavity_phase()
- Parameters:
ring (Lattice) – Lattice description
method (ELossMethod | None) – Method for energy loss computation. See
ELossMethod
.cavpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Cavity location. If None, use all cavities. This allows to ignore harmonic cavities.
divider (int | None) – number of segments to search for ts
phis_tol – relative tolerance for ts calculation
- Returns:
timelag (float) – Timelag
ts (float) – Time difference with the present value
- set_cavity_phase(ring, method=ELossMethod.TRACKING, refpts=None, cavpts=None, copy=False)[source]#
Adjust the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. An error occurs if all cavities do not have the same frequency.
Warning
This function changes the time reference, this should be avoided
- Parameters:
ring (Lattice) – Lattice description
method (ELossMethod) – Method for energy loss computation. See
ELossMethod
.cavpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Cavity location. If None, use all cavities. This allows to ignore harmonic cavities.
copy (bool) – If True, returns a shallow copy of ring with new cavity elements. Otherwise, modify ring in-place.