hexrd.phase_transition.variants module

hexrd.phase_transition.variants.expected_num_variants(mat1: Material, mat2: Material, r1: ndarray, r2: ndarray) int[source]

calculate expected number of orientational variants using the formula given in C. Cayron, J. Appl. Cryst. (2007). 40, 1179–1182 page 2 N_alpha = |G_beta|/|H_beta|

hexrd.phase_transition.variants.getOR(r1: ndarray, r2: ndarray, mat1: Material, mat2: Material) ndarray[source]

r1 —> mat1 r2 —> mat2

hexrd.phase_transition.variants.getPhaseTransformationVariants(mat1: Material, mat2: Material, parallel_planes: ndarray, parallel_directions: ndarray, rmat_parent: ndarray | None = None, plot: bool = False, verbose: bool = False) tuple[numpy.ndarray, int][source]

main function to get the phase transformation variants between two materials give a set of parallel planes and parallel directions

Parameters

mat1hexrd.material.Material

Material class for parent phase

mat2hexrd.material.Material

Material class for child phase

parallel_planesnp.ndarray

list of numpy arrays with parallel planes, length=2

parallel_planesnp.ndarray

list of numpy arrays with parallel directions, length=2

rmat_parentnp.ndarray

???, default is np.array([np.eye(3)])

plotboolean

plot the data in stereographic projection if true

hexrd.phase_transition.variants.get_rmats(p1: ndarray, d1: ndarray) ndarray[source]

get rotation matrix

hexrd.phase_transition.variants.isnew(mat: ndarray, rmat: list[numpy.ndarray], sym: ndarray) bool[source]

check if rotation matrix generated is a new one

hexrd.phase_transition.variants.logger = <Logger hexrd.phase_transition.variants (WARNING)>

define some helper functions

hexrd.phase_transition.variants.plot_OR(rmat_parent: ndarray, rmat_variants: ndarray, mat1: Material, mat2: Material, fig: Figure | None = None, ax: Axes | None = None)[source]
hexrd.phase_transition.variants.plot_OR_mat(rmat: ndarray, mat: Material, fig: Figure, ax: Axes, title: str)[source]
hexrd.phase_transition.variants.prepare_data(mat1: Material, mat2: Material, parallel_planes: list[numpy.ndarray], parallel_directions: list[numpy.ndarray]) tuple[tuple[numpy.ndarray, numpy.ndarray], tuple[numpy.ndarray, numpy.ndarray]][source]
prepare the planes and directions by:
  1. converting to cartesian space

  2. normalizing magnitude

hexrd.phase_transition.variants.removeinversion(ksym: ndarray) ndarray[source]

remove all hkl, -hkl pairs from list of symmetrically