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:
  • e1 (ndarray, shape (3,)) – Bunge Euler angles of the reference orientation, in degrees.

  • e2list (ndarray, shape (N, 3)) – Bunge Euler angles of N comparison orientations, in degrees.

  • symm (str) – Crystal symmetry label (e.g. 'cubic').

Returns:

Misorientation angles in degrees.

Return type:

ndarray, shape (N,)

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:
  • q1 (defdap.quat.Quat) – Reference quaternion.

  • q2list (list of defdap.quat.Quat) – Comparison quaternions.

  • symm (str) – Crystal symmetry label (e.g. 'cubic').

Returns:

Misorientation angles in degrees.

Return type:

ndarray

Examples

>>> qmo(q1, q2list, 'cubic')
upxo.xtalphy.orientation.ipf(vector, symm)[source]

Ipf.

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: object

Grain 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
compute_avg()[source]

Return the ute avg.

compute_quats()[source]

Return the ute quats.

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.