at.lattice.elements.basic_elements#
Basic Element
classes
Classes
|
Marker element |
|
Monitor element |
|
Element to compute bunches mean and std |
|
Element computing the mean and std of slices |
|
Transverse aperture element |
|
Longitudinal aperture element |
|
Base class for long elements |
|
Drift space element |
|
Collimator element |
|
RF cavity element |
|
Linear (6, 6) transfer matrix |
|
Linear tracking element for a simplified quantum diffusion, radiation damping and energy loss. |
|
Simple radiation damping and energy loss |
|
Quantum diffusion element |
|
Energy loss element |
- class Aperture(family_name, limits, **kwargs)[source]#
Bases:
Element
Transverse aperture element
- Parameters:
family_name – Name of the element
limits – (4,) array of physical aperture: [xmin, xmax, ymin, ymax]
Default PassMethod:
AperturePass
- class BeamMoments(family_name, **kwargs)[source]#
Bases:
Element
Element to compute bunches mean and std
- Parameters:
family_name (str) – Name of the element
Default PassMethod:
BeamMomentsPass
- property means#
Beam 6d centre of mass
- property stds#
Beam 6d standard deviation
- class Collimator(family_name, length, limits, **kwargs)[source]#
Bases:
Drift
Collimator element
- Parameters:
Default PassMethod:
DriftPass
- class Drift(family_name, length, **kwargs)[source]#
Bases:
LongElement
Drift space element
Default PassMethod:
DriftPass
- insert(insert_list)[source]#
insert elements inside a drift
- Parameters:
insert_list (Iterable[tuple[float, Element | None]]) –
iterable, each item of insert_list is itself an iterable with 2 objects:
the location where the centre of the element will be inserted, given as a fraction of the Drift length.
an element to be inserted at that location. If
None
, the drift will be divided but no element will be inserted.
- Returns:
elem_list – a list of elements.
Drifts with negative lengths may be generated if necessary.
Examples
>>> Drift("dr", 2.0).insert(((0.25, None), (0.75, None))) [Drift('dr', 0.5), Drift('dr', 1.0), Drift('dr', 0.5)]
>>> Drift("dr", 2.0).insert(((0.0, Marker("m1")), (0.5, Marker("m2")))) [Marker('m1'), Drift('dr', 1.0), Marker('m2'), Drift('dr', 1.0)]
>>> Drift("dr", 2.0).insert(((0.5, Quadrupole("qp", 0.4, 0.0)),)) [Drift('dr', 0.8), Quadrupole('qp', 0.4), Drift('dr', 0.8)]
- class EnergyLoss(family_name, energy_loss, **kwargs)[source]#
Bases:
_DictLongtMotion
,Element
Energy loss element
The
EnergyLoss
element is taken into account inradiation_parameters()
: it adds damping by contributing to the \(I_2\) integral, thus reducing the equilibrium emittance. But it does not generate any diffusion. This makes sense only if the losses summarised in the element occur in non-dispersive locations.It is a single thin, straight non-focusing radiative element that does not contribute to the diffusion. It’s typical usage is to model the energy loss and contribution to the damping times from a thin wiggler located in a non dispersive region. More complex cases with focusing and / or diffusion are not correctly handled by this element.
- default_pass = {False: 'IdentityPass', True: 'EnergyLossRadPass'}#
- class LongElement(family_name, length, *args, **kwargs)[source]#
Bases:
Element
Base class for long elements
Other arguments and keywords are given to the base class
- divide(frac)[source]#
split the element in len(frac) pieces whose length is frac[i]*self.Length
- Parameters:
frac – length of each slice expressed as a fraction of the initial length.
sum(frac)
may differ from 1.- Returns:
elem_list – a list of elements equivalent to the original.
Example
>>> Drift("dr", 0.5).divide([0.2, 0.6, 0.2]) [Drift('dr', 0.1), Drift('dr', 0.3), Drift('dr', 0.1)]
- class LongtAperture(family_name, limits, **kwargs)[source]#
Bases:
Element
Longitudinal aperture element
- Parameters:
family_name – Name of the element
limits – (4,) array of physical aperture: [dpmin, dpmax, ctmin, ctmax]
Default PassMethod:
LongtAperturePass
- class M66(family_name, m66=None, **kwargs)[source]#
Bases:
Element
Linear (6, 6) transfer matrix
- Parameters:
family_name (str) – Name of the element
m66 – Transfer matrix. Default: Identity matrix
Default PassMethod:
Matrix66Pass
- class Marker(family_name, **kwargs)[source]#
Bases:
Element
Marker element
- Parameters:
family_name (str) – Name of the element
All keywords will be set as attributes of the element
- class Monitor(family_name, **kwargs)[source]#
Bases:
Element
Monitor element
- Parameters:
family_name (str) – Name of the element
All keywords will be set as attributes of the element
- class QuantumDiffusion(family_name, lmatp, **kwargs)[source]#
Bases:
_DictLongtMotion
,Element
Quantum diffusion element
- Parameters:
family_name (str) – Name of the element
lmatp (np.ndarray) – Diffusion matrix for generation (see
gen_quantdiff_elem()
)
Default PassMethod:
QuantDiffPass
- default_pass = {False: 'IdentityPass', True: 'QuantDiffPass'}#
- class RFCavity(family_name, length, voltage, frequency, harmonic_number, energy, **kwargs)[source]#
Bases:
LongtMotion
,LongElement
RF cavity element
- Parameters:
- Keyword Arguments:
TimeLag=0 – Cavity time lag
Default PassMethod:
RFCavityPass
- default_pass = {False: 'DriftPass', True: 'RFCavityPass'}#
- class SimpleQuantDiff(family_name, betax=1.0, betay=1.0, emitx=0.0, emity=0.0, espread=0.0, taux=0.0, tauy=0.0, tauz=0.0, **kwargs)[source]#
Bases:
_DictLongtMotion
,Element
Linear tracking element for a simplified quantum diffusion, radiation damping and energy loss.
Note: The damping times are needed to compute the correct kick for the emittance. Radiation damping is NOT applied.
- Parameters:
family_name (str) – Name of the element
betax (float) – Horizontal beta function at element [m]
betay (float) – Vertical beta function at element [m]
emitx (float) – Horizontal equilibrium emittance [m.rad]
emity (float) – Vertical equilibrium emittance [m.rad]
espread (float) – Equilibrium energy spread
taux (float) – Horizontal damping time [turns]
tauy (float) – Vertical damping time [turns]
tauz (float) – Longitudinal damping time [turns]
Default PassMethod:
SimpleQuantDiffPass
- default_pass = {False: 'IdentityPass', True: 'SimpleQuantDiffPass'}#
- class SimpleRadiation(family_name, taux=0.0, tauy=0.0, tauz=0.0, U0=0.0, **kwargs)[source]#
Bases:
_DictLongtMotion
,Radiative
,Element
Simple radiation damping and energy loss
- Parameters:
Default PassMethod:
SimpleRadiationRadPass
- default_pass = {False: 'IdentityPass', True: 'SimpleRadiationRadPass'}#
- class SliceMoments(family_name, nslice, **kwargs)[source]#
Bases:
Element
Element computing the mean and std of slices
- Parameters:
- Keyword Arguments:
startturn – Start turn of the acquisition (Default 0)
endturn – End turn of the acquisition (Default 1)
Default PassMethod:
SliceMomentsPass
- property endturn#
End turn of the acquisition
- property means#
Slices x,y,dp centre of mass
- property spos#
Slices s position
- property startturn#
Start turn of the acquisition
- property stds#
Slices x,y,dp standard deviation
- property weights#
Slices weights in mA if beam current >0, otherwise fraction of total number of particles in the bunch