pyxem / orix

Analysing crystal orientations and symmetry in Python
https://orix.readthedocs.io
GNU General Public License v3.0
80 stars 48 forks source link

Similarity of misorientations #468

Closed jadball closed 6 months ago

jadball commented 7 months ago

Hello all,

Suppose I am looking for pairs of grains that exhibit an orientation relationship. I define the orientation relationship as a Misorientation:

from diffpy.structure import Lattice, Structure
from orix.vector import Miller
from orix.crystal_map import Phase
from orix.quaternion import Misorientation

struc_parent = Structure(lattice=Lattice([3.59, 3.59, 3.59, 90.0, 90.0, 90.0]))
struc_child = Structure(lattice=Lattice([4.38, 4.38, 4.38, 90.0, 90.0, 90.0]))

cubic_parent = Phase(point_group="m-3m", structure=struc_parent)
cubic_child = Phase(point_group="m-3m", structure=struc_child)

parent_dirs = Miller(hkl=[[3, 1, 0], [1, -3, 1]], phase=cubic_parent)
child_dirs = Miller(hkl=[[0, 0, 1], [0, 2, 0]], phase=cubic_child)

misorien_ref = Misorientation.from_align_vectors(child_dirs, parent_dirs)

Now let's say I have a parent and child orientation, and I want to check if their misorientation is similar to misorien_ref:

o_parent = Orientation.from_matrix(parent_matrix, symmetry=cubic_parent.point_group)
o_child = Orientation.from_matrix(child_matrix, symmetry=cubic_child.point_group)

misorien_actual = Misorientation(o_child * (~o_parent), symmetry=(o_child.symmetry, o_parent.symmetry))

How do I find how similar (in terms of angle and accounting for symmetry) misorien_ref and misorien_actual are?

In MTEX, for example, you would do angle(misorien_actual, misorien_ref) ./ degree

Thanks in advance!

hakonanes commented 7 months ago

Hi James!

Can you try to map the misorientations into the symmetry reduced zone and then calling angle_with()?

M_ref = misorien_ref.map_into_symmetry_reduced_zone()
M = misorien_actual.map_into_symmetry_reduced_zone()
w = M.angle_with(M_ref, degree=True)
pc494 commented 6 months ago

closing as stale for now, happy to reopen when appropriate.