Skip to main content

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 in pyproject.toml)
  • diffpy.pdfgetx 2.3+ (not published on PyPI; download the wheel from the PDFgetX project and install it with pip 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]
  1. Prepare an integrated XRPD dataset exported as an HDF5/NXdata signal (nxdata_url), and a PDFgetX configuration file or dictionary.
  2. Choose an output location for the ASCII files and NeXus group (usually under the same HDF5 file).
  3. 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 (PdfGetXSaveAscii and PdfGetXSaveNexus).

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:

  1. Fork or clone the repository and create a new branch for your feature or fix.
  2. Add tests and documentation when applicable.
  3. 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.

Metadata

Release files for ewokspdf 0.2.0

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

Source distribution (sdist)

Source distribution for ewokspdf 0.2.0
File Size Uploaded
ewokspdf-0.2.0.tar.gz 1.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ewokspdf 0.2.0
File Interpreter ABI Platform
ewokspdf-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.8 MB

Release files / ewokspdf-0.2.0.tar.gz

Download URL ewokspdf-0.2.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
cb6b5b9952567f1de56659612b99f733429c435164d39bda2e2993bc2464177a
BLAKE2b-256 checksum
How to use checksums
64f8a414b316f4300063905560a87fa7cee28ae75c7d2434108135327e1a1209
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / ewokspdf-0.2.0-py3-none-any.whl

Download URL ewokspdf-0.2.0-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
696182a54ce192f9f677834ce2f526f25e5b2bbcae8e1f316f728956da8be387
BLAKE2b-256 checksum
How to use checksums
545bab16ead01fd0da72cb84387dac77257dc55cf180649588db32fcd3e470b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

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