from_align_vectors#
- classmethod Misorientation.from_align_vectors(other: Miller, initial: Miller, weights: Optional[ndarray] = None, return_rmsd: bool = False, return_sensitivity: bool = False) Union[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
otherandinitialafter alignment. Default isFalse.- return_sensitivity
Whether to return the sensitivity matrix. Default is
False.
- Returns:
estimated_misorientationBest estimate of the misorientation that transforms
initialtoother. The symmetry of the misorientation is inferred from the phase ofotherandinitial, if given.rmsdReturned when
return_rmsd=True.sensitivityReturned when
return_sensitivity=True.
- Raises:
ValueErrorIf
otherandinitialare not Miller instances.
Examples
>>> from orix.quaternion import Misorientation >>> from orix.vector import Miller >>> from orix.crystal_map import Phase >>> uvw1 = Miller(uvw=[[1, 0, 0], [0, 1, 0]], phase=Phase(point_group="m-3m")) >>> uvw2 = Miller(uvw=[[1, 0, 0], [0, 0, 1]], phase=Phase(point_group="m-3m")) >>> mori12 = Misorientation.from_align_vectors(uvw2, uvw1) >>> mori12 * uvw1 Miller (2,), point group m-3m, uvw [[1. 0. 0.] [0. 0. 1.]]