-
Notifications
You must be signed in to change notification settings - Fork 59
Mean of orientations, with symmetry #434
Description
Hello there!
It seems that the mean() method for orientations actually doesn't take the orientations' symmetry into account. For instance, let's consider the m-3m symmetry and a set of 3 close orientations:
from orix.quaternion import symmetry, Orientation
s = symmetry.Oh # Cubic symmetry
o = Orientation.from_euler([[0,0,0], [1,89,0], [1,1,89]],symmetry=s,degrees=True)
print(o.in_euler_fundamental_region()*180/np.pi) # Just to be sure what we're talking about
# Compute and print the mean orientation
obar = o.mean()
print(obar.in_euler_fundamental_region()*180/np.pi)Thus, the output is:
[[ 0. 0. 0.]
[ 1. 89. 0.]
[ 1. 1. 89.]]
[[15.79096054 30.29090638 15.77845771]]
The result is quite strange. Indeed, the same computation on MTEX
CS=crystalSymmetry('m-3m')
mean(orientation.byEuler([0,1,1]*degree, [0,89,1]*degree, [0,0,89]*degree,CS))gives
ans = orientation (m-3m -> xyz)
Bunge Euler angles in degree
phi1 Phi phi2 Inv.
90.8333 0.00290889 269.5 0
Still, the same with CS=crystalSymmetry('1') leads to:
Bunge Euler angles in degree
phi1 Phi phi2 Inv.
15.791 30.2909 15.7785 0
Am I doing something wrong? I have looked into MTEX's code, and I understand that the mean() method actually relies on the project2FundamentalRegion function. I have tried to implement it in orix, but without any success.
Thank you in advance.