upxo.xtalphy.orientation module
Orientation and misorientation utilities.
Functions
eamo : Euler-angle misorientation (major work done; validations pending). qmo : Quaternion misorientation (major work done; validations pending).
- upxo.xtalphy.orientation.eamo(e1, e2list, symm)[source]
Euler-angle misorientation between one orientation and a list of others.
- Parameters:
- Returns:
Misorientation angles in degrees.
- Return type:
Examples
>>> import numpy as np >>> from upxo.xtalphy.orientation import eamo >>> e1 = np.array([0, 0, 0], dtype=float) >>> e2list = np.array([[0, 0, 0], [45, 0, 0], [45, 45, 0]], dtype=float) >>> eamo(e1, e2list, 'cubic')
- upxo.xtalphy.orientation.qmo(q1, q2list, symm)[source]
Quaternion misorientation between one quaternion and a list of others.
- Parameters:
- Returns:
Misorientation angles in degrees.
- Return type:
ndarray
Examples
>>> qmo(q1, q2list, 'cubic')
- class upxo.xtalphy.orientation.grainoris(gid=None, s=None, ea=numpy.array, pea1=[0.0, 0.0], pea2=[0.0, 0.0], pea3=[0.0, 0.0], deg=False)[source]
Bases:
objectGrain orientation container: Euler angles, quaternions, and statistics.
Examples
>>> import numpy as np >>> from upxo.xtalphy.orientation import grainoris >>> n = 4 >>> ea1 = np.random.randint(0, 90, n) >>> ea2 = np.random.randint(0, 90, n) >>> ea3 = np.random.randint(0, 90, n) >>> G = grainoris(ea=np.vstack((ea1, ea2, ea3)).T) >>> G.compute_quats() >>> G.compute_avg()
- gid
- s
- ea
- pea1
- pea2
- q
- property perturb
Perturb.
- property eapert
Perturb.
- property p_ea1_deg
P ea1 deg.
- pea3
- qavg
- property p_ea2_deg
P ea2 deg.
- property p_ea3_deg
P ea3 deg.
- property coords
Coords.