-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
angle_with()
giving weird results
#431
Comments
Thank you for bringing this up, @anderscmathisen. I got the same misorientation angle with MTEX v5.8.2: >> cs = crystalSymmetry('C6v');
%% Inverted, because MTEX defines orientations as crystal -> sample
>> o1 = orientation([0.2283 -0.6892 0.13 -0.6752], cs);
>> o2 = orientation([0.7028 0.2065 -0.6714 -0.1126], cs);
>> angle(o1, o2) / degree
ans =
178.3219 What you've plotted above is where the sample Z direction points in the two crystals. The points are located about 5 degrees apart because they have been projected into the fundamental sector of 6mm: from orix.quaternion import Orientation, symmetry
from orix.vector import Vector3d
pg = symmetry.C6v
ori1 = Orientation([0.2283, 0.6892, -0.13, 0.6752], symmetry=pg)
ori2 = Orientation([0.7028, -0.2065, 0.6714, 0.1126], symmetry=pg)
# Rotate sample Z into crystals
v1 = ori1 * Vector3d.zvector()
v2 = ori2 * Vector3d.zvector()
v1.angle_with(v2, degrees=True) # Outputs: array([55.55565557])
fig = v1.scatter(return_figure=True, c="tab:blue")
v2.scatter(figure=fig, c="tab:orange")
v1.in_fundamental_sector(pg).scatter(figure=fig, c="tab:green")
fig.axes[0].plot(pg.fundamental_sector.edges, color="k") |
Forgot to ask, but what misorientation (angle) do you expect? |
Hmm, yes I suspected it might have something to do with a projection, however, I thought that The orientations I am calculating angles between are from a TEM tilt series where the sample was tilted 5° between capturing SPED data. (orientations found by template matching using pyxem). And so I was expecting to get about that angle. But the |
I think I understand what you want: from orix.crystal_map import Phase
from orix.vector import Miller
phase_6mm = Phase(point_group=symmetry.C6v)
m1 = Miller(uvw=(ori1 * Vector3d.zvector()).data, phase=phase_6mm)
m2 = Miller(uvw=(ori2 * Vector3d.zvector()).data, phase=phase_6mm)
m1.angle_with(m2, degrees=True) # Output: array([55.55565557])
m1.angle_with(m2, use_symmetry=True, degrees=True) # Output: array([3.16904388]) |
I am trying to calculate some angles between
Orientations
by using theangle_with()
function and getting some weird numbers.Below is a code showing what I mean.
Output:
[178.32181777]
In the scatterplot IPF (z-direction), these orientations are, as the image below shows, very close ~5° and I don't understand why
angle_with()
is giving me such a high angle.PS: I am running v.0.10.0, but v.0.11.0 gives the same
The text was updated successfully, but these errors were encountered: