qzhu2017 / XRD

X-ray diffraction calculations
MIT License
7 stars 6 forks source link

VXRD: Profiling #33

Closed qzhu2017 closed 4 years ago

qzhu2017 commented 4 years ago

@sabaronett

So far, we have four options of profiling functions in the pxrd code.

At the moment, we have three options in vxrd:

Can you try to fix this and make it be consistent with our pard code.

sabaronett commented 4 years ago

OK. I'll try to take care of this today.

sabaronett commented 4 years ago

@qzhu2017, I've updated the profiling options and parameters in 21b8738747c9a2e2bbd3c094aeeef1e1ebef8d00. However, after reviewing pyxtal_xrd/profile.py I want to make sure we're on the same page with the parameters available to the user.

Pseudo-Voigt

Although the function prototype here https://github.com/qzhu2017/XRD/blob/a02536f2dcf74fd28074cc1bec539212eae1b480/pyxtal_xrd/profile.py#L50 shows the argument eta, when you call get_profile for the XRD object https://github.com/qzhu2017/XRD/blob/a02536f2dcf74fd28074cc1bec539212eae1b480/pyxtal_xrd/profile.py#L137-L150 eta is essentially calculated from fwhm and not passed from a kwarg. Thus in 21b8738747c9a2e2bbd3c094aeeef1e1ebef8d00, I display a FWHM field for this profile, but not eta.

Modified pseudo-Voigt

Although the function prototype https://github.com/qzhu2017/XRD/blob/a02536f2dcf74fd28074cc1bec539212eae1b480/pyxtal_xrd/profile.py#L5 shows the argument N, get_profile does this, https://github.com/qzhu2017/XRD/blob/a02536f2dcf74fd28074cc1bec539212eae1b480/pyxtal_xrd/profile.py#L124 and this, https://github.com/qzhu2017/XRD/blob/a02536f2dcf74fd28074cc1bec539212eae1b480/pyxtal_xrd/profile.py#L152-L162 i.e., N and fwhm are calculated from other parameters, and U, V, and W, are accepted as kwargs. Thus 21b8738747c9a2e2bbd3c094aeeef1e1ebef8d00 displays everything as before (when it was the only pseudo-Voigt option).

Let me know if my analysis makes sense, if I'm mistaken, or if you wish to change anything about how we want the profiling stuff to work. Thanks.

qzhu2017 commented 4 years ago

@sayred1 Can you double check what are the necessary input parameters for pseudo-Voigt profile function. I think eta is needed. But the current code seems to compute eta from fwhm. Can you show here which formula you used to compute pseudo-Voigt?

sayred1 commented 4 years ago

@qzhu2017

So according to https://onlinelibrary.wiley.com/doi/pdf/10.1107/S0021889887087090, eta can be determined to 1% when calculating it in that fashion as a function of the fwhm.

qzhu2017 commented 4 years ago

@sabaronett I think you are correct here.