from_align_vectors#

classmethod Misorientation.from_align_vectors(other: Miller, initial: Miller, weights: ndarray | None = None, return_rmsd: bool = False, return_sensitivity: bool = False) Misorientation | Tuple[Misorientation, float] | Tuple[Misorientation, ndarray] | Tuple[Misorientation, float, ndarray][source]#

Return an estimated misorientation to optimally align two sets of vectors, one set in each crystal.

This method wraps align_vectors(). See that method for further explanations of parameters and returns.

Parameters:
other

Directions of shape (n,) in the other crystal.

initial

Directions of shape (n,) in the initial crystal.

weights

Relative importance of the different vectors.

return_rmsd

Whether to return the (weighted) root mean square distance between other and initial after alignment. Default is False.

return_sensitivity

Whether to return the sensitivity matrix. Default is False.

Returns:
estimated_misorientation

Best estimate of the misorientation that transforms initial to other. The symmetry of the misorientation is inferred from the phase of other and initial, if given.

rmsd

Returned when return_rmsd=True.

sensitivity

Returned when return_sensitivity=True.

Raises:
ValueError

If other and initial are not Miller instances.

Examples

>>> from orix.quaternion import Misorientation
>>> from orix.vector import Miller
>>> from orix.crystal_map import Phase
>>> t1 = Miller(uvw=[[1, 0, 0], [0, 1, 0]], phase=Phase(point_group="m-3m"))
>>> t2 = Miller(uvw=[[1, 0, 0], [0, 0, 1]], phase=Phase(point_group="m-3m"))
>>> M12 = Misorientation.from_align_vectors(t2, t1)
>>> M12 * t1
Miller (2,), point group m-3m, uvw
[[1. 0. 0.]
 [0. 0. 1.]]

Examples using Misorientation.from_align_vectors#

Misorientation from aligning directions

Misorientation from aligning directions

Orientation from aligning directions

Orientation from aligning directions