Module: orientations¶
8 Classes¶
- class hexrd.orientations.RotationParameterization(args)[source]¶
template for rotation parameterization class
- class hexrd.orientations.RotInv(*args)[source]¶
Bases: hexrd.orientations.RotationParameterization
rotation invariants
- class hexrd.orientations.KocksEuler(*args)[source]¶
Bases: hexrd.orientations.RotationParameterization
Kocks Euler angles see equation 6 page 65 of koc-tom-wen-98a (Kocks, Tome, & Wenk; Texture and Anisotropy)
- class hexrd.orientations.BungeEuler(*args)[source]¶
Bases: hexrd.orientations.RotationParameterization
Bunge Euler angles see koc-tom-wen-98a (Kocks, Tome, & Wenk; Texture and Anisotropy)
- class hexrd.orientations.Quat(*args)[source]¶
Bases: hexrd.orientations.RotationParameterization
quaternions, normalized; parameterization of SO(3); do not bother making unique (is 2-to-1)
- class hexrd.orientations.Fiber(latVec, recipVec)[source]¶
Like John Edmiston’s MakeFiber class, but with the implementation more tightly coupled to the rest of the code base
- distBetweenFibers(other)[source]¶
Compute the distance between two fibers using the polar decomposition of the projection operator taking one geodesic plane to the other. input: instance of MakeFiber class output: (max_eigenvalue, Rotation at max_eigenvalue), intersecting fibers would have max_eigenvalue ~ 1. Rotation at max_eigenvalue would be the ‘closest’ Rotation which would relate the two fibers.
25 Functions¶
- hexrd.orientations.traceToAng(tr)[source]¶
given trace of a rotation matrix find the angle or rotation
- hexrd.orientations.matToQuat(r)[source]¶
based on Spurrier’s algorithm for quaternion extraction, as described in cite{sim-vuq-85a}
returns a 4-vector, not a Quat instance
BibTeX: @TechReport{sim-vuq-85a, author = {J. C. Simo and L. {Vu Quoc}}, title = {Three dimensional finite strain rod model part
{II}: computational aspects, Memorandum No. {UCB/ERL M85/31}},- institution = {Electronics Research Laboratory, College of
- Engineering, University of California, Berkeley},
year = {1985} }
- hexrd.orientations.matToThetaN(r)[source]¶
2nd order tensor => angle/axis
to see that angle is right take R in a basis so that R11=1; get tr(R) = 1 + 2 cos(theta), solve for theta and use argument about invariance of tr(R)
references: 1) box 4 in Simo and VuQuoc, 1985, ERL Berkeley memorandum no. UCB/ERL M85/31 2) Marin and Dawson 98 part 1, equation for update d_rstar (exponential mapping)
n is in vector notation of a skew tensor according to w_i = 1/2 epsilon_jik W_jk
- hexrd.orientations.quatToMat(quat)[source]¶
Take an array of n quats (numpy ndarray, 4 x n) and generate an array of rotation matrices (n x 3 x 3)
Uses the truncated series expansion for the exponential map; divide-by-zero is checked using the global ‘tinyRotAng’
- hexrd.orientations.quatToProdMat(quat, mult='right')[source]¶
Form 4 x 4 arrays to perform the quaternion product
- USAGE
- qmats = quatToProdMat(quats, mult=’right’)
- INPUTS
quats is (4, n), a numpy ndarray array of n quaternions horizontally concatenated
mult is a keyword arg, either ‘left’ or ‘right’, denoting the sense of the multiplication:
/ quatToProdMat(h, ‘right’) * q
- q * h –> <
quatToProdMat(q, ‘left’) * h
- OUTPUTS
- qmats is (n, 4, 4), the left or right quaternion product operator
- NOTES
- *) This function is intended to replace a cross-product based
- routine for products of quaternions with large arrays of quaternions (e.g. applying symmetries to a large set of orientations).
- hexrd.orientations.rotMatrixFromCrystalVectors(cvs1=None, cvs2=None, cvs3=None)[source]¶
Make a rotation matrix in the RotationParameterization convention from components of crystal vectors that are along given sample directions
- hexrd.orientations.makeQuatsBall(qRef, thetaScale, n)[source]¶
make n quaternions in a ball around qRef, with ball size scaled by thetaScale
- hexrd.orientations.millerBravais2Normal(invec, *args)[source]¶
- Generate the normal(s) for a plane(s) given in
the Miller-Bravais convention for the hexagonal basis {a1, a2, a3, c}. The basis for the output {o1, o2, o3} is chosen such that:
o1 || a1 o3 || c o2 = o3 ^ o1
returns a (3, n) array of horizontally concatenated unit vectors