from_scipy_rotation#

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

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

Parameters:
rotation

SciPy rotation(s).

symmetry

Crystal symmetry. If not given, the returned orientation(s) is given only the identity symmetry operation, 1 (C1).

Returns:
orientation

Orientation(s).

Notes

The SciPy rotation is inverted to be consistent with the orix framework of passive rotations.

Examples

>>> from orix.quaternion import Orientation, symmetry
>>> from orix.vector import Vector3d
>>> from scipy.spatial.transform import Rotation as SciPyRotation
>>> r_scipy = SciPyRotation.from_euler("ZXZ", [90, 0, 0], degrees=True)
>>> ori = Orientation.from_scipy_rotation(r_scipy, symmetry.Oh)
>>> v = [1, 1, 0]
>>> r_scipy.apply(v)
array([-1.,  1.,  0.])
>>> ori * Vector3d(v)
Vector3d (1,)
[[ 1. -1.  0.]]