from_scipy_rotation#

classmethod Misorientation.from_scipy_rotation(rotation: Rotation, symmetry: Tuple[Symmetry, Symmetry] | None = None) Misorientation[source]#

Return misorientationss from scipy.spatial.transform.Rotation.

Parameters:
rotation

SciPy rotations.

symmetry

Tuple of two sets of crystal symmetries. If not given, the returned misorientations are assumed to be transformations between crystals with only the identity operation, 1 (C1).

Returns:
M

Misorientations.

Notes

The SciPy rotations are inverted to be consistent with the orix framework of rotations.

Examples

>>> from orix.crystal_map import Phase
>>> from orix.quaternion import Misorientation, symmetry
>>> from orix.vector import Miller
>>> from scipy.spatial.transform import Rotation as SciPyRotation
>>> R_scipy = SciPyRotation.from_euler("ZXZ", [90, 0, 0], degrees=True)
>>> M = Misorientation.from_scipy_rotation(
...     R_scipy, (symmetry.Oh, symmetry.Oh)
... )
>>> t = Miller(uvw=[1, 1, 0], phase=Phase(point_group="m-3m"))
>>> R_scipy.apply(t.data)
array([[-1.,  1.,  0.]])
>>> M * t
Miller (1,), point group m-3m, uvw
[[ 1. -1.  0.]]
>>> ~M * t
Miller (1,), point group m-3m, uvw
[[-1.  1.  0.]]