at.lattice.cavity_access#
Access to properties of RF cavities
Functions
|
Function to be used as decorator for |
|
Return the RF frequency |
|
Return the total RF voltage (full ring) |
|
Set the RF voltage for the full ring |
|
Return the RF time lag |
|
Set the RF time lag |
|
Set the parameters of the RF cavities |
Classes
|
Enum class for frequency setting |
- frequency_control(func)[source]#
Function to be used as decorator for
func(ring, *args, **kwargs)
If
ring.is_6d
isTrue
and dp, dct or df is specified in kwargs, make a copy of ring with a modified RF frequency, remove dp, dct or df from kwargs and call func with the modified ring.If
ring.is_6d
isFalse
or no dp, dct or df is specified in kwargs, func is called unchanged.Examples
@frequency_control def func(ring, *args, dp=None, dct=None, **kwargs): pass
- get_rf_frequency(ring, **kwargs)[source]#
Return the RF frequency
- Parameters:
ring (Lattice) – Lattice description
- Keyword Arguments:
cavpts=None – Cavity location. If None, look for ring.cavpts, otherwise take all cavities.
array=False –
If False, return the frequency of the selected cavities with the lowest frequency.
If True, return the frequency of all selected cavities
- Returns:
rf_freq – RF frequency
- get_rf_timelag(ring, **kwargs)[source]#
Return the RF time lag
- Parameters:
ring (Lattice) – Lattice description
- Keyword Arguments:
cavpts=None – Cavity location. If None, look for ring.cavpts, otherwise take all cavities.
array=False –
If False, return the frequency of the selected cavities with the lowest frequency.
If True, return the frequency of all selected cavities
- Returns:
rf_timelag – RF time lag
- get_rf_voltage(ring, **kwargs)[source]#
Return the total RF voltage (full ring)
- Parameters:
ring (Lattice) – Lattice description
- Keyword Arguments:
cavpts=None – Cavity location. If None, look for ring.cavpts, otherwise take all cavities.
array=False –
If False, return the frequency of the selected cavities with the lowest frequency.
If True, return the frequency of all selected cavities
- Returns:
rf_v – Total RF voltage (full ring)
- set_cavity(ring, Voltage=None, Frequency=None, TimeLag=None, cavpts=None, copy=False, array=False)[source]#
Set the parameters of the RF cavities
- Parameters:
ring (Lattice) – lattice description
Frequency (float | None) – RF frequency [Hz]
Voltage (float | None) – RF voltage [V]
TimeLag (float | None) – RF time shift [-ct]
cavpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Cavity location. If None, look for ring.cavpts, or otherwise take all cavities
array (bool | None) – If False, the value is applied as described for set_rf_voltage, set_rf_timelag and set_rf_frequency If True, directly apply the value to the selected cavities. The value must be broadcastable to the number of cavities.
copy (bool | None) – If True, returns a shallow copy of ring with new cavity elements. Otherwise, modify ring in-place
- set_rf_timelag(ring, timelag, **kwargs)[source]#
Set the RF time lag
- Parameters:
- Keyword Arguments:
cavpts=None – Cavity location. If None, look for ring.cavpts, otherwise take all cavities.
array=False –
If False, return the frequency of the selected cavities with the lowest frequency.
If True, return the frequency of all selected cavities
copy=False – If True, returns a shallow copy of
ring
with new cavity elements. Otherwise, modifyring
in-place.
- set_rf_voltage(ring, voltage, **kwargs)[source]#
Set the RF voltage for the full ring
- Parameters:
- Keyword Arguments:
cavpts=None – Cavity location. If None, look for ring.cavpts, otherwise take all cavities.
array=False –
If False, return the frequency of the selected cavities with the lowest frequency.
If True, return the frequency of all selected cavities
copy=False – If True, returns a shallow copy of
ring
with new cavity elements. Otherwise, modifyring
in-place.