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

Metadata

Release files for ePDFsuite 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ePDFsuite 0.1.5
File Size Uploaded
epdfsuite-0.1.5.tar.gz 83.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ePDFsuite 0.1.5
File Interpreter ABI Platform
epdfsuite-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 171.2 kB

Release files / epdfsuite-0.1.5.tar.gz

Download URL epdfsuite-0.1.5.tar.gz
Size 83.2 kB
Tags Source
SHA-256 checksum
How to use checksums
406c2178c764c6e750e29faa327c63593a144c20dea93c64f52befa1898684c7
BLAKE2b-256 checksum
How to use checksums
02cfe2f3fe9fecc629c74af1f51bfe23431a5923c178f0340baabefeef04384f
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.5-py3-none-any.whl

Download URL epdfsuite-0.1.5-py3-none-any.whl
Size 88.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3985109af7cfe3d1eaf91a547d3347b6ab92bd8314684289a6a79f7e7eddbd9d
BLAKE2b-256 checksum
How to use checksums
0b54bede11754ac7760dccca54360a265cab111cde018a170ad877554154e319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

0.1.7

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release 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