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
andinitial
after alignment. Default isFalse
.- return_sensitivity
Whether to return the sensitivity matrix. Default is
False
.
- Returns:
estimated_misorientation
Best estimate of the misorientation that transforms
initial
toother
. The symmetry of the misorientation is inferred from the phase ofother
andinitial
, if given.rmsd
Returned when
return_rmsd=True
.sensitivity
Returned when
return_sensitivity=True
.
- Raises:
ValueError
If
other
andinitial
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.]]