Ewoks project for processing Pair Distribution Function analysis (PDF).
Project description
ewokspdf
ewokspdf provides a set of Ewoks workflow tasks dedicated to Pair Distribution Function (PDF) analysis.
The tasks orchestrate the full PDFgetX3 pipeline—averaging integrated XRPD patterns, configuring and running pdfgetx, and saving results to NeXus (HDF5) or ASCII.
Features
- Ewoks-compatible tasks for averaging, configuring, processing, and exporting PDF data.
- Convenience utilities for storing results in instrument-friendly NeXus layouts.
- Example workflow demonstrating how to chain the provided tasks together.
Installation
At the ESRF the package is usually deployed on Ewoks workers via Ansible; no manual action is required.
To install manually you will need Python 3.11+ and pip:
pip install ewokspdf
Or install the development version from source:
git clone https://gitlab.esrf.fr/workflow/ewoksapps/ewokspdf.git
cd ewokspdf
pip install -e .[doc]
The runtime dependency tree is deliberately small:
ewoksxrpd(declared inpyproject.toml)diffpy.pdfgetx2.3+ (not published on PyPI; download the wheel from the PDFgetX project and install it withpip install ./diffpy.pdfgetx-<VERSION>.whl)
PDF calculations require diffpy.pdfgetx 2.3+ (aka PDFgetX3).
Ensure the wheel you install matches your Python version.
Quickstart
The repository contains a demonstrator workflow (src/ewokspdf/workflows/demo.json) that links all provided tasks:
flowchart LR
A[PdfGetXAverage] --> B[PdfGetXProcessor]
C[PdfGetXConfig] --> B
B --> D[PdfGetXSaveAscii]
B --> E[PdfGetXSaveNexus]
- Prepare an integrated XRPD dataset exported as an HDF5/NXdata signal (
nxdata_url), and a PDFgetX configuration file or dictionary. - Choose an output location for the ASCII files and NeXus group (usually under the same HDF5 file).
- Execute the workflow with Ewoks (either via the Ewoks GUI or the CLI), for example:
ewoks execute src/ewokspdf/workflows/demo.json \
--inputs average.nxdata_url=/data/integrated.h5::/entry/scan/data \
--inputs config.filename=/data/pdfgetx.cfg \
--inputs save_ascii.filename=/tmp/pdf/results.h5 \
--inputs save_nexus.nxdata_url=/tmp/pdf/results.h5::/entry/1.1/ \
--inputs processor.info=@json:'{"wavelength": 0.14088}'
The workflow will:
- average XRPD patterns (
PdfGetXAverage), - merge configuration from file and overrides (
PdfGetXConfig), - compute PDF signals (
PdfGetXProcessor), and - persist results to ASCII and NeXus (
PdfGetXSaveAsciiandPdfGetXSaveNexus).
Running locally outside Ewoks
You can drive the tasks programmatically if Ewoks is not available:
from ewokspdf.tasks.average import PdfGetXAverage
from ewokspdf.tasks.config import PdfGetXConfig
from ewokspdf.tasks.processor import PdfGetXProcessor
avg = PdfGetXAverage()
avg(nxdata_url="silx:///path/to/data.h5::/entry/data")
cfg = PdfGetXConfig()
cfg(filename="pdfgetx.cfg", pdfgetx_options_dict={"qmax": 22.0})
processor = PdfGetXProcessor()
processor(radial=avg.outputs.radial,
intensity=avg.outputs.intensity,
info=avg.outputs.info,
pdfgetx_options=cfg.outputs.pdfgetx_options)
Persist the results with either PdfGetXSaveAscii or PdfGetXSaveNexus depending on the output format you need.
Documentation
Detailed guides, conceptual overviews, tutorials, and API references live in the doc/ directory and on Read the Docs.
To build the documentation locally run:
sphinx-build -n -b html doc doc/_build/html
Contributing
Contributions are welcome! To contribute:
- Fork or clone the repository and create a new branch for your feature or fix.
- Add tests and documentation when applicable.
- Open a merge request for review.
See the CONTRIBUTING.md file for more details.
License
This project is licensed under the MIT License. See the LICENSE.md file for details.
Support
For questions or issues open a ticket on the GitLab project or submit a data processing request.
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 ewokspdf-0.2.0.tar.gz.
File metadata
- Download URL: ewokspdf-0.2.0.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb6b5b9952567f1de56659612b99f733429c435164d39bda2e2993bc2464177a
|
|
| MD5 |
2c1d6282824aed96d0ff1617c9dde726
|
|
| BLAKE2b-256 |
64f8a414b316f4300063905560a87fa7cee28ae75c7d2434108135327e1a1209
|
File details
Details for the file ewokspdf-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ewokspdf-0.2.0-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
696182a54ce192f9f677834ce2f526f25e5b2bbcae8e1f316f728956da8be387
|
|
| MD5 |
ff28208ef31a82141df762dddd11a635
|
|
| BLAKE2b-256 |
545bab16ead01fd0da72cb84387dac77257dc55cf180649588db32fcd3e470b9
|