at.lattice.transformation#
Functions
|
Set the tilt, pitch and yaw angle of an |
Classes
|
Enum class for reference option |
- class ReferencePoint(*values)[source]#
Bases:
Enum
Enum class for reference option
- CENTRE = 'CENTRE'#
- ENTRANCE = 'ENTRANCE'#
- transform_elem(elem, reference=ReferencePoint.CENTRE, dx=0.0, dy=0.0, dz=0.0, tilt=0.0, pitch=0.0, yaw=0.0, relative=False)[source]#
Set the tilt, pitch and yaw angle of an
Element
. The tilt is a rotation around the s-axis, the pitch is a rotation around the x-axis and the yaw is a rotation around the y-axis.A positive angle represents a clockwise rotation when looking in the direction of the rotation axis.
The transformations are not all commmutative. The rotations are applied in the order Z -> Y -> X (tilt -> yaw -> pitch). The element is rotated around its mid-point. The mid-point can either be the element entrance (entry face of the downstream drift element) or centre (axis joining the entry and exit points of the element).
If relative is
True
, the previous angles are rebuilt from the r3d matrix and incremented by the input arguments. relative only allows to add the previous angles, not the transverse shifts. The shift is always absolute regardless of the value of relative.pyAT describes the ultra-relativistic beam dynamics in 6D phase space coordinates, which differ from 3D spatial angles in an expansion with respect to the energy to first order by a factor (1 + $\delta$) , where $\delta$ is the relative energy offset. In general this introduces a spurious dispersion (angle proportional to $\delta$), but could create an undesired effect for large energy offsets.
The implementation follows the one described in: https://doi.org/10.1016/j.nima.2022.167487 All the comments featuring ‘Eq’ points to the paper’s equations.
- Parameters:
elem (Element) – Element to be tilted
reference (ReferencePoint) – Transformation reference, either ReferencePoint.ENTRANCE or ReferencePoint.CENTRE
dx (float) – Horizontal shift [m]
dy (float) – Vertical shift [m]
dz (float) – Longitudinal shift [m]
tilt (float) – Tilt angle [rad]
pitch (float) – Pitch angle [rad]
yaw (float) – Yaw angle [rad]
relative (bool) – If
True
, the rotation is added to the previous one