ePDFsuite 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- epdfsuite-0.1.4/PKG-INFO +166 -0
- epdfsuite-0.1.4/README.md +127 -0
- epdfsuite-0.1.4/pyproject.toml +60 -0
- epdfsuite-0.1.4/setup.cfg +4 -0
- epdfsuite-0.1.4/setup.py +2 -0
- epdfsuite-0.1.4/src/ePDFsuite.egg-info/PKG-INFO +166 -0
- epdfsuite-0.1.4/src/ePDFsuite.egg-info/SOURCES.txt +22 -0
- epdfsuite-0.1.4/src/ePDFsuite.egg-info/dependency_links.txt +1 -0
- epdfsuite-0.1.4/src/ePDFsuite.egg-info/entry_points.txt +2 -0
- epdfsuite-0.1.4/src/ePDFsuite.egg-info/requires.txt +16 -0
- epdfsuite-0.1.4/src/ePDFsuite.egg-info/top_level.txt +1 -0
- epdfsuite-0.1.4/src/epdfsuite/PDF_BatchAnalysis.py +2616 -0
- epdfsuite-0.1.4/src/epdfsuite/__init__.py +23 -0
- epdfsuite-0.1.4/src/epdfsuite/_launcher.py +9 -0
- epdfsuite-0.1.4/src/epdfsuite/app_epdfsuite.py +813 -0
- epdfsuite-0.1.4/src/epdfsuite/calibration.py +180 -0
- epdfsuite-0.1.4/src/epdfsuite/camera_library.py +153 -0
- epdfsuite-0.1.4/src/epdfsuite/ePDFsuite.py +1078 -0
- epdfsuite-0.1.4/src/epdfsuite/filereader.py +444 -0
- epdfsuite-0.1.4/src/epdfsuite/lobato_scattering.py +184 -0
- epdfsuite-0.1.4/src/epdfsuite/pdf_extraction.py +510 -0
- epdfsuite-0.1.4/src/epdfsuite/recalibration.py +352 -0
- epdfsuite-0.1.4/src/epdfsuite/snr.py +52 -0
- epdfsuite-0.1.4/src/epdfsuite/utilities.py +1415 -0
epdfsuite-0.1.4/PKG-INFO
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ePDFsuite
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Python toolkit for electron pair distribution function (ePDF) analysis from SAED data
|
|
5
|
+
Author: Nicolas Ratel-Ramond
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nicoratel/ePDFsuite
|
|
8
|
+
Project-URL: Documentation, https://epdfsuite.readthedocs.io
|
|
9
|
+
Project-URL: Repository, https://github.com/nicoratel/ePDFsuite
|
|
10
|
+
Project-URL: Issues, https://github.com/nicoratel/ePDFsuite/issues
|
|
11
|
+
Keywords: SAED,electron diffraction,PDF,RDF,distribution function,crystallography
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Intended Audience :: Science/Research
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: numpy<2.0.0,>=1.26.0
|
|
25
|
+
Requires-Dist: scipy<2.0.0,>=1.11.0
|
|
26
|
+
Requires-Dist: matplotlib<4.0.0,>=3.8.0
|
|
27
|
+
Requires-Dist: pymatgen>=2024.1.1
|
|
28
|
+
Requires-Dist: hyperspy<3.0.0,>=2.0.0
|
|
29
|
+
Requires-Dist: pyFAI>=2024.0.0
|
|
30
|
+
Requires-Dist: scikit-image<1.0.0,>=0.22.0
|
|
31
|
+
Requires-Dist: ipywidgets>=8.0.0
|
|
32
|
+
Requires-Dist: ipykernel>=6.0.0
|
|
33
|
+
Requires-Dist: plotly>=5.0.0
|
|
34
|
+
Requires-Dist: h5py>=3.0.0
|
|
35
|
+
Requires-Dist: tqdm>=4.60.0
|
|
36
|
+
Requires-Dist: streamlit>=1.30.0
|
|
37
|
+
Provides-Extra: pdfanalysis
|
|
38
|
+
Requires-Dist: pdfanalysis>=0.13.0; extra == "pdfanalysis"
|
|
39
|
+
|
|
40
|
+
# ePDFsuite
|
|
41
|
+
|
|
42
|
+
**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).
|
|
43
|
+
|
|
44
|
+
It provides both a Python API for scripted workflows and an interactive graphical interface built with Streamlit.
|
|
45
|
+
|
|
46
|
+
> See [Documentation](https://epdfsuite.readthedocs.io/en/latest/)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## What is ePDF?
|
|
51
|
+
|
|
52
|
+
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.
|
|
53
|
+
|
|
54
|
+
$$G(r) = \frac{2}{\pi} \int_{q_{\min}}^{q_{\max}} F(q) \sin(qr)\, dq$$
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
- **Camera geometric calibration** using a known crystalline standard (e.g. Au) via [pyFAI](https://pyfai.readthedocs.io/)
|
|
61
|
+
- **MTF determination** from a beamstop image using the slanted edge method
|
|
62
|
+
- **MTF deconvolution** of diffraction images (Wiener filter)
|
|
63
|
+
- **Automatic beam center recalibration** before each integration
|
|
64
|
+
- **Azimuthal integration** of 2D SAED patterns to 1D profiles
|
|
65
|
+
- **ePDF extraction**: background subtraction, scattering factor normalization using Lobato parameterization, and Fourier transform
|
|
66
|
+
- **Interactive GUI** (Streamlit) for interactive parameter tuning
|
|
67
|
+
- Support for **DM4, DM3, TIFF** input formats (via [HyperSpy](https://hyperspy.org/))
|
|
68
|
+
- Works with or without a `.poni` calibration file
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
|
|
74
|
+
**Requirements:** Python ≥ 3.8, conda recommended.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Clone the repository
|
|
78
|
+
git clone https://github.com/nicoratel/ePDFsuite.git
|
|
79
|
+
cd ePDFsuite
|
|
80
|
+
|
|
81
|
+
# Create and activate a conda environment
|
|
82
|
+
conda create -n epdfsuite python=3.10
|
|
83
|
+
conda activate epdfsuite
|
|
84
|
+
|
|
85
|
+
# Install in editable mode
|
|
86
|
+
pip install -e .
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Launching the GUI
|
|
92
|
+
|
|
93
|
+
Once installed, launch the interactive Streamlit application from anywhere:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
conda activate epdfsuite
|
|
97
|
+
epdfsuite-app
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The app opens at `http://localhost:8501` in your browser.
|
|
101
|
+
|
|
102
|
+
> See [LAUNCH_APP.md](LAUNCH_APP.md) for alternative launch methods.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Usage
|
|
107
|
+
|
|
108
|
+
> See [Documentation](https://epdfsuite.readthedocs.io/en/latest/)
|
|
109
|
+
|
|
110
|
+
## Notebooks
|
|
111
|
+
|
|
112
|
+
| Notebook | Description |
|
|
113
|
+
|---|---|
|
|
114
|
+
| [`camera_calibration.ipynb`](notebooks/camera_calibration.ipynb) | Geometric calibration with pyFAI + MTF measurement |
|
|
115
|
+
| [`ePDF_Workflow.ipynb`](notebooks/ePDF_Workflow.ipynb) | Complete ePDF extraction workflow (basic) |
|
|
116
|
+
| [`MTF_determination.ipynb`](notebooks/MTF_determination.ipynb) | MTF computation from a beamstop image |
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Project structure
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
ePDFsuite/
|
|
125
|
+
├── src/epdfsuite/
|
|
126
|
+
│ ├── ePDFsuite.py # SAEDProcessor class and extract_epdf function
|
|
127
|
+
│ ├── calibration.py # Geometric calibration from CIF
|
|
128
|
+
│ ├── recalibration.py # Automatic beam center refinement
|
|
129
|
+
│ ├── pdf_extraction.py # Structure factor and PDF computation
|
|
130
|
+
│ ├── lobato_scattering.py # Lobato electron scattering factors
|
|
131
|
+
│ ├── filereader.py # DM4/DM3/TIFF reader
|
|
132
|
+
│ ├── utilities.py # MTF tools, mask drawing
|
|
133
|
+
│ ├── camera_library.py # Known detector configurations
|
|
134
|
+
│ └── app_epdfsuite.py # Streamlit GUI
|
|
135
|
+
├── notebooks/ # Example Jupyter notebooks
|
|
136
|
+
├── pyproject.toml
|
|
137
|
+
├── LAUNCH_APP.md # GUI launch instructions
|
|
138
|
+
└── README.md
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Dependencies
|
|
144
|
+
|
|
145
|
+
| Package | Role |
|
|
146
|
+
|---|---|
|
|
147
|
+
| [pyFAI](https://pyfai.readthedocs.io/) | Geometric calibration and azimuthal integration |
|
|
148
|
+
| [HyperSpy](https://hyperspy.org/) | Reading DM4/DM3 files and pixel scale metadata |
|
|
149
|
+
| [diffpy-CMI / numpy](https://numpy.org/) | PDF computation and signal processing |
|
|
150
|
+
| [scikit-image](https://scikit-image.org/) | Image processing (MTF, beam center) |
|
|
151
|
+
| [Streamlit](https://streamlit.io/) | Interactive GUI |
|
|
152
|
+
| [plotly](https://plotly.com/python/) | Interactive plots in the GUI |
|
|
153
|
+
| [pymatgen](https://pymatgen.org/) | CIF reading for calibration |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Author
|
|
164
|
+
|
|
165
|
+
Nicolas Ratel-Ramond
|
|
166
|
+
[github.com/nicoratel/ePDFsuite](https://github.com/nicoratel/ePDFsuite)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# ePDFsuite
|
|
2
|
+
|
|
3
|
+
**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).
|
|
4
|
+
|
|
5
|
+
It provides both a Python API for scripted workflows and an interactive graphical interface built with Streamlit.
|
|
6
|
+
|
|
7
|
+
> See [Documentation](https://epdfsuite.readthedocs.io/en/latest/)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What is ePDF?
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
$$G(r) = \frac{2}{\pi} \int_{q_{\min}}^{q_{\max}} F(q) \sin(qr)\, dq$$
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- **Camera geometric calibration** using a known crystalline standard (e.g. Au) via [pyFAI](https://pyfai.readthedocs.io/)
|
|
22
|
+
- **MTF determination** from a beamstop image using the slanted edge method
|
|
23
|
+
- **MTF deconvolution** of diffraction images (Wiener filter)
|
|
24
|
+
- **Automatic beam center recalibration** before each integration
|
|
25
|
+
- **Azimuthal integration** of 2D SAED patterns to 1D profiles
|
|
26
|
+
- **ePDF extraction**: background subtraction, scattering factor normalization using Lobato parameterization, and Fourier transform
|
|
27
|
+
- **Interactive GUI** (Streamlit) for interactive parameter tuning
|
|
28
|
+
- Support for **DM4, DM3, TIFF** input formats (via [HyperSpy](https://hyperspy.org/))
|
|
29
|
+
- Works with or without a `.poni` calibration file
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
**Requirements:** Python ≥ 3.8, conda recommended.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Clone the repository
|
|
39
|
+
git clone https://github.com/nicoratel/ePDFsuite.git
|
|
40
|
+
cd ePDFsuite
|
|
41
|
+
|
|
42
|
+
# Create and activate a conda environment
|
|
43
|
+
conda create -n epdfsuite python=3.10
|
|
44
|
+
conda activate epdfsuite
|
|
45
|
+
|
|
46
|
+
# Install in editable mode
|
|
47
|
+
pip install -e .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Launching the GUI
|
|
53
|
+
|
|
54
|
+
Once installed, launch the interactive Streamlit application from anywhere:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
conda activate epdfsuite
|
|
58
|
+
epdfsuite-app
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The app opens at `http://localhost:8501` in your browser.
|
|
62
|
+
|
|
63
|
+
> See [LAUNCH_APP.md](LAUNCH_APP.md) for alternative launch methods.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
> See [Documentation](https://epdfsuite.readthedocs.io/en/latest/)
|
|
70
|
+
|
|
71
|
+
## Notebooks
|
|
72
|
+
|
|
73
|
+
| Notebook | Description |
|
|
74
|
+
|---|---|
|
|
75
|
+
| [`camera_calibration.ipynb`](notebooks/camera_calibration.ipynb) | Geometric calibration with pyFAI + MTF measurement |
|
|
76
|
+
| [`ePDF_Workflow.ipynb`](notebooks/ePDF_Workflow.ipynb) | Complete ePDF extraction workflow (basic) |
|
|
77
|
+
| [`MTF_determination.ipynb`](notebooks/MTF_determination.ipynb) | MTF computation from a beamstop image |
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Project structure
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
ePDFsuite/
|
|
86
|
+
├── src/epdfsuite/
|
|
87
|
+
│ ├── ePDFsuite.py # SAEDProcessor class and extract_epdf function
|
|
88
|
+
│ ├── calibration.py # Geometric calibration from CIF
|
|
89
|
+
│ ├── recalibration.py # Automatic beam center refinement
|
|
90
|
+
│ ├── pdf_extraction.py # Structure factor and PDF computation
|
|
91
|
+
│ ├── lobato_scattering.py # Lobato electron scattering factors
|
|
92
|
+
│ ├── filereader.py # DM4/DM3/TIFF reader
|
|
93
|
+
│ ├── utilities.py # MTF tools, mask drawing
|
|
94
|
+
│ ├── camera_library.py # Known detector configurations
|
|
95
|
+
│ └── app_epdfsuite.py # Streamlit GUI
|
|
96
|
+
├── notebooks/ # Example Jupyter notebooks
|
|
97
|
+
├── pyproject.toml
|
|
98
|
+
├── LAUNCH_APP.md # GUI launch instructions
|
|
99
|
+
└── README.md
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Dependencies
|
|
105
|
+
|
|
106
|
+
| Package | Role |
|
|
107
|
+
|---|---|
|
|
108
|
+
| [pyFAI](https://pyfai.readthedocs.io/) | Geometric calibration and azimuthal integration |
|
|
109
|
+
| [HyperSpy](https://hyperspy.org/) | Reading DM4/DM3 files and pixel scale metadata |
|
|
110
|
+
| [diffpy-CMI / numpy](https://numpy.org/) | PDF computation and signal processing |
|
|
111
|
+
| [scikit-image](https://scikit-image.org/) | Image processing (MTF, beam center) |
|
|
112
|
+
| [Streamlit](https://streamlit.io/) | Interactive GUI |
|
|
113
|
+
| [plotly](https://plotly.com/python/) | Interactive plots in the GUI |
|
|
114
|
+
| [pymatgen](https://pymatgen.org/) | CIF reading for calibration |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Author
|
|
125
|
+
|
|
126
|
+
Nicolas Ratel-Ramond
|
|
127
|
+
[github.com/nicoratel/ePDFsuite](https://github.com/nicoratel/ePDFsuite)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ePDFsuite"
|
|
7
|
+
version = "0.1.4"
|
|
8
|
+
description = "Python toolkit for electron pair distribution function (ePDF) analysis from SAED data"
|
|
9
|
+
authors = [{name = "Nicolas Ratel-Ramond"}]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
license = {text = "MIT"}
|
|
13
|
+
keywords = ["SAED", "electron diffraction", "PDF", "RDF", "distribution function", "crystallography"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.8",
|
|
17
|
+
"Programming Language :: Python :: 3.9",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"numpy>=1.26.0,<2.0.0",
|
|
28
|
+
"scipy>=1.11.0,<2.0.0",
|
|
29
|
+
"matplotlib>=3.8.0,<4.0.0",
|
|
30
|
+
#"diffpy-cmi>=3.1.0,<4.0.0",
|
|
31
|
+
#"ase>=3.22.0,<4.0.0",
|
|
32
|
+
"pymatgen>=2024.1.1",
|
|
33
|
+
#"abtem>=1.0.0,<2.0.0",
|
|
34
|
+
"hyperspy>=2.0.0,<3.0.0",
|
|
35
|
+
"pyFAI>=2024.0.0",
|
|
36
|
+
"scikit-image>=0.22.0,<1.0.0",
|
|
37
|
+
"ipywidgets>=8.0.0",
|
|
38
|
+
"ipykernel>=6.0.0",
|
|
39
|
+
"plotly>=5.0.0",
|
|
40
|
+
"h5py>=3.0.0",
|
|
41
|
+
"tqdm>=4.60.0",
|
|
42
|
+
"streamlit>=1.30.0",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[project.optional-dependencies]
|
|
46
|
+
pdfanalysis = [
|
|
47
|
+
"pdfanalysis>=0.13.0",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Homepage = "https://github.com/nicoratel/ePDFsuite"
|
|
52
|
+
Documentation = "https://epdfsuite.readthedocs.io"
|
|
53
|
+
Repository = "https://github.com/nicoratel/ePDFsuite"
|
|
54
|
+
Issues = "https://github.com/nicoratel/ePDFsuite/issues"
|
|
55
|
+
|
|
56
|
+
[project.scripts]
|
|
57
|
+
epdfsuite-app = "epdfsuite._launcher:main"
|
|
58
|
+
|
|
59
|
+
[tool.setuptools.packages.find]
|
|
60
|
+
where = ["src"]
|
epdfsuite-0.1.4/setup.py
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ePDFsuite
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Python toolkit for electron pair distribution function (ePDF) analysis from SAED data
|
|
5
|
+
Author: Nicolas Ratel-Ramond
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nicoratel/ePDFsuite
|
|
8
|
+
Project-URL: Documentation, https://epdfsuite.readthedocs.io
|
|
9
|
+
Project-URL: Repository, https://github.com/nicoratel/ePDFsuite
|
|
10
|
+
Project-URL: Issues, https://github.com/nicoratel/ePDFsuite/issues
|
|
11
|
+
Keywords: SAED,electron diffraction,PDF,RDF,distribution function,crystallography
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Intended Audience :: Science/Research
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: numpy<2.0.0,>=1.26.0
|
|
25
|
+
Requires-Dist: scipy<2.0.0,>=1.11.0
|
|
26
|
+
Requires-Dist: matplotlib<4.0.0,>=3.8.0
|
|
27
|
+
Requires-Dist: pymatgen>=2024.1.1
|
|
28
|
+
Requires-Dist: hyperspy<3.0.0,>=2.0.0
|
|
29
|
+
Requires-Dist: pyFAI>=2024.0.0
|
|
30
|
+
Requires-Dist: scikit-image<1.0.0,>=0.22.0
|
|
31
|
+
Requires-Dist: ipywidgets>=8.0.0
|
|
32
|
+
Requires-Dist: ipykernel>=6.0.0
|
|
33
|
+
Requires-Dist: plotly>=5.0.0
|
|
34
|
+
Requires-Dist: h5py>=3.0.0
|
|
35
|
+
Requires-Dist: tqdm>=4.60.0
|
|
36
|
+
Requires-Dist: streamlit>=1.30.0
|
|
37
|
+
Provides-Extra: pdfanalysis
|
|
38
|
+
Requires-Dist: pdfanalysis>=0.13.0; extra == "pdfanalysis"
|
|
39
|
+
|
|
40
|
+
# ePDFsuite
|
|
41
|
+
|
|
42
|
+
**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).
|
|
43
|
+
|
|
44
|
+
It provides both a Python API for scripted workflows and an interactive graphical interface built with Streamlit.
|
|
45
|
+
|
|
46
|
+
> See [Documentation](https://epdfsuite.readthedocs.io/en/latest/)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## What is ePDF?
|
|
51
|
+
|
|
52
|
+
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.
|
|
53
|
+
|
|
54
|
+
$$G(r) = \frac{2}{\pi} \int_{q_{\min}}^{q_{\max}} F(q) \sin(qr)\, dq$$
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
- **Camera geometric calibration** using a known crystalline standard (e.g. Au) via [pyFAI](https://pyfai.readthedocs.io/)
|
|
61
|
+
- **MTF determination** from a beamstop image using the slanted edge method
|
|
62
|
+
- **MTF deconvolution** of diffraction images (Wiener filter)
|
|
63
|
+
- **Automatic beam center recalibration** before each integration
|
|
64
|
+
- **Azimuthal integration** of 2D SAED patterns to 1D profiles
|
|
65
|
+
- **ePDF extraction**: background subtraction, scattering factor normalization using Lobato parameterization, and Fourier transform
|
|
66
|
+
- **Interactive GUI** (Streamlit) for interactive parameter tuning
|
|
67
|
+
- Support for **DM4, DM3, TIFF** input formats (via [HyperSpy](https://hyperspy.org/))
|
|
68
|
+
- Works with or without a `.poni` calibration file
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
|
|
74
|
+
**Requirements:** Python ≥ 3.8, conda recommended.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Clone the repository
|
|
78
|
+
git clone https://github.com/nicoratel/ePDFsuite.git
|
|
79
|
+
cd ePDFsuite
|
|
80
|
+
|
|
81
|
+
# Create and activate a conda environment
|
|
82
|
+
conda create -n epdfsuite python=3.10
|
|
83
|
+
conda activate epdfsuite
|
|
84
|
+
|
|
85
|
+
# Install in editable mode
|
|
86
|
+
pip install -e .
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Launching the GUI
|
|
92
|
+
|
|
93
|
+
Once installed, launch the interactive Streamlit application from anywhere:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
conda activate epdfsuite
|
|
97
|
+
epdfsuite-app
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The app opens at `http://localhost:8501` in your browser.
|
|
101
|
+
|
|
102
|
+
> See [LAUNCH_APP.md](LAUNCH_APP.md) for alternative launch methods.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Usage
|
|
107
|
+
|
|
108
|
+
> See [Documentation](https://epdfsuite.readthedocs.io/en/latest/)
|
|
109
|
+
|
|
110
|
+
## Notebooks
|
|
111
|
+
|
|
112
|
+
| Notebook | Description |
|
|
113
|
+
|---|---|
|
|
114
|
+
| [`camera_calibration.ipynb`](notebooks/camera_calibration.ipynb) | Geometric calibration with pyFAI + MTF measurement |
|
|
115
|
+
| [`ePDF_Workflow.ipynb`](notebooks/ePDF_Workflow.ipynb) | Complete ePDF extraction workflow (basic) |
|
|
116
|
+
| [`MTF_determination.ipynb`](notebooks/MTF_determination.ipynb) | MTF computation from a beamstop image |
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Project structure
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
ePDFsuite/
|
|
125
|
+
├── src/epdfsuite/
|
|
126
|
+
│ ├── ePDFsuite.py # SAEDProcessor class and extract_epdf function
|
|
127
|
+
│ ├── calibration.py # Geometric calibration from CIF
|
|
128
|
+
│ ├── recalibration.py # Automatic beam center refinement
|
|
129
|
+
│ ├── pdf_extraction.py # Structure factor and PDF computation
|
|
130
|
+
│ ├── lobato_scattering.py # Lobato electron scattering factors
|
|
131
|
+
│ ├── filereader.py # DM4/DM3/TIFF reader
|
|
132
|
+
│ ├── utilities.py # MTF tools, mask drawing
|
|
133
|
+
│ ├── camera_library.py # Known detector configurations
|
|
134
|
+
│ └── app_epdfsuite.py # Streamlit GUI
|
|
135
|
+
├── notebooks/ # Example Jupyter notebooks
|
|
136
|
+
├── pyproject.toml
|
|
137
|
+
├── LAUNCH_APP.md # GUI launch instructions
|
|
138
|
+
└── README.md
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Dependencies
|
|
144
|
+
|
|
145
|
+
| Package | Role |
|
|
146
|
+
|---|---|
|
|
147
|
+
| [pyFAI](https://pyfai.readthedocs.io/) | Geometric calibration and azimuthal integration |
|
|
148
|
+
| [HyperSpy](https://hyperspy.org/) | Reading DM4/DM3 files and pixel scale metadata |
|
|
149
|
+
| [diffpy-CMI / numpy](https://numpy.org/) | PDF computation and signal processing |
|
|
150
|
+
| [scikit-image](https://scikit-image.org/) | Image processing (MTF, beam center) |
|
|
151
|
+
| [Streamlit](https://streamlit.io/) | Interactive GUI |
|
|
152
|
+
| [plotly](https://plotly.com/python/) | Interactive plots in the GUI |
|
|
153
|
+
| [pymatgen](https://pymatgen.org/) | CIF reading for calibration |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Author
|
|
164
|
+
|
|
165
|
+
Nicolas Ratel-Ramond
|
|
166
|
+
[github.com/nicoratel/ePDFsuite](https://github.com/nicoratel/ePDFsuite)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
setup.py
|
|
4
|
+
src/ePDFsuite.egg-info/PKG-INFO
|
|
5
|
+
src/ePDFsuite.egg-info/SOURCES.txt
|
|
6
|
+
src/ePDFsuite.egg-info/dependency_links.txt
|
|
7
|
+
src/ePDFsuite.egg-info/entry_points.txt
|
|
8
|
+
src/ePDFsuite.egg-info/requires.txt
|
|
9
|
+
src/ePDFsuite.egg-info/top_level.txt
|
|
10
|
+
src/epdfsuite/PDF_BatchAnalysis.py
|
|
11
|
+
src/epdfsuite/__init__.py
|
|
12
|
+
src/epdfsuite/_launcher.py
|
|
13
|
+
src/epdfsuite/app_epdfsuite.py
|
|
14
|
+
src/epdfsuite/calibration.py
|
|
15
|
+
src/epdfsuite/camera_library.py
|
|
16
|
+
src/epdfsuite/ePDFsuite.py
|
|
17
|
+
src/epdfsuite/filereader.py
|
|
18
|
+
src/epdfsuite/lobato_scattering.py
|
|
19
|
+
src/epdfsuite/pdf_extraction.py
|
|
20
|
+
src/epdfsuite/recalibration.py
|
|
21
|
+
src/epdfsuite/snr.py
|
|
22
|
+
src/epdfsuite/utilities.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
numpy<2.0.0,>=1.26.0
|
|
2
|
+
scipy<2.0.0,>=1.11.0
|
|
3
|
+
matplotlib<4.0.0,>=3.8.0
|
|
4
|
+
pymatgen>=2024.1.1
|
|
5
|
+
hyperspy<3.0.0,>=2.0.0
|
|
6
|
+
pyFAI>=2024.0.0
|
|
7
|
+
scikit-image<1.0.0,>=0.22.0
|
|
8
|
+
ipywidgets>=8.0.0
|
|
9
|
+
ipykernel>=6.0.0
|
|
10
|
+
plotly>=5.0.0
|
|
11
|
+
h5py>=3.0.0
|
|
12
|
+
tqdm>=4.60.0
|
|
13
|
+
streamlit>=1.30.0
|
|
14
|
+
|
|
15
|
+
[pdfanalysis]
|
|
16
|
+
pdfanalysis>=0.13.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
epdfsuite
|