hexrd.wppf.texture module

class hexrd.wppf.texture.harmonic_model(pole_figures, sample_symmetry, max_degree)[source]

Bases: object

this class brings all the elements together to compute the texture model given the sample and crystal symmetry.

property J
calc_inverse_pole_figures(sample_dir='ND', grid='equiangular', resolution=5.0)[source]

given a sample direction such as TD, RD and ND, calculate the distribution of crystallographic axes aligned with that direction. this is sometimes more useful than the regular pole figures especially for cylindrical sample symmetry where the PFs are usually “Bulls Eye” type. this follows the same flow as the pole figure calculation. sample_dir can have “RD”, “TD” and “ND” as string arguments or can also have a nx3 array grid can be “equiangular” or “FEM” resolution in degrees. only used for equiangular grid

instead of sampling asymmetric unit of stereogram, we will sample the entire northern hemisphere. the resulting IPDF will have symmetry of crystal

calc_pole_figures(hkls, grid='equiangular')[source]

given a set of hkl, coefficients and maximum degree of harmonic function to use for both crystal and sample symmetries, compute the pole figures for full coverage. the default grid is the equiangular grid, but other options include computing it on the s2 mesh or modified lambert grid or custom (theta, phi) coordinates.

this uses the general axis distributiin function. other formalisms such as direct pole figure inversion is also possible using quadratic programming, but for that explicit pole figure operators are needed. the axis distributuion function is easy to integrate with the rietveld method.

compute_texture_factor(coeff)[source]

first check if the size of the coef vector is consistent with the max degree argumeents for crystal and sample.

init_coeff_params()[source]

this function initializes a lmfit parameter class with all the coefficients. this will be passed to the minimize routine

init_equiangular_grid()[source]

this function initializes sample directions for an 5x5 equiangular grid of points. the harmonic functions will be calculated using the calc_pole_figures function instead of here.

init_harmonic_values()[source]

once the harmonic model is initialized, initialize the values of the harmonic functions for different values of hkl and sample directions. the hkl are the keys and the sample_dir are the values of the sample_dir dictionary.

property phon
recalculate_pole_figures()[source]

this function calculates the pole figures for the sample directions in the pole figure used to initialize the model. this can be used to test how well the harmonic model fit the data.

refine()[source]
residual_function(params)[source]

calculate the residual between input pole figure data and generalized axis distribution function

set_coeff_from_param(params)[source]

this function takes the the values in the parameters and sets the values of the coefficients

write_pole_figures(pfdata)[source]

take output of the calc_pole_figures routine and write it out as text files

class hexrd.wppf.texture.inverse_pole_figures(sample_dir, sampling='equiangular', resolution=5.0)[source]

Bases: object

this class deals with everything related to inverse pole figures.

property angs
initialize_crystal_dir(samplingtype, resolution=5.0)[source]

this function prepares the unit vectors of the stereogram

property resolution
property sample_dir

sample direction for IPF

property sampling
class hexrd.wppf.texture.mesh_s2(symmetry)[source]

Bases: object

this class deals with the basic functions of the s2 mesh. the class is initialized just based on the symmetry. the main functions are the interpolation of harmonic values for a given set of points and the number of invariant harmonics up to a maximum degree. this is the main class used for computing the general axis distribution function.

denominator(m, max_degree)[source]

this function computes the Maclaurin expansion of the function 1/(1-t^m) this is just the binomial expansion with negative exponent

1/(1-x^m) = 1 + x^m + x^2m + x^3m …

num_invariant_harmonic(max_degree)[source]

>> @AUTHOR: Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov >> @DATE: 06/29/2021 SS 1.0 original

>> @DETAILS: this function computes the number of symmetrized harmonic coefficients

for a given degree. this is essential for computing the number of terms that is in the summation of the general axis distribution function. the generating function of the dimension of the invariant subspace is given by Meyer and Polya and enumerated in “ON THE SYMMETRIES OF SPHERICAL HARMONICS”, Burnett Meyer

>> @PARAMETERS: symmetry, degree

class hexrd.wppf.texture.pole_figures(material, hkls, pfdata, bHat_l=array([[-0.], [-0.], [-1.]]), eHat_l=array([[1.], [0.], [0.]]), chi=0.0)[source]

Bases: object

this class deals with everything related to pole figures. pole figures can be initialized in a number of ways. the most basic being the (x,y,z, intensities) array. There are other formats which will be slowly added to this class. a list of hkl and a material/material_rietveld class is also supplied along with the (angle, intensity) info to get a class holding all the information. @DATE 10/06/2021 SS changes input from angles to unit vectors

and added routines to compute the angles

property angs
convert_hkls_to_cartesian()[source]

this routine converts hkls in the crystallographic frame to the cartesian frame and normalizes them

property gvecs
property intensities
property num_pfs

number of pole figures (read only)

property pfdata
write_data(prefix)[source]

write out the data in text format the prefix goes in front of the names name will be “<prefix>_hkl.txt”