Skip to main content

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.edf", "border.npy"],
        },
        {
            "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 and images are loaded through Ewoks data access. Mask files must be .edf or .npy and are loaded with Fabio; 2D arrays and None are also accepted. Nonzero mask pixels are excluded from integration. Masks are not flipped. 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.1

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.1
File Size Uploaded Provenance Actions
ewoksid27-0.0.1.tar.gz 12.9 kB Without provenance Details for ewoksid27-0.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 25.4 kB

Release files / ewoksid27-0.0.1.tar.gz

Download URL ewoksid27-0.0.1.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5ffdf2e71ff5536e97f6b941272a7461c94eac16632df84b693f5bdd15e09b0a
BLAKE2b-256 checksum
How to use checksums
854955bfe3cfb1bb112c961bd5de199ffe8e81bc320f16af9f11e852f76b1362
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.1-py3-none-any.whl

Download URL ewoksid27-0.0.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b6fbe9a522c085c0a8cabaf8845069df671d81ce3bc6043c902e9d299d892cc
BLAKE2b-256 checksum
How to use checksums
c7c221e59a60c2cc7bdb85283b47b012e767ca1ffe1c96d1f84a0d9bc1c7fb51
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.1

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