trxrdpy 1.0.0__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.
- trxrdpy-1.0.0/PKG-INFO +332 -0
- trxrdpy-1.0.0/README.md +290 -0
- trxrdpy-1.0.0/pyproject.toml +80 -0
- trxrdpy-1.0.0/setup.cfg +4 -0
- trxrdpy-1.0.0/src/trxrdpy/__init__.py +19 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/ESRF_ID09/__init__.py +12 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/ESRF_ID09/azimint.py +1223 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/MaxIV_FemtoMAX/__init__.py +24 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/MaxIV_FemtoMAX/azimint.py +217 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/MaxIV_FemtoMAX/datared.py +604 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/MaxIV_FemtoMAX/datared_utils.py +1668 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/Spring8_SACLA/__init__.py +37 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/Spring8_SACLA/azimint.py +49 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/Spring8_SACLA/datared.py +2644 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/Spring8_SACLA/pbs/parallel_job_sender.sh +41 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/__init__.py +28 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/_shared_2d/__init__.py +28 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/_shared_2d/azimint.py +712 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/common/__init__.py +24 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/common/azimint_utils.py +834 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/common/differential_analysis_utils.py +1537 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/common/fitting_utils.py +1741 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/common/general_utils.py +901 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/common/paths.py +44 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/common/plot_utils.py +5148 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/differential_analysis.py +1006 -0
- trxrdpy-1.0.0/src/trxrdpy/analysis/fitting.py +2170 -0
- trxrdpy-1.0.0/src/trxrdpy/cif.py +203 -0
- trxrdpy-1.0.0/src/trxrdpy/detector.py +174 -0
- trxrdpy-1.0.0/src/trxrdpy/experiment.py +1119 -0
- trxrdpy-1.0.0/src/trxrdpy/plot.py +1404 -0
- trxrdpy-1.0.0/src/trxrdpy/sample.py +922 -0
- trxrdpy-1.0.0/src/trxrdpy/simulation/__init__.py +3 -0
- trxrdpy-1.0.0/src/trxrdpy/simulation/gui.py +1539 -0
- trxrdpy-1.0.0/src/trxrdpy/simulation/polycrystalline.py +403 -0
- trxrdpy-1.0.0/src/trxrdpy/simulation/single_crystal.py +419 -0
- trxrdpy-1.0.0/src/trxrdpy/utils.py +132 -0
- trxrdpy-1.0.0/src/trxrdpy.egg-info/PKG-INFO +332 -0
- trxrdpy-1.0.0/src/trxrdpy.egg-info/SOURCES.txt +40 -0
- trxrdpy-1.0.0/src/trxrdpy.egg-info/dependency_links.txt +1 -0
- trxrdpy-1.0.0/src/trxrdpy.egg-info/requires.txt +21 -0
- trxrdpy-1.0.0/src/trxrdpy.egg-info/top_level.txt +1 -0
trxrdpy-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: trxrdpy
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python toolkit for time-resolved X-ray diffraction simulation and beamline-dependent analysis workflows.
|
|
5
|
+
Author: Julio Guzman-Brambila
|
|
6
|
+
License-Expression: CC-BY-4.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/julioguzmanb/XRDpy
|
|
8
|
+
Project-URL: Repository, https://github.com/julioguzmanb/XRDpy
|
|
9
|
+
Project-URL: Documentation, https://github.com/julioguzmanb/XRDpy
|
|
10
|
+
Project-URL: DOI, https://doi.org/10.5281/zenodo.18634909
|
|
11
|
+
Project-URL: Issues, https://github.com/julioguzmanb/XRDpy/issues
|
|
12
|
+
Keywords: xrd,time-resolved xrd,pump-probe,x-ray diffraction,diffraction,materials science,simulation,beamline analysis,pyFAI
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: numpy>=1.24
|
|
25
|
+
Requires-Dist: scipy>=1.10
|
|
26
|
+
Requires-Dist: matplotlib>=3.7
|
|
27
|
+
Requires-Dist: pandas>=2.0
|
|
28
|
+
Requires-Dist: h5py>=3.9
|
|
29
|
+
Requires-Dist: tqdm>=4.66
|
|
30
|
+
Requires-Dist: lmfit>=1.2
|
|
31
|
+
Requires-Dist: pyFAI>=2024.1
|
|
32
|
+
Requires-Dist: fabio>=2024.4
|
|
33
|
+
Requires-Dist: PyCifRW>=5.0
|
|
34
|
+
Requires-Dist: xrayutilities>=1.7
|
|
35
|
+
Provides-Extra: analysis
|
|
36
|
+
Requires-Dist: pytxs==0.0.2; extra == "analysis"
|
|
37
|
+
Provides-Extra: gui
|
|
38
|
+
Requires-Dist: PyQt5>=5.15; extra == "gui"
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
41
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
42
|
+
|
|
43
|
+
# XRDpy
|
|
44
|
+
|
|
45
|
+
**XRDpy** is a Python toolkit for **X-ray diffraction (XRD)** simulation and analysis, with a particular focus on **time-resolved / pump–probe diffraction workflows**.
|
|
46
|
+
|
|
47
|
+
The project name on **GitHub** and **Zenodo** is **XRDpy**.
|
|
48
|
+
The package is distributed on **PyPI** as **`trxrdpy`** and should be imported in Python as **`trxrdpy`**.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Repository
|
|
53
|
+
|
|
54
|
+
Source code: https://github.com/julioguzmanb/XRDpy
|
|
55
|
+
|
|
56
|
+
## DOI (Zenodo)
|
|
57
|
+
|
|
58
|
+
- **Project concept DOI (all versions):** https://doi.org/10.5281/zenodo.18634909
|
|
59
|
+
- **Current release DOI (v1.0.0):** https://doi.org/10.5281/zenodo.18925472
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Main capabilities
|
|
64
|
+
|
|
65
|
+
### Simulation
|
|
66
|
+
|
|
67
|
+
- Polycrystalline XRD simulation
|
|
68
|
+
- Single-crystal diffraction simulation
|
|
69
|
+
- CIF-based crystallographic helpers
|
|
70
|
+
- Plotting utilities for simulated diffraction data
|
|
71
|
+
- A GUI for simulation workflows
|
|
72
|
+
|
|
73
|
+
### Analysis
|
|
74
|
+
|
|
75
|
+
- Beamline/facility-specific data handling
|
|
76
|
+
- 2D image reduction and azimuthal integration
|
|
77
|
+
- Standardized generation of 1D `xy` diffraction patterns
|
|
78
|
+
- Peak fitting workflows
|
|
79
|
+
- Differential analysis workflows
|
|
80
|
+
- Shared utilities for plotting, path handling, and common analysis operations
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Package structure
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
XRDpy/
|
|
88
|
+
├── pyproject.toml
|
|
89
|
+
├── README.md
|
|
90
|
+
├── LICENSE
|
|
91
|
+
└── src/
|
|
92
|
+
└── trxrdpy/
|
|
93
|
+
├── __init__.py
|
|
94
|
+
├── utils.py
|
|
95
|
+
├── detector.py
|
|
96
|
+
├── experiment.py
|
|
97
|
+
├── plot.py
|
|
98
|
+
├── sample.py
|
|
99
|
+
├── cif.py
|
|
100
|
+
├── simulation/
|
|
101
|
+
│ ├── __init__.py
|
|
102
|
+
│ ├── polycrystalline.py
|
|
103
|
+
│ ├── single_crystal.py
|
|
104
|
+
└── analysis/
|
|
105
|
+
├── common/
|
|
106
|
+
│ ├── __init__.py
|
|
107
|
+
│ ├── paths.py
|
|
108
|
+
│ ├── plot_utils.py
|
|
109
|
+
│ ├── general_utils.py
|
|
110
|
+
│ ├── azimint_utils.py
|
|
111
|
+
│ ├── differential_analysis_utils.py
|
|
112
|
+
│ └── fitting_utils.py
|
|
113
|
+
├── _shared_2d/
|
|
114
|
+
│ ├── __init__.py
|
|
115
|
+
│ └── azimint.py
|
|
116
|
+
├── ESRF_ID09/
|
|
117
|
+
│ ├── __init__.py
|
|
118
|
+
│ └── azimint.py
|
|
119
|
+
├── MaxIV_FemtoMAX/
|
|
120
|
+
│ ├── __init__.py
|
|
121
|
+
│ ├── datared_utils.py
|
|
122
|
+
│ ├── datared.py
|
|
123
|
+
│ └── azimint.py
|
|
124
|
+
├── Spring8_SACLA/
|
|
125
|
+
│ ├── __init__.py
|
|
126
|
+
│ ├── datared.py
|
|
127
|
+
│ ├── azimint.py
|
|
128
|
+
│ └── pbs/
|
|
129
|
+
│ └── parallel_job_sender.sh
|
|
130
|
+
├── differential_analysis.py
|
|
131
|
+
└── fitting.py
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Installation
|
|
137
|
+
|
|
138
|
+
### From PyPI
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
pip install trxrdpy
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Optional extras:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
pip install "trxrdpy[analysis]"
|
|
148
|
+
pip install "trxrdpy[gui]"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### From source
|
|
152
|
+
|
|
153
|
+
Clone the repository and install in editable mode:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
git clone https://github.com/julioguzmanb/XRDpy.git
|
|
157
|
+
cd XRDpy
|
|
158
|
+
pip install -e .
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Import
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
import trxrdpy
|
|
167
|
+
from trxrdpy import simulation
|
|
168
|
+
from trxrdpy import analysis
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
More specific imports:
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
from trxrdpy.analysis import fitting
|
|
175
|
+
from trxrdpy.analysis import differential_analysis
|
|
176
|
+
from trxrdpy.analysis.MaxIV_FemtoMAX import azimint
|
|
177
|
+
from trxrdpy.analysis.Spring8_SACLA import datared
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The package currently exposes the following top-level modules through `trxrdpy.__init__`:
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
from . import utils
|
|
184
|
+
from . import experiment
|
|
185
|
+
from . import plot
|
|
186
|
+
from . import sample
|
|
187
|
+
from . import cif
|
|
188
|
+
from . import simulation
|
|
189
|
+
from . import analysis
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Analysis organization
|
|
195
|
+
|
|
196
|
+
The `analysis` section is organized into shared utilities, facility-specific workflows, and user-facing APIs.
|
|
197
|
+
|
|
198
|
+
### `analysis.common`
|
|
199
|
+
|
|
200
|
+
Facility-independent shared utilities:
|
|
201
|
+
|
|
202
|
+
- path handling
|
|
203
|
+
- plotting helpers
|
|
204
|
+
- general helper functions
|
|
205
|
+
- common azimuthal-integration helpers
|
|
206
|
+
- fitting utilities
|
|
207
|
+
- differential-analysis utilities
|
|
208
|
+
|
|
209
|
+
### `analysis._shared_2d`
|
|
210
|
+
|
|
211
|
+
Shared 2D-image-based azimuthal-integration workflow.
|
|
212
|
+
|
|
213
|
+
This layer is currently used by:
|
|
214
|
+
|
|
215
|
+
- **Max IV FemtoMAX**
|
|
216
|
+
- **SPring-8 SACLA**
|
|
217
|
+
|
|
218
|
+
### `analysis.ESRF_ID09`
|
|
219
|
+
|
|
220
|
+
ID09-specific azimuthal-integration workflow.
|
|
221
|
+
|
|
222
|
+
At ESRF ID09, the route to generate `xy` files differs from the homogenized 2D-image workflow used elsewhere. The beamline-provided tools and data structure are handled through a dedicated facility-specific implementation.
|
|
223
|
+
|
|
224
|
+
### `analysis.MaxIV_FemtoMAX`
|
|
225
|
+
|
|
226
|
+
FemtoMAX-specific analysis entry points.
|
|
227
|
+
|
|
228
|
+
This section contains:
|
|
229
|
+
|
|
230
|
+
- beamline-specific data reduction
|
|
231
|
+
- azimuthal-integration entry points
|
|
232
|
+
- wrappers that preserve the facility-facing public API
|
|
233
|
+
|
|
234
|
+
### `analysis.Spring8_SACLA`
|
|
235
|
+
|
|
236
|
+
SACLA-specific analysis entry points.
|
|
237
|
+
|
|
238
|
+
This section contains:
|
|
239
|
+
|
|
240
|
+
- beamline-specific data reduction
|
|
241
|
+
- azimuthal-integration entry points
|
|
242
|
+
- PBS job-submission helper scripts for HPC workflows
|
|
243
|
+
|
|
244
|
+
### User-facing analysis APIs
|
|
245
|
+
|
|
246
|
+
These modules provide the user-facing analysis layer after `xy` files are available:
|
|
247
|
+
|
|
248
|
+
- `analysis.fitting`
|
|
249
|
+
- `analysis.differential_analysis`
|
|
250
|
+
|
|
251
|
+
Once `xy` files are created, the downstream fitting and differential-analysis pipeline is shared across facilities.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Facility-specific workflow overview
|
|
256
|
+
|
|
257
|
+
The analysis pipeline is intentionally split because raw-data handling differs across facilities.
|
|
258
|
+
|
|
259
|
+
### Max IV FemtoMAX
|
|
260
|
+
|
|
261
|
+
- Uses facility-specific data reduction
|
|
262
|
+
- Produces homogenized 2D images
|
|
263
|
+
- Reuses the shared 2D azimuthal-integration workflow
|
|
264
|
+
- Then uses the shared downstream analysis pipeline
|
|
265
|
+
|
|
266
|
+
### SPring-8 SACLA
|
|
267
|
+
|
|
268
|
+
- Uses facility-specific data reduction
|
|
269
|
+
- Some reduction steps may depend on beamline-specific software, legacy Python environments, VPN access, or HPC job submission
|
|
270
|
+
- Produces homogenized 2D images
|
|
271
|
+
- Reuses the shared 2D azimuthal-integration workflow
|
|
272
|
+
- Then uses the shared downstream analysis pipeline
|
|
273
|
+
|
|
274
|
+
### ESRF ID09
|
|
275
|
+
|
|
276
|
+
- Does not use the same 2D homogenization route as FemtoMAX/SACLA
|
|
277
|
+
- Uses a different beamline-specific azimuthal-integration workflow to generate `xy` files
|
|
278
|
+
- Then uses the same downstream fitting and differential-analysis pipeline
|
|
279
|
+
|
|
280
|
+
In other words:
|
|
281
|
+
|
|
282
|
+
- **data reduction differs across facilities**
|
|
283
|
+
- **`xy` generation differs for ID09 vs the shared 2D workflow**
|
|
284
|
+
- **the downstream analysis after `xy` creation is shared**
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Notes
|
|
289
|
+
|
|
290
|
+
- Some analysis workflows may require facility-specific dependencies that are not part of a standard Python installation.
|
|
291
|
+
- Some SACLA workflows may rely on legacy Python environments and external HPC job submission.
|
|
292
|
+
- The simulation and analysis sections are developed within the same package but target different use cases.
|
|
293
|
+
- The project is published on PyPI as `trxrdpy` because the `xrdpy` name is already taken on PyPI.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Citation
|
|
298
|
+
|
|
299
|
+
If you use **XRDpy** in academic work, please cite the specific Zenodo release you used.
|
|
300
|
+
|
|
301
|
+
For the current public release:
|
|
302
|
+
|
|
303
|
+
**Julio Guzman-Brambila. XRDpy (v1.0.0). Zenodo. https://doi.org/10.5281/zenodo.18925472**
|
|
304
|
+
|
|
305
|
+
Project concept DOI (all versions):
|
|
306
|
+
|
|
307
|
+
**https://doi.org/10.5281/zenodo.18634909**
|
|
308
|
+
|
|
309
|
+
### BibTeX
|
|
310
|
+
|
|
311
|
+
```bibtex
|
|
312
|
+
@software{guzman_brambila_xrdpy_v100,
|
|
313
|
+
author = {Guzman-Brambila, Julio},
|
|
314
|
+
title = {XRDpy},
|
|
315
|
+
version = {1.0.0},
|
|
316
|
+
publisher = {Zenodo},
|
|
317
|
+
doi = {10.5281/zenodo.18925472},
|
|
318
|
+
url = {https://doi.org/10.5281/zenodo.18925472}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## License
|
|
325
|
+
|
|
326
|
+
Creative Commons Attribution 4.0 International (CC BY 4.0). See `LICENSE` for details.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## Author
|
|
331
|
+
|
|
332
|
+
**Julio Guzman-Brambila**
|
trxrdpy-1.0.0/README.md
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# XRDpy
|
|
2
|
+
|
|
3
|
+
**XRDpy** is a Python toolkit for **X-ray diffraction (XRD)** simulation and analysis, with a particular focus on **time-resolved / pump–probe diffraction workflows**.
|
|
4
|
+
|
|
5
|
+
The project name on **GitHub** and **Zenodo** is **XRDpy**.
|
|
6
|
+
The package is distributed on **PyPI** as **`trxrdpy`** and should be imported in Python as **`trxrdpy`**.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Repository
|
|
11
|
+
|
|
12
|
+
Source code: https://github.com/julioguzmanb/XRDpy
|
|
13
|
+
|
|
14
|
+
## DOI (Zenodo)
|
|
15
|
+
|
|
16
|
+
- **Project concept DOI (all versions):** https://doi.org/10.5281/zenodo.18634909
|
|
17
|
+
- **Current release DOI (v1.0.0):** https://doi.org/10.5281/zenodo.18925472
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Main capabilities
|
|
22
|
+
|
|
23
|
+
### Simulation
|
|
24
|
+
|
|
25
|
+
- Polycrystalline XRD simulation
|
|
26
|
+
- Single-crystal diffraction simulation
|
|
27
|
+
- CIF-based crystallographic helpers
|
|
28
|
+
- Plotting utilities for simulated diffraction data
|
|
29
|
+
- A GUI for simulation workflows
|
|
30
|
+
|
|
31
|
+
### Analysis
|
|
32
|
+
|
|
33
|
+
- Beamline/facility-specific data handling
|
|
34
|
+
- 2D image reduction and azimuthal integration
|
|
35
|
+
- Standardized generation of 1D `xy` diffraction patterns
|
|
36
|
+
- Peak fitting workflows
|
|
37
|
+
- Differential analysis workflows
|
|
38
|
+
- Shared utilities for plotting, path handling, and common analysis operations
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Package structure
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
XRDpy/
|
|
46
|
+
├── pyproject.toml
|
|
47
|
+
├── README.md
|
|
48
|
+
├── LICENSE
|
|
49
|
+
└── src/
|
|
50
|
+
└── trxrdpy/
|
|
51
|
+
├── __init__.py
|
|
52
|
+
├── utils.py
|
|
53
|
+
├── detector.py
|
|
54
|
+
├── experiment.py
|
|
55
|
+
├── plot.py
|
|
56
|
+
├── sample.py
|
|
57
|
+
├── cif.py
|
|
58
|
+
├── simulation/
|
|
59
|
+
│ ├── __init__.py
|
|
60
|
+
│ ├── polycrystalline.py
|
|
61
|
+
│ ├── single_crystal.py
|
|
62
|
+
└── analysis/
|
|
63
|
+
├── common/
|
|
64
|
+
│ ├── __init__.py
|
|
65
|
+
│ ├── paths.py
|
|
66
|
+
│ ├── plot_utils.py
|
|
67
|
+
│ ├── general_utils.py
|
|
68
|
+
│ ├── azimint_utils.py
|
|
69
|
+
│ ├── differential_analysis_utils.py
|
|
70
|
+
│ └── fitting_utils.py
|
|
71
|
+
├── _shared_2d/
|
|
72
|
+
│ ├── __init__.py
|
|
73
|
+
│ └── azimint.py
|
|
74
|
+
├── ESRF_ID09/
|
|
75
|
+
│ ├── __init__.py
|
|
76
|
+
│ └── azimint.py
|
|
77
|
+
├── MaxIV_FemtoMAX/
|
|
78
|
+
│ ├── __init__.py
|
|
79
|
+
│ ├── datared_utils.py
|
|
80
|
+
│ ├── datared.py
|
|
81
|
+
│ └── azimint.py
|
|
82
|
+
├── Spring8_SACLA/
|
|
83
|
+
│ ├── __init__.py
|
|
84
|
+
│ ├── datared.py
|
|
85
|
+
│ ├── azimint.py
|
|
86
|
+
│ └── pbs/
|
|
87
|
+
│ └── parallel_job_sender.sh
|
|
88
|
+
├── differential_analysis.py
|
|
89
|
+
└── fitting.py
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Installation
|
|
95
|
+
|
|
96
|
+
### From PyPI
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install trxrdpy
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Optional extras:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install "trxrdpy[analysis]"
|
|
106
|
+
pip install "trxrdpy[gui]"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### From source
|
|
110
|
+
|
|
111
|
+
Clone the repository and install in editable mode:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
git clone https://github.com/julioguzmanb/XRDpy.git
|
|
115
|
+
cd XRDpy
|
|
116
|
+
pip install -e .
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Import
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
import trxrdpy
|
|
125
|
+
from trxrdpy import simulation
|
|
126
|
+
from trxrdpy import analysis
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
More specific imports:
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from trxrdpy.analysis import fitting
|
|
133
|
+
from trxrdpy.analysis import differential_analysis
|
|
134
|
+
from trxrdpy.analysis.MaxIV_FemtoMAX import azimint
|
|
135
|
+
from trxrdpy.analysis.Spring8_SACLA import datared
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The package currently exposes the following top-level modules through `trxrdpy.__init__`:
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
from . import utils
|
|
142
|
+
from . import experiment
|
|
143
|
+
from . import plot
|
|
144
|
+
from . import sample
|
|
145
|
+
from . import cif
|
|
146
|
+
from . import simulation
|
|
147
|
+
from . import analysis
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Analysis organization
|
|
153
|
+
|
|
154
|
+
The `analysis` section is organized into shared utilities, facility-specific workflows, and user-facing APIs.
|
|
155
|
+
|
|
156
|
+
### `analysis.common`
|
|
157
|
+
|
|
158
|
+
Facility-independent shared utilities:
|
|
159
|
+
|
|
160
|
+
- path handling
|
|
161
|
+
- plotting helpers
|
|
162
|
+
- general helper functions
|
|
163
|
+
- common azimuthal-integration helpers
|
|
164
|
+
- fitting utilities
|
|
165
|
+
- differential-analysis utilities
|
|
166
|
+
|
|
167
|
+
### `analysis._shared_2d`
|
|
168
|
+
|
|
169
|
+
Shared 2D-image-based azimuthal-integration workflow.
|
|
170
|
+
|
|
171
|
+
This layer is currently used by:
|
|
172
|
+
|
|
173
|
+
- **Max IV FemtoMAX**
|
|
174
|
+
- **SPring-8 SACLA**
|
|
175
|
+
|
|
176
|
+
### `analysis.ESRF_ID09`
|
|
177
|
+
|
|
178
|
+
ID09-specific azimuthal-integration workflow.
|
|
179
|
+
|
|
180
|
+
At ESRF ID09, the route to generate `xy` files differs from the homogenized 2D-image workflow used elsewhere. The beamline-provided tools and data structure are handled through a dedicated facility-specific implementation.
|
|
181
|
+
|
|
182
|
+
### `analysis.MaxIV_FemtoMAX`
|
|
183
|
+
|
|
184
|
+
FemtoMAX-specific analysis entry points.
|
|
185
|
+
|
|
186
|
+
This section contains:
|
|
187
|
+
|
|
188
|
+
- beamline-specific data reduction
|
|
189
|
+
- azimuthal-integration entry points
|
|
190
|
+
- wrappers that preserve the facility-facing public API
|
|
191
|
+
|
|
192
|
+
### `analysis.Spring8_SACLA`
|
|
193
|
+
|
|
194
|
+
SACLA-specific analysis entry points.
|
|
195
|
+
|
|
196
|
+
This section contains:
|
|
197
|
+
|
|
198
|
+
- beamline-specific data reduction
|
|
199
|
+
- azimuthal-integration entry points
|
|
200
|
+
- PBS job-submission helper scripts for HPC workflows
|
|
201
|
+
|
|
202
|
+
### User-facing analysis APIs
|
|
203
|
+
|
|
204
|
+
These modules provide the user-facing analysis layer after `xy` files are available:
|
|
205
|
+
|
|
206
|
+
- `analysis.fitting`
|
|
207
|
+
- `analysis.differential_analysis`
|
|
208
|
+
|
|
209
|
+
Once `xy` files are created, the downstream fitting and differential-analysis pipeline is shared across facilities.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Facility-specific workflow overview
|
|
214
|
+
|
|
215
|
+
The analysis pipeline is intentionally split because raw-data handling differs across facilities.
|
|
216
|
+
|
|
217
|
+
### Max IV FemtoMAX
|
|
218
|
+
|
|
219
|
+
- Uses facility-specific data reduction
|
|
220
|
+
- Produces homogenized 2D images
|
|
221
|
+
- Reuses the shared 2D azimuthal-integration workflow
|
|
222
|
+
- Then uses the shared downstream analysis pipeline
|
|
223
|
+
|
|
224
|
+
### SPring-8 SACLA
|
|
225
|
+
|
|
226
|
+
- Uses facility-specific data reduction
|
|
227
|
+
- Some reduction steps may depend on beamline-specific software, legacy Python environments, VPN access, or HPC job submission
|
|
228
|
+
- Produces homogenized 2D images
|
|
229
|
+
- Reuses the shared 2D azimuthal-integration workflow
|
|
230
|
+
- Then uses the shared downstream analysis pipeline
|
|
231
|
+
|
|
232
|
+
### ESRF ID09
|
|
233
|
+
|
|
234
|
+
- Does not use the same 2D homogenization route as FemtoMAX/SACLA
|
|
235
|
+
- Uses a different beamline-specific azimuthal-integration workflow to generate `xy` files
|
|
236
|
+
- Then uses the same downstream fitting and differential-analysis pipeline
|
|
237
|
+
|
|
238
|
+
In other words:
|
|
239
|
+
|
|
240
|
+
- **data reduction differs across facilities**
|
|
241
|
+
- **`xy` generation differs for ID09 vs the shared 2D workflow**
|
|
242
|
+
- **the downstream analysis after `xy` creation is shared**
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Notes
|
|
247
|
+
|
|
248
|
+
- Some analysis workflows may require facility-specific dependencies that are not part of a standard Python installation.
|
|
249
|
+
- Some SACLA workflows may rely on legacy Python environments and external HPC job submission.
|
|
250
|
+
- The simulation and analysis sections are developed within the same package but target different use cases.
|
|
251
|
+
- The project is published on PyPI as `trxrdpy` because the `xrdpy` name is already taken on PyPI.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Citation
|
|
256
|
+
|
|
257
|
+
If you use **XRDpy** in academic work, please cite the specific Zenodo release you used.
|
|
258
|
+
|
|
259
|
+
For the current public release:
|
|
260
|
+
|
|
261
|
+
**Julio Guzman-Brambila. XRDpy (v1.0.0). Zenodo. https://doi.org/10.5281/zenodo.18925472**
|
|
262
|
+
|
|
263
|
+
Project concept DOI (all versions):
|
|
264
|
+
|
|
265
|
+
**https://doi.org/10.5281/zenodo.18634909**
|
|
266
|
+
|
|
267
|
+
### BibTeX
|
|
268
|
+
|
|
269
|
+
```bibtex
|
|
270
|
+
@software{guzman_brambila_xrdpy_v100,
|
|
271
|
+
author = {Guzman-Brambila, Julio},
|
|
272
|
+
title = {XRDpy},
|
|
273
|
+
version = {1.0.0},
|
|
274
|
+
publisher = {Zenodo},
|
|
275
|
+
doi = {10.5281/zenodo.18925472},
|
|
276
|
+
url = {https://doi.org/10.5281/zenodo.18925472}
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## License
|
|
283
|
+
|
|
284
|
+
Creative Commons Attribution 4.0 International (CC BY 4.0). See `LICENSE` for details.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Author
|
|
289
|
+
|
|
290
|
+
**Julio Guzman-Brambila**
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "trxrdpy"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Python toolkit for time-resolved X-ray diffraction simulation and beamline-dependent analysis workflows."
|
|
9
|
+
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "CC-BY-4.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Julio Guzman-Brambila" }
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"xrd",
|
|
18
|
+
"time-resolved xrd",
|
|
19
|
+
"pump-probe",
|
|
20
|
+
"x-ray diffraction",
|
|
21
|
+
"diffraction",
|
|
22
|
+
"materials science",
|
|
23
|
+
"simulation",
|
|
24
|
+
"beamline analysis",
|
|
25
|
+
"pyFAI"
|
|
26
|
+
]
|
|
27
|
+
classifiers = [
|
|
28
|
+
"Development Status :: 4 - Beta",
|
|
29
|
+
"Intended Audience :: Science/Research",
|
|
30
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
32
|
+
"Programming Language :: Python :: 3",
|
|
33
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
34
|
+
"Programming Language :: Python :: 3.10",
|
|
35
|
+
"Programming Language :: Python :: 3.11",
|
|
36
|
+
"Programming Language :: Python :: 3.12"
|
|
37
|
+
]
|
|
38
|
+
dependencies = [
|
|
39
|
+
"numpy>=1.24",
|
|
40
|
+
"scipy>=1.10",
|
|
41
|
+
"matplotlib>=3.7",
|
|
42
|
+
"pandas>=2.0",
|
|
43
|
+
"h5py>=3.9",
|
|
44
|
+
"tqdm>=4.66",
|
|
45
|
+
"lmfit>=1.2",
|
|
46
|
+
"pyFAI>=2024.1",
|
|
47
|
+
"fabio>=2024.4",
|
|
48
|
+
"PyCifRW>=5.0",
|
|
49
|
+
"xrayutilities>=1.7",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[project.optional-dependencies]
|
|
53
|
+
analysis = [
|
|
54
|
+
"pytxs==0.0.2",
|
|
55
|
+
]
|
|
56
|
+
gui = [
|
|
57
|
+
"PyQt5>=5.15",
|
|
58
|
+
]
|
|
59
|
+
dev = [
|
|
60
|
+
"build>=1.2",
|
|
61
|
+
"twine>=5.0",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[project.urls]
|
|
65
|
+
Homepage = "https://github.com/julioguzmanb/XRDpy"
|
|
66
|
+
Repository = "https://github.com/julioguzmanb/XRDpy"
|
|
67
|
+
Documentation = "https://github.com/julioguzmanb/XRDpy"
|
|
68
|
+
DOI = "https://doi.org/10.5281/zenodo.18634909"
|
|
69
|
+
Issues = "https://github.com/julioguzmanb/XRDpy/issues"
|
|
70
|
+
|
|
71
|
+
[tool.setuptools]
|
|
72
|
+
include-package-data = true
|
|
73
|
+
package-dir = {"" = "src"}
|
|
74
|
+
|
|
75
|
+
[tool.setuptools.packages.find]
|
|
76
|
+
where = ["src"]
|
|
77
|
+
include = ["trxrdpy", "trxrdpy.*"]
|
|
78
|
+
|
|
79
|
+
[tool.setuptools.package-data]
|
|
80
|
+
"trxrdpy.analysis.Spring8_SACLA" = ["pbs/*.sh"]
|
trxrdpy-1.0.0/setup.cfg
ADDED