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.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| epdfsuite-0.1.9.tar.gz | 86.8 kB | Without provenance | Details for epdfsuite-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| epdfsuite-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for epdfsuite-0.1.9-py3-none-any.whl |
Total release size: 178.5 kB
Release files / epdfsuite-0.1.9.tar.gz
| Download URL | epdfsuite-0.1.9.tar.gz |
|---|---|
| Size | 86.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
668ba11baa3bc108f632f4bd23197d6f9aa04d01f1dff1da665d1e5abf6ea242
|
|
BLAKE2b-256 checksum How to use checksums |
476fed13ef176f8f2779635226761704abd2d09c226759a94131a5d66cc2a6ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Release files / epdfsuite-0.1.9-py3-none-any.whl
| Download URL | epdfsuite-0.1.9-py3-none-any.whl |
|---|---|
| Size | 91.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ae75ca1e4350b1ec48c9537cfb854c25497e92a46396c4c64acf311900753e9
|
|
BLAKE2b-256 checksum How to use checksums |
6f79a49c23cffd9fa34b1ef6c41b083cccacba08bf23e2321ccaac02f29852b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for ePDFsuite 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.