Skip to main content

XRD-utils is a Python package for loading, aligning, analyzing, and visualizing X-ray diffraction (XRD) data, including line scans and reciprocal space maps.

Installation

Install from PyPI:

pip install XRD-utils

Install from source:

git clone https://github.com/yig319/XRD-utils.git
cd XRD-utils
pip install -e .

Clone On A New Desktop

From a fresh machine, use:

git clone https://github.com/yig319/XRD-utils.git
cd XRD-utils
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements-dev.txt
pip install -e .

Notes:

  • requirements.txt contains runtime dependencies.

  • requirements-dev.txt includes runtime + test/build/docs tooling.

Quick Start

import numpy as np
from xrd_utils.xrd_utils import detect_peaks, calculate_fwhm

# Example synthetic profile
x = np.linspace(40, 50, 500)
y = np.exp(-((x - 45.0) ** 2) / 0.02) + 0.05

peak_x, peak_y = detect_peaks(x, y, num_peaks=1, prominence=0.1)
fwhm, amp, left, right = calculate_fwhm(x, y, peak_x[0])

Usage Guide

See USAGE.md for a practical guide to scan loading, stacked plotting, peak tables, reciprocal-space maps, and the boundary between XRD-utils and sci-viz-utils.

Runnable Demo

Try a full synthetic workflow (peak detection, FWHM, alignment, and plotting):

# from repo root
PYTHONPATH=src python examples/demo_xrd_scan.py

This writes a demo figure to examples/output/demo_xrd_scan.png.

Features

  • Peak detection and alignment utilities for XRD scans.

  • FWHM estimation and fringe-based thickness estimation helpers.

  • Visualization for stacked 1D XRD scans and file-based scan plotting.

  • Reciprocal space mapping (RSM) plotting tools.

  • Migrated convenience helpers from PlumeDynamics: plot_xrd_files and plot_rsm.

Documentation

Sphinx documentation is provided in the docs directory.

Build docs locally:

pip install -r docs/requirements.txt
pip install -e .
sphinx-build -b html docs docs/_build/html

License

This project is licensed under the MIT License. See LICENSE.txt.

Metadata

Release files for XRD-utils 5.0.3

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

Source distribution (sdist)

Source distribution for XRD-utils 5.0.3
File Size Uploaded
xrd_utils-5.0.3.tar.gz 573.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for XRD-utils 5.0.3
File Interpreter ABI Platform
xrd_utils-5.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 587.8 kB

Release files / xrd_utils-5.0.3.tar.gz

Download URL xrd_utils-5.0.3.tar.gz
Size 573.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1111d03570063c789fe5490e1d897eb8622a4cfbddf202904618f5676ef6ae83
BLAKE2b-256 checksum
How to use checksums
3d04fa027602da3c8457b5487e5f00fc90771359ed227ae335dcd59ce979cc5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.

Transparency log

Release files / xrd_utils-5.0.3-py3-none-any.whl

Download URL xrd_utils-5.0.3-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50b65a2c9aeb10b5ba2290417136b5ad12d7e0c62da75cc9f588e5d55f7e28f8
BLAKE2b-256 checksum
How to use checksums
f119d32b8e46bc0584967d9d78e80c3d66eccb2d5eb969aa9499ea7ddb77d069
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

5.0.3 This release

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0

2 release files

3.0

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