Skip to main content

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 .poni calibration 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epdfsuite-0.1.4.tar.gz (82.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

epdfsuite-0.1.4-py3-none-any.whl (86.9 kB view details)

Uploaded Python 3

File details

Details for the file epdfsuite-0.1.4.tar.gz.

File metadata

  • Download URL: epdfsuite-0.1.4.tar.gz
  • Upload date:
  • Size: 82.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for epdfsuite-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d9ab993649b2210199c2187880b2de84b959365dfe06e3d8f925242f327437e0
MD5 7f47f766a2064cf9bc48233e39b5ca35
BLAKE2b-256 3e493d24e9d36a1ce94b18d5f1c1d2a30f76d63de5d890b805020afe8f106d9b

See more details on using hashes here.

File details

Details for the file epdfsuite-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: epdfsuite-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 86.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for epdfsuite-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 af77fc2f2431939a6b8b52a024383e57eb1ad9a902a8083f78dbf4f67731cb94
MD5 ea70119530abe38f65512b17dc7cd70c
BLAKE2b-256 a621d81742522ca0991278f3386482c967588e24d5b4487c1523007118845135

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page