ePDFsuite
ePDFsuite is a Python toolkit for extracting the electron Pair Distribution Function (ePDF) from Selected Area Electron Diffraction (SAED) images acquired in a transmission electron microscope (TEM).
It provides both a Python API for scripted workflows and an interactive graphical interface built with Streamlit.
See Documentation
What is ePDF?
The electron Pair Distribution Function (ePDF) is a real-space representation of atomic pair correlations, derived from the Fourier transform of the reduced structure factor $F(q)$ extracted from electron diffraction data. It is particularly useful for characterizing the local atomic structure of amorphous, nanocrystalline, and disordered materials.
$$G(r) = \frac{2}{\pi} \int_{q_{\min}}^{q_{\max}} F(q) \sin(qr), dq$$
Features
- Camera geometric calibration using a known crystalline standard (e.g. Au) via pyFAI
- MTF determination from a beamstop image using the slanted edge method
- MTF deconvolution of diffraction images (Wiener filter)
- Automatic beam center recalibration before each integration
- Azimuthal integration of 2D SAED patterns to 1D profiles
- ePDF extraction: background subtraction, scattering factor normalization using Lobato parameterization, and Fourier transform
- Interactive GUI (Streamlit) for interactive parameter tuning
- Support for DM4, DM3, TIFF input formats (via HyperSpy)
- Works with or without a
.ponicalibration file
Installation
Requirements: Python ≥ 3.8, conda recommended.
# Clone the repository
git clone https://github.com/nicoratel/ePDFsuite.git
cd ePDFsuite
# Create and activate a conda environment
conda create -n epdfsuite python=3.10
conda activate epdfsuite
# Install in editable mode
pip install -e .
Launching the GUI
Once installed, launch the interactive Streamlit application from anywhere:
conda activate epdfsuite
epdfsuite-app
The app opens at http://localhost:8501 in your browser.
See LAUNCH_APP.md for alternative launch methods.
Usage
See Documentation
Notebooks
| Notebook | Description |
|---|---|
camera_calibration.ipynb |
Geometric calibration with pyFAI + MTF measurement |
ePDF_Workflow.ipynb |
Complete ePDF extraction workflow (basic) |
MTF_determination.ipynb |
MTF computation from a beamstop image |
Project structure
ePDFsuite/
├── src/epdfsuite/
│ ├── ePDFsuite.py # SAEDProcessor class and extract_epdf function
│ ├── calibration.py # Geometric calibration from CIF
│ ├── recalibration.py # Automatic beam center refinement
│ ├── pdf_extraction.py # Structure factor and PDF computation
│ ├── lobato_scattering.py # Lobato electron scattering factors
│ ├── filereader.py # DM4/DM3/TIFF reader
│ ├── utilities.py # MTF tools, mask drawing
│ ├── camera_library.py # Known detector configurations
│ └── app_epdfsuite.py # Streamlit GUI
├── notebooks/ # Example Jupyter notebooks
├── pyproject.toml
├── LAUNCH_APP.md # GUI launch instructions
└── README.md
Dependencies
| Package | Role |
|---|---|
| pyFAI | Geometric calibration and azimuthal integration |
| HyperSpy | Reading DM4/DM3 files and pixel scale metadata |
| diffpy-CMI / numpy | PDF computation and signal processing |
| scikit-image | Image processing (MTF, beam center) |
| Streamlit | Interactive GUI |
| plotly | Interactive plots in the GUI |
| pymatgen | CIF reading for calibration |
License
MIT License — see LICENSE for details.
Author
Nicolas Ratel-Ramond
github.com/nicoratel/ePDFsuite
Metadata
Release files for ePDFsuite 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| epdfsuite-0.1.7.tar.gz | 86.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| epdfsuite-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 176.8 kB
Release files / epdfsuite-0.1.7.tar.gz
| Download URL | epdfsuite-0.1.7.tar.gz |
|---|---|
| Size | 86.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
163e45065f558bea5f8c0cd8f8a653018ffc2065e6e300313f3ebd183fb6437c
|
|
BLAKE2b-256 checksum How to use checksums |
e630a6e9fb6302717aabbf6f52438dc7d285a397614983cf876775d49e0afa56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / epdfsuite-0.1.7-py3-none-any.whl
| Download URL | epdfsuite-0.1.7-py3-none-any.whl |
|---|---|
| Size | 90.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45c2135848fc88d289af6a4099e427d5c320fe41b48173af88d37bd56054690b
|
|
BLAKE2b-256 checksum How to use checksums |
c8b152307ed7b3d56417da793173271f39f89f101c4380514502163c655490af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|