Python toolkit for time-resolved X-ray diffraction simulation and beamline-dependent analysis workflows.
Project description
XRDpy
XRDpy is a Python toolkit for X-ray diffraction (XRD) simulation and analysis, with a particular focus on time-resolved / pump–probe diffraction workflows.
The project name on GitHub and Zenodo is XRDpy.
The package is distributed on PyPI as trxrdpy and should be imported in Python as trxrdpy.
Repository
Source code: https://github.com/julioguzmanb/XRDpy
DOI (Zenodo)
- Project concept DOI (all versions): https://doi.org/10.5281/zenodo.18634909
- Current release DOI (v1.0.0): https://doi.org/10.5281/zenodo.18925472
Main capabilities
Simulation
- Polycrystalline XRD simulation
- Single-crystal diffraction simulation
- CIF-based crystallographic helpers
- Plotting utilities for simulated diffraction data
- A GUI for simulation workflows
Analysis
- Beamline/facility-specific data handling
- 2D image reduction and azimuthal integration
- Standardized generation of 1D
xydiffraction patterns - Peak fitting workflows
- Differential analysis workflows
- Shared utilities for plotting, path handling, and common analysis operations
Package structure
XRDpy/
├── pyproject.toml
├── README.md
├── LICENSE
└── src/
└── trxrdpy/
├── __init__.py
├── utils.py
├── detector.py
├── experiment.py
├── plot.py
├── sample.py
├── cif.py
├── simulation/
│ ├── __init__.py
│ ├── polycrystalline.py
│ ├── single_crystal.py
└── analysis/
├── common/
│ ├── __init__.py
│ ├── paths.py
│ ├── plot_utils.py
│ ├── general_utils.py
│ ├── azimint_utils.py
│ ├── differential_analysis_utils.py
│ └── fitting_utils.py
├── _shared_2d/
│ ├── __init__.py
│ └── azimint.py
├── ESRF_ID09/
│ ├── __init__.py
│ └── azimint.py
├── MaxIV_FemtoMAX/
│ ├── __init__.py
│ ├── datared_utils.py
│ ├── datared.py
│ └── azimint.py
├── Spring8_SACLA/
│ ├── __init__.py
│ ├── datared.py
│ ├── azimint.py
│ └── pbs/
│ └── parallel_job_sender.sh
├── differential_analysis.py
└── fitting.py
Installation
From PyPI
pip install trxrdpy
Optional extras:
pip install "trxrdpy[analysis]"
pip install "trxrdpy[gui]"
From source
Clone the repository and install in editable mode:
git clone https://github.com/julioguzmanb/XRDpy.git
cd XRDpy
pip install -e .
Import
import trxrdpy
from trxrdpy import simulation
from trxrdpy import analysis
More specific imports:
from trxrdpy.analysis import fitting
from trxrdpy.analysis import differential_analysis
from trxrdpy.analysis.MaxIV_FemtoMAX import azimint
from trxrdpy.analysis.Spring8_SACLA import datared
The package currently exposes the following top-level modules through trxrdpy.__init__:
from . import utils
from . import experiment
from . import plot
from . import sample
from . import cif
from . import simulation
from . import analysis
Analysis organization
The analysis section is organized into shared utilities, facility-specific workflows, and user-facing APIs.
analysis.common
Facility-independent shared utilities:
- path handling
- plotting helpers
- general helper functions
- common azimuthal-integration helpers
- fitting utilities
- differential-analysis utilities
analysis._shared_2d
Shared 2D-image-based azimuthal-integration workflow.
This layer is currently used by:
- Max IV FemtoMAX
- SPring-8 SACLA
analysis.ESRF_ID09
ID09-specific azimuthal-integration workflow.
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.
analysis.MaxIV_FemtoMAX
FemtoMAX-specific analysis entry points.
This section contains:
- beamline-specific data reduction
- azimuthal-integration entry points
- wrappers that preserve the facility-facing public API
analysis.Spring8_SACLA
SACLA-specific analysis entry points.
This section contains:
- beamline-specific data reduction
- azimuthal-integration entry points
- PBS job-submission helper scripts for HPC workflows
User-facing analysis APIs
These modules provide the user-facing analysis layer after xy files are available:
analysis.fittinganalysis.differential_analysis
Once xy files are created, the downstream fitting and differential-analysis pipeline is shared across facilities.
Facility-specific workflow overview
The analysis pipeline is intentionally split because raw-data handling differs across facilities.
Max IV FemtoMAX
- Uses facility-specific data reduction
- Produces homogenized 2D images
- Reuses the shared 2D azimuthal-integration workflow
- Then uses the shared downstream analysis pipeline
SPring-8 SACLA
- Uses facility-specific data reduction
- Some reduction steps may depend on beamline-specific software, legacy Python environments, VPN access, or HPC job submission
- Produces homogenized 2D images
- Reuses the shared 2D azimuthal-integration workflow
- Then uses the shared downstream analysis pipeline
ESRF ID09
- Does not use the same 2D homogenization route as FemtoMAX/SACLA
- Uses a different beamline-specific azimuthal-integration workflow to generate
xyfiles - Then uses the same downstream fitting and differential-analysis pipeline
In other words:
- data reduction differs across facilities
xygeneration differs for ID09 vs the shared 2D workflow- the downstream analysis after
xycreation is shared
Notes
- Some analysis workflows may require facility-specific dependencies that are not part of a standard Python installation.
- Some SACLA workflows may rely on legacy Python environments and external HPC job submission.
- The simulation and analysis sections are developed within the same package but target different use cases.
- The project is published on PyPI as
trxrdpybecause thexrdpyname is already taken on PyPI.
Citation
If you use XRDpy in academic work, please cite the specific Zenodo release you used.
For the current public release:
Julio Guzman-Brambila. XRDpy (v1.0.0). Zenodo. https://doi.org/10.5281/zenodo.18925472
Project concept DOI (all versions):
https://doi.org/10.5281/zenodo.18634909
BibTeX
@software{guzman_brambila_xrdpy_v100,
author = {Guzman-Brambila, Julio},
title = {XRDpy},
version = {1.0.0},
publisher = {Zenodo},
doi = {10.5281/zenodo.18925472},
url = {https://doi.org/10.5281/zenodo.18925472}
}
License
Creative Commons Attribution 4.0 International (CC BY 4.0). See LICENSE for details.
Author
Julio Guzman-Brambila
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trxrdpy-1.0.0.tar.gz.
File metadata
- Download URL: trxrdpy-1.0.0.tar.gz
- Upload date:
- Size: 179.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d22a6689caf7f1059be81b492464e485bdbab6217d2fdb4c8eae8b0e6c1bfd17
|
|
| MD5 |
6dd91a76a81ce5ddbcdae8be7b0e7b66
|
|
| BLAKE2b-256 |
2f2c57ff7a28f1218896efe0f03895f887a3581ae2b07c81332310e18b7046a3
|
Provenance
The following attestation bundles were made for trxrdpy-1.0.0.tar.gz:
Publisher:
publish.yml on julioguzmanb/XRDpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trxrdpy-1.0.0.tar.gz -
Subject digest:
d22a6689caf7f1059be81b492464e485bdbab6217d2fdb4c8eae8b0e6c1bfd17 - Sigstore transparency entry: 1068958960
- Sigstore integration time:
-
Permalink:
julioguzmanb/XRDpy@8c884b531695397df0ea9449634cd2b8518f4b34 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/julioguzmanb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c884b531695397df0ea9449634cd2b8518f4b34 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trxrdpy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: trxrdpy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 192.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41226d313908ba7984d9e95ee0521497ae7200f65966437e8c6da695737a0d24
|
|
| MD5 |
bf22d8a0a3e3b1e023cbf431a505c0a6
|
|
| BLAKE2b-256 |
4b0e42044f71316de22640b12bfcd53ea68ffcea15059afad676d232ac8b3070
|
Provenance
The following attestation bundles were made for trxrdpy-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on julioguzmanb/XRDpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trxrdpy-1.0.0-py3-none-any.whl -
Subject digest:
41226d313908ba7984d9e95ee0521497ae7200f65966437e8c6da695737a0d24 - Sigstore transparency entry: 1068959018
- Sigstore integration time:
-
Permalink:
julioguzmanb/XRDpy@8c884b531695397df0ea9449634cd2b8518f4b34 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/julioguzmanb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c884b531695397df0ea9449634cd2b8518f4b34 -
Trigger Event:
push
-
Statement type: