from_scipy_rotation#

classmethod Orientation.from_scipy_rotation(rotation: Rotation, symmetry: Symmetry | None = 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:
O

Orientations.

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)
>>> O = Orientation.from_scipy_rotation(R_scipy, symmetry.Oh)
>>> v = [1, 1, 0]
>>> R_scipy.apply(v)
array([-1.,  1.,  0.])
>>> O * Vector3d(v)
Vector3d (1,)
[[ 1. -1.  0.]]