at.physics.energy_loss#

Functions

get_energy_loss(ring[, method])

Computes the energy loss per turn

set_cavity_phase(ring[, method, refpts, ...])

Adjust the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero.

get_timelag_fromU0(ring[, method, cavpts, ...])

Get the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero.

Classes

ELossMethod(value)

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:
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:
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: