Rotation#
- class cbclib.Rotation(matrix=array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]))[source]#
A rotation matrix implementation. Provides auxiliary methods to work with Euler and tilt angles.
- Parameters
matrix (
ndarray) – Rotation matrix.
- contents()#
Return a list of the attributes stored in the container that are initialised.
- get(attr, value=None)#
Retrieve a dataset, return
valueif the attribute is not found.
- classmethod import_euler(angles)[source]#
Calculate a rotation matrix from Euler angles with Bunge convention [EUL].
- classmethod import_tilt(angles)[source]#
Calculate a rotation matrix for a set of three angles set of three angles \(\theta, \alpha, \beta\), a rotation angle \(\theta\), an angle between the axis of rotation and OZ axis \(\alpha\), and a polar angle of the axis of rotation \(\beta\).
- items()#
Return (key, value) pairs of the datasets stored in the container.
- Return type
- Returns
(key, value) pairs of the datasets stored in the container.
- keys()#
Return a list of the attributes available in the container.
- replace(**kwargs)#
Return a new container object with a set of attributes replaced.
- to_euler()[source]#
Calculate Euler angles with Bunge convention [EUL].
- Return type
- Returns
A set of Euler angles with Bunge convention \(\phi_1, \Phi, \phi_2\).
- to_tilt()[source]#
Calculate an axis of rotation and a rotation angle for a rotation matrix.
- Return type
- Returns
A set of three angles \(\theta, \alpha, \beta\), a rotation angle \(\theta\), an angle between the axis of rotation and OZ axis \(\alpha\), and a polar angle of the axis of rotation \(\beta\).
- values()#
Return the attributes’ data stored in the container.
- Return type
- Returns
List of data stored in the container.