Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ewoksid27

Ewoks tasks and workflows for ID27 data processing.

Multigeometry integration

The packaged src/ewoksid27/workflows/multigeometry.json workflow runs:

PrepareMultiGeometryImages → Integrate1DMultiGeometry → SaveNexusIntegrated

The saved pattern passes through ewoksxrpd.tasks.subtract_pattern.SubtractBackgroundPattern and ewoksxrpd.tasks.ascii.SaveNexusPatternsAsAscii. Set save_ascii.output_filename_template to the ASCII destination (with %d for the pattern index). It writes radial and intensity columns, plus intensity errors when available, with units and integration settings in the header.

Preparation averages the frames within each scan, flips vertically, multiplies by an optional correction map, then sums repeated scans separately for each geometry in float64. Each group corresponds to one detector y position. The correction map is flipped as well; masks must already be in calibration coordinates. Scan inputs may be 2D images or 3D (frames, height, width) stacks, as arrays or data URLs. Set flip_vertical=False if images and correction maps already match the calibration orientation.

from importlib.resources import files
from ewokscore import execute_graph

workflow = files("ewoksid27") / "workflows" / "multigeometry.json"
execute_graph(
    str(workflow),
    inputs=[
        {
            "id": "prepare",
            "name": "image_groups",
            "value": [
                ["center1.h5::/image", "center2.h5::/image"],
                ["border1.h5::/image", "border2.h5::/image"],
            ],
        },
        {
            "id": "prepare",
            "name": "correction_map",
            "value": "correction.npy",
        },
        {
            "id": "integrate",
            "name": "poni_files",
            "value": ["center.poni", "border.poni"],
        },
        {
            "id": "integrate",
            "name": "masks",
            "value": ["center.mask", "border.mask"],
        },
        {
            "id": "integrate",
            "name": "integration_options",
            "value": {
                "nbpt_rad": 500,
                "unit": "q_A^-1",
                "radial_range_min": 0.9,
                "radial_range_max": 17.5,
                "polarization_factor": 0.99,
            },
        },
        {"id": "save", "name": "url", "value": "patterns.h5::/sample"},
        {
            "id": "subtract_background",
            "name": "nxdata_url",
            "value": "patterns.h5::/sample/integrate/integrated",
        },
        {
            "id": "subtract_background",
            "name": "output_nxprocess_url",
            "value": "patterns.h5::/sample/subtract_background",
        },
        {
            "id": "save_ascii",
            "name": "output_filename_template",
            "value": "patterns/sample_%d.dat",
        },
    ],
)

Image groups, PONI files and masks use the same geometry order. The correction map multiplies the signal, unlike a divisive flatfield. Exposure/monitor scaling and uncertainty propagation through preparation are not inferred. Geometry integration is sequential by default (threadpoolsize=0).

Blissoda should submit the workflow once all scans in a collection are complete. Run the same workflow for backgrounds, saving to a separate entry. Background subtraction is included after integration and NeXus saving, before ASCII export. It is disabled by default, so a background is integrated without subtracting itself. For sample processing, add these workflow inputs:

({"id": "subtract_background", "name": "enabled", "value": True},)
(
    {
        "id": "subtract_background",
        "name": "background_nxdata_url",
        "value": "background.h5::/sample/integrate/integrated",
    },
)
({"id": "subtract_background", "name": "background_factor", "value": 1.0},)

The ewoksxrpd.tasks.subtract_pattern.SubtractBackgroundPattern task subtracts the integrated background and propagates available errors. The original pattern remains at /sample/integrate/integrated; the corrected pattern is saved at /sample/subtract_background/integrated and exported to ASCII. The factor is manual; monitor or exposure normalization is not inferred. Wait for background processing to succeed before using its data URL.

The workflow sets integrate.stack_patterns=True to save intensity and errors with shape (1, radial_bins), as required by the reused subtraction task. The radial axis remains one-dimensional. Use the same radial grid and units for sample and background; the subtraction task checks shapes and units but does not compare radial coordinates. Direct integration task calls still return 1D arrays unless stack_patterns=True is supplied.

Documentation

https://ewoksid27.readthedocs.io/

Metadata

Release files for ewoksid27 0.0.1b0

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

Source distribution (sdist)

Source distribution for ewoksid27 0.0.1b0
File Size Uploaded Provenance Actions
ewoksid27-0.0.1b0.tar.gz 12.3 kB Without provenance Details for ewoksid27-0.0.1b0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ewoksid27 0.0.1b0
File Interpreter ABI Platform Actions
ewoksid27-0.0.1b0-py3-none-any.whl Python 3 none any Details for ewoksid27-0.0.1b0-py3-none-any.whl

Total release size: 24.3 kB

Release files / ewoksid27-0.0.1b0.tar.gz

Download URL ewoksid27-0.0.1b0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
63d32571b35a4ed1c763e1ebe85dcfa708d2d944e36491ba62bf5233228599a9
BLAKE2b-256 checksum
How to use checksums
fafd0efb26a024f1ae5634c3bf7a44317e3e3e4eecd563b68ff995d6a9d2f576
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / ewoksid27-0.0.1b0-py3-none-any.whl

Download URL ewoksid27-0.0.1b0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1a07e9407708d37e06ab5438295e1d9c03295faacf8d7694f378d0ce323da31
BLAKE2b-256 checksum
How to use checksums
bf84fee21c7ef59296d7464e95162b3eac2499a80789d8795ca489459b152735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for ewoksid27 0.0.1b0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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