An app for preprocessing data from laboratory x-ray diffractometers before using PDFgetX3 to obtain PDFs
- Free software: 3-clause BSD license
- Documentation: (COMING SOON!) https://sbillinge.github.io/diffpy.labpdfproc.
PDFgetX3 has revolutionized how PDF methods can be applied to solve nanostructure problems. However, the program was designed for use with Rapid Acquisition PDF (RAPDF) data from synchrotron sources. A key approximation inherent in the use of PDFgetX3 for RAPDF data is that absorption effects are negligible. This is typically not the case for laboratory x-ray diffractometers, where absorption effects can be significant.
This app is designed to preprocess data from laboratory x-ray diffractometers before using PDFgetX3 to obtain PDFs. The app currently carries out an absorption correction assuming a parallel beam capillary geometry which is the most common geometry for lab PDF measurements.
The theory is described in the following paper:
An ad hoc Absorption Correction for Reliable Pair-Distribution Functions from Low Energy x-ray Sources Yucong Chen, Till Schertenleib, Andrew Yang, Pascal Schouwink, Wendy L. Queen and Simon J. L. Billinge, in preparation.
The related experimental data acquisition protocols are described in the following paper:
Protocols for Obtaining Reliable PDFs from Laboratory x-ray Sources Using PDFgetX3, Till Schertenleib, Daniel Schmuckler, Yucong Chen, Geng Bang Jin, Wendy L. Queen and Simon J. L. Billinge, in preparation.
The package is available on conda-forge and on pypi. Assuming you are using conda/mamba (we recommend using miniconda), create a virtual environment and install the package as follows:
mamba create -n labpdfproc python=3.12
mamba activate labpdfproc
cd path/to/diffpy.labpdfproc
mamba install -c conda-forge diffpy.labpdfproc
The code may also be installed from pipy using pip. This is not recommended as the package has not been tested on all platforms.
Navigate to the directory that contains 1D diffraction patterns that you would like to process. Activate the conda environment (conda activate labpdfproc) that contains the package and run the following command:
labpdfproc <muD> -i <path/to/inputfile.txt> --anode-type Mo
Here replace <muD> with the value of muD for your sample and <path/to/inputfile.txt> with the path and filename of your input file. For example, if the uncorrected data case isc alled zro2_mo.xy and is in the current directory and it has a muD of 2.5 then the commands would be
labpdfproc 2.5 -i zro2_mo.xy --anode-type Mo
Please type .. code-block:: python
labpdfproc --help
for more information on the available options.
An example input file can be found in the docs/examples directory in the distribtuion (you should find it in your miniconda envs locateion). The file is called zro2_mo.xy.
- Copy this file to a new scratch directory
- Navigate to that directory in a terminal
- Activate the conda environment that contains the package
- Run the command (see above)
An example output is also present in the example data and you can compare your output to this file. The example was processed with a muD of 2.5, though for experimentation you can try processing data with different muD values.