polyTEM.paracrystallineΒΆ

Built off of LatticeDisorder.py

Functions

calc_g(qvals, label[, N, plot, saveplotfile])

Bin/Histogram the distribution of qvals Calculate paracrystallinity % g where g = np.sqrt(E[d**2] / E[d] - 1) d == d-spacing of lattice plane E[x**n] == expected value, or nth moment of random variable x -- INPUTS qvals = 1D np.array of q_centers to count label = plot title, can include spaces N = number of images this is binned across

get_fwhm(x)

x is array of observed q-values assuming that distribution of x is Gaussian like the FWHM of the distribution of x is std*np.sqrt(8 * np.log(2))

get_fwhm_fromg(d, g[, erms])

From Appendix B in Rivnay, et al. Warren-Averbach paper FWHM of a Voigt profile = (4*np.pi**2 * g**2 / d )(0.5346 + np.sqrt(0.2166 + (8*np.log(2) * erms**2)/g**2)).

get_q_dist(q_datacube, peak_model, params[, ...])

From 4D datacube containing the Integrated Intensity vs q linecuts from FFT output, peak fit and extract q-value of peak center.

get_sigma(fwhm)

assuming that the distribution is gaussian like then the standard deviation sigma = fwhm / (np.sqrt(8 * np.log(2)))

lattice_fluc(qvals, label)

Calculates the root-mean-square value of lattice parameter fluctuations e_rms = np.sqrt( E[e**2] ) e = delta_d / d, where d=d-spacing E[x] is expected value of x

mp_peakfit_func(row, model, pars)