pyxtal.XRD module
Module for XRD simulation (experimental stage)
- class pyxtal.XRD.Profile(method='mod_pseudo-voigt', res=0.02, user_kwargs=None)[source]
Bases:
object
This class applies a profiling function to simulated or experimentally obtained XRD spectra.
- Parameters:
method (str) – Type of function used to profile
res (float) – resolution of the profiling array in degree
user_kwargs (dict) – The parameters for the profiling method.
- class pyxtal.XRD.Similarity(f, g, N=None, x_range=None, l=2.0, weight='cosine')[source]
Bases:
object
- class pyxtal.XRD.XRD(crystal, wavelength=1.54184, thetas=None, res=0.01, per_N=30000, ncpu=1, filename=None, preferred_orientation=False, march_parameter=None)[source]
Bases:
object
a class to compute the powder XRD.
- Parameters:
crystal – ase atoms object
wavelength – float
max2theta – float
per_N – int
ncpu – int
preferred_orientation – boolean
march_parameter – float
- get_unique_families(hkls)[source]
Returns unique families of Miller indices. Families must be permutations of each other. :param hkls: List of Miller indices. :type hkls: [h, k, l]
- Returns:
multiplicity}: A dict with unique hkl and multiplicity.
- Return type:
{hkl
- intensity(crystal, TWO_THETA_TOL=1e-05, SCALED_INTENSITY_TOL=1e-05)[source]
This function calculates all that is necessary to find the intensities. This scheme is similar to pymatgen If the number of hkl is significanly large, will automtically switch to the fast mode in which we only calculate the intensity and do not care the exact hkl families
- Parameters:
TWO_THETA_TOL – tolerance to find repeating angles
SCALED_INTENSITY_TOL – threshold for intensities
- plot_pxrd(filename=None, profile=None, minimum_I=0.01, show_hkl=True, fontsize=None, figsize=(20, 10), res=0.02, fwhm=0.1, ax=None, xlim=None, width=1.0, legend=None, show=False)[source]
plot PXRD
- Parameters:
filename (None) – name of the xrd plot. If None, show the plot
profile – type of peak profile
minimum_I (0.01) – the minimum intensity to include in the plot
show_hkl (True) – whether or not show hkl labels
fontsize (None) – fontsize of text in the plot
figsize ((20, 10)) – figsize
xlim (None) – the 2theta range [x_min, x_max]
- pyxtal.XRD.get_all_intensity_par(cpu, queue, cycles, Start, End, hkl_per_proc, positions, hkls, s2s, coeffs, zs)[source]
- pyxtal.XRD.mod_pseudo_voigt(x, fwhm, A, eta_h, eta_l, N)[source]
A modified split-type pseudo-Voigt function for profiling peaks - Izumi, F., & Ikeda, T. (2000).
- pyxtal.XRD.pseudo_voigt(theta2, alpha, fwhm, eta)[source]
Original Pseudo-Voigt function for profiling peaks - Thompson, D. E. Cox & J. B. Hastings (1986).