from_scipy_rotation#

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

Return misorientations(s) from scipy.spatial.transform.Rotation.

Parameters:
rotation

SciPy rotation(s).

symmetry

Tuple of two sets of crystal symmetries. If not given, the returned misorientation(s) is assumed to be transformation between crystals with only the identity operation, 1 (C1).

Returns:
misorientation

Misorientation(s).

Notes

The SciPy rotation is inverted to be consistent with the orix framework of passive 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)
>>> mori = Misorientation.from_scipy_rotation(
...     r_scipy, (symmetry.Oh, symmetry.Oh)
... )
>>> uvw = Miller(uvw=[1, 1, 0], phase=Phase(point_group="m-3m"))
>>> r_scipy.apply(uvw.data)
array([[-1.,  1.,  0.]])
>>> mori * uvw
Miller (1,), point group m-3m, uvw
[[ 1. -1.  0.]]
>>> ~mori * uvw
Miller (1,), point group m-3m, uvw
[[-1.  1.  0.]]