ewokssoleildemo 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
File without changes
@@ -0,0 +1,151 @@
1
+ """Read SOLEIL FlyScan NeXus files with Ewoks tasks for Bliss scans."""
2
+
3
+ import os
4
+ import re
5
+ from typing import Optional
6
+
7
+ import h5py
8
+ from ewokscore import Task
9
+ from ewokscore.model import BaseInputModel
10
+ from ewokscore.model import BaseOutputModel
11
+ from pydantic import Field
12
+
13
+
14
+ class Inputs(BaseInputModel):
15
+ filename: str = Field(
16
+ description="FlyScan NeXus file written by the DataMerger.",
17
+ examples=["/data/scan_0001.nxs"],
18
+ )
19
+ output_filename: str = Field(
20
+ description="HDF5 file for the Bliss scan. The scan data are virtual "
21
+ "datasets that refer to the FlyScan NeXus file.",
22
+ examples=["/processed/scan_0001_bliss.h5"],
23
+ )
24
+ scan_number: int = Field(default=1, description="Scan number in the output file.")
25
+ overwrite: bool = Field(default=True, description="Overwrite an existing scan.")
26
+
27
+
28
+ class Outputs(BaseOutputModel):
29
+ bliss_scan_uri: str = Field(
30
+ description="Bliss scan URI.",
31
+ examples=["/processed/scan_0001_bliss.h5::/1.1"],
32
+ )
33
+
34
+
35
+ class FlyscanToBliss(Task, input_model=Inputs, output_model=Outputs):
36
+ """Expose a FlyScan map as a Bliss scan with one point per pixel."""
37
+
38
+ def run(self):
39
+ filename = os.path.abspath(self.inputs.filename)
40
+ output_filename = os.path.abspath(self.inputs.output_filename)
41
+ scan_name = f"{self.inputs.scan_number}.1"
42
+
43
+ os.makedirs(os.path.dirname(output_filename), exist_ok=True)
44
+ with h5py.File(filename, "r") as nxroot:
45
+ with h5py.File(output_filename, "a") as bliss_root:
46
+ if scan_name in bliss_root:
47
+ if not self.inputs.overwrite:
48
+ raise FileExistsError(f"{output_filename}::/{scan_name}")
49
+ del bliss_root[scan_name]
50
+ bliss_root.attrs["NX_class"] = "NXroot"
51
+ _save_bliss_scan(_flyscan_entry(nxroot), bliss_root, scan_name)
52
+
53
+ self.outputs.bliss_scan_uri = f"{output_filename}::/{scan_name}"
54
+
55
+
56
+ _MCA_DATASET = re.compile(
57
+ r"^(?P<board>xmap\d+)(?P<field>channel|livetime|realtime|icr|ocr)(?P<channel>\d+)$"
58
+ )
59
+
60
+ _MCA_FIELDS = {
61
+ "channel": "data",
62
+ "livetime": "trigger_live_time",
63
+ "realtime": "elapsed_time",
64
+ "icr": "trigger_count_rate",
65
+ "ocr": "event_count_rate",
66
+ }
67
+
68
+ _POSITIONER_SUFFIX = "_dataset"
69
+
70
+
71
+ def _flyscan_entry(nxroot: h5py.File) -> h5py.Group:
72
+ for entry in nxroot.values():
73
+ if entry.attrs.get("NX_class") in ("NXentry", b"NXentry"):
74
+ return entry
75
+ raise ValueError(f"No NXentry in {nxroot.filename}")
76
+
77
+
78
+ def _save_bliss_scan(entry: h5py.Group, bliss_root: h5py.File, scan_name: str) -> None:
79
+ scan = bliss_root.create_group(scan_name)
80
+ scan.attrs["NX_class"] = "NXentry"
81
+ scan["title"] = f"{os.path.basename(entry.file.filename)}::{entry.name}"
82
+ instrument = scan.create_group("instrument")
83
+ instrument.attrs["NX_class"] = "NXinstrument"
84
+ measurement = scan.create_group("measurement")
85
+ measurement.attrs["NX_class"] = "NXcollection"
86
+ positioners_start = instrument.create_group("positioners_start")
87
+ positioners_start.attrs["NX_class"] = "NXcollection"
88
+
89
+ energy = _beam_energy(entry)
90
+ if energy is not None:
91
+ positioners_start["energy"] = energy[()]
92
+ positioners_start["energy"].attrs["units"] = energy.attrs.get("units", "keV")
93
+
94
+ for name, source in entry["scan_data"].items():
95
+ match = _MCA_DATASET.match(name)
96
+ if match:
97
+ group_name = f"{match['board']}_det{match['channel']}"
98
+ field = _MCA_FIELDS[match["field"]]
99
+ detector = _require_nxgroup(instrument, group_name, "NXdetector")
100
+ dset = _flatten(detector, field, source)
101
+ if field == "data":
102
+ measurement[group_name] = h5py.SoftLink(dset.name)
103
+ else:
104
+ measurement[f"{group_name}_{field}"] = h5py.SoftLink(dset.name)
105
+ elif name.endswith(_POSITIONER_SUFFIX):
106
+ group_name = name[: -len(_POSITIONER_SUFFIX)]
107
+ positioner = _require_nxgroup(instrument, group_name, "NXpositioner")
108
+ dset = _flatten(positioner, "value", source)
109
+ measurement[group_name] = h5py.SoftLink(dset.name)
110
+ positioners_start[group_name] = source[(0,) * source.ndim]
111
+ else:
112
+ detector = _require_nxgroup(instrument, name, "NXdetector")
113
+ dset = _flatten(detector, "data", source)
114
+ measurement[name] = h5py.SoftLink(dset.name)
115
+
116
+
117
+ def _beam_energy(entry: h5py.Group) -> Optional[h5py.Dataset]:
118
+ for instrument in entry.values():
119
+ if not isinstance(instrument, h5py.Group):
120
+ continue
121
+ for group in instrument.values():
122
+ if (
123
+ isinstance(group, h5py.Group)
124
+ and group.attrs.get("NX_class")
125
+ in ("NXmonochromator", b"NXmonochromator")
126
+ and "energy" in group
127
+ ):
128
+ return group["energy"]
129
+ return None
130
+
131
+
132
+ def _require_nxgroup(parent: h5py.Group, name: str, nx_class: str) -> h5py.Group:
133
+ group = parent.require_group(name)
134
+ group.attrs["NX_class"] = nx_class
135
+ return group
136
+
137
+
138
+ def _flatten(parent: h5py.Group, name: str, source: h5py.Dataset) -> h5py.Dataset:
139
+ """Virtual dataset that merges the first two dimensions of `source`."""
140
+ nrows, ncols = source.shape[:2]
141
+ layout = h5py.VirtualLayout(
142
+ shape=(nrows * ncols,) + source.shape[2:], dtype=source.dtype
143
+ )
144
+ vsource = h5py.VirtualSource(source)
145
+ for row in range(nrows):
146
+ layout[row * ncols : (row + 1) * ncols] = vsource[row]
147
+ dset = parent.create_virtual_dataset(name, layout)
148
+ units = source.attrs.get("units")
149
+ if units:
150
+ dset.attrs["units"] = units
151
+ return dset
@@ -0,0 +1,79 @@
1
+ """Select the next scan area from an XRF map."""
2
+
3
+ import h5py
4
+ import numpy
5
+ from ewokscore import Task
6
+ from ewokscore.model import BaseInputModel
7
+ from ewokscore.model import BaseOutputModel
8
+ from ewoksfluo.io.hdf5 import split_h5uri
9
+ from pydantic import Field
10
+ from scipy import ndimage
11
+
12
+
13
+ class Inputs(BaseInputModel):
14
+ xrf_results_uri: str = Field(
15
+ description="Regridded XRF results.",
16
+ examples=["/processed/scan_0001_xrf.h5::/1.1/regrid/results"],
17
+ )
18
+ bliss_scan_uri: str = Field(
19
+ description="Bliss scan with the positions of the map axes.",
20
+ examples=["/processed/scan_0001_xrf.h5::/1.1"],
21
+ )
22
+ signal: str = Field(description="Element map to select from.", examples=["Ta_L"])
23
+ percentile: float = Field(
24
+ default=90, description="Select the map points above this percentile."
25
+ )
26
+ zoom: float = Field(default=2, description="Pixel size reduction factor.")
27
+
28
+
29
+ class Outputs(BaseOutputModel):
30
+ sample_area: list[float] = Field(
31
+ description="Next scan area: start fast axis, start slow axis, width, height.",
32
+ examples=[[3.5, 2.0, 1.5, 1.0]],
33
+ )
34
+ pixel_size: float = Field(description="Next pixel size.", examples=[0.05])
35
+
36
+
37
+ class SelectArea(Task, input_model=Inputs, output_model=Outputs):
38
+ """Select the largest region with a high signal and scan it with smaller pixels."""
39
+
40
+ def run(self) -> None:
41
+ filename, h5path = split_h5uri(self.inputs.xrf_results_uri)
42
+ with h5py.File(filename, "r") as h5file:
43
+ parameters = h5file[h5path]["parameters"]
44
+ axes = list(parameters.attrs["axes"])
45
+ image = parameters[self.inputs.signal][()]
46
+ grid = [parameters[axis][()] for axis in axes]
47
+
48
+ filename, h5path = split_h5uri(self.inputs.bliss_scan_uri)
49
+ with h5py.File(filename, "r") as h5file:
50
+ measurement = h5file[h5path]["measurement"]
51
+ ifast, step = _fast_axis([measurement[axis][()] for axis in axes])
52
+
53
+ mask = image > numpy.nanpercentile(image, self.inputs.percentile)
54
+ mask = ndimage.binary_opening(mask, iterations=2)
55
+ labels, nlabels = ndimage.label(mask)
56
+ if not nlabels:
57
+ raise RuntimeError(f"No region found in {self.inputs.signal!r}")
58
+ sizes = ndimage.sum(mask, labels, range(1, nlabels + 1))
59
+ largest = int(numpy.argmax(sizes))
60
+ slices = ndimage.find_objects(labels)[largest]
61
+
62
+ fast_range = grid[ifast][slices[ifast]]
63
+ slow_range = grid[1 - ifast][slices[1 - ifast]]
64
+ self.outputs.sample_area = [
65
+ float(fast_range[0]),
66
+ float(slow_range[0]),
67
+ float(fast_range[-1] - fast_range[0]),
68
+ float(slow_range[-1] - slow_range[0]),
69
+ ]
70
+ self.outputs.pixel_size = float(step / self.inputs.zoom)
71
+
72
+
73
+ def _fast_axis(positions: list[numpy.ndarray]) -> tuple[int, float]:
74
+ """Index and scan step of the axis that moves between consecutive scan points."""
75
+ steps = [numpy.median(numpy.abs(numpy.diff(values))) for values in positions]
76
+ ifast = int(
77
+ numpy.argmax([step / numpy.ptp(v) for step, v in zip(steps, positions)])
78
+ )
79
+ return ifast, float(steps[ifast])
File without changes
@@ -0,0 +1,40 @@
1
+ import h5py
2
+ import numpy
3
+
4
+ from ewokssoleildemo.tasks.flyscan import FlyscanToBliss
5
+
6
+
7
+ def test_flyscan_to_bliss(tmp_path):
8
+ nrows, ncols, nchan = 3, 4, 5
9
+ spectra = numpy.arange(nrows * ncols * nchan).reshape(nrows, ncols, nchan)
10
+ samx = numpy.tile(numpy.arange(ncols, dtype=float), (nrows, 1)) + 5
11
+ filename = str(tmp_path / "flyscan.nxs")
12
+ with h5py.File(filename, "w") as nxroot:
13
+ entry = nxroot.create_group("flyscan_1")
14
+ entry.attrs["NX_class"] = "NXentry"
15
+ mono = entry.create_group("BEAMLINE/Monochromator")
16
+ mono.attrs["NX_class"] = "NXmonochromator"
17
+ mono["energy"] = 12.0
18
+ mono["energy"].attrs["units"] = "keV"
19
+ scan_data = entry.create_group("scan_data")
20
+ scan_data["xmap1channel00"] = spectra
21
+ scan_data["xmap1icr00"] = numpy.ones((nrows, ncols))
22
+ scan_data["samx_dataset"] = samx
23
+ scan_data["i0"] = numpy.ones((nrows, ncols))
24
+
25
+ task = FlyscanToBliss(
26
+ inputs={"filename": filename, "output_filename": str(tmp_path / "bliss.h5")}
27
+ )
28
+ task.execute()
29
+
30
+ bliss_filename, scan_name = task.outputs.bliss_scan_uri.split("::/")
31
+ with h5py.File(bliss_filename, "r") as root:
32
+ scan = root[scan_name]
33
+ numpy.testing.assert_array_equal(
34
+ scan["measurement/xmap1_det00"][()], spectra.reshape(-1, nchan)
35
+ )
36
+ numpy.testing.assert_array_equal(scan["measurement/samx"][()], samx.flatten())
37
+ assert scan["instrument/xmap1_det00/trigger_count_rate"].shape == (12,)
38
+ assert scan["measurement/i0"].shape == (12,)
39
+ assert scan["instrument/positioners_start/samx"][()] == 5
40
+ assert scan["instrument/positioners_start/energy"][()] == 12
@@ -0,0 +1,38 @@
1
+ import h5py
2
+ import numpy
3
+ import pytest
4
+
5
+ from ewokssoleildemo.tasks.select_area import SelectArea
6
+
7
+
8
+ @pytest.mark.parametrize("axes", [["samx", "samz"], ["samz", "samx"]])
9
+ def test_select_area(tmp_path, axes):
10
+ fast = numpy.linspace(0, 10, 101) # samx
11
+ slow = numpy.linspace(0, 7, 71) # samz
12
+ image = numpy.zeros((fast.size, slow.size))
13
+ image[30:60, 20:40] = 100
14
+ if axes[0] == "samz":
15
+ image = image.T
16
+ # The scan step (0.2) differs from the step of the regrid grid (0.1).
17
+ samz, samx = numpy.meshgrid(slow, fast[::2], indexing="ij")
18
+ filename = str(tmp_path / "xrf.h5")
19
+ with h5py.File(filename, "w") as root:
20
+ root["1.1/measurement/samx"] = samx.flatten()
21
+ root["1.1/measurement/samz"] = samz.flatten()
22
+ parameters = root.create_group("1.1/regrid/results/parameters")
23
+ parameters.attrs["axes"] = axes
24
+ parameters["Ta_L"] = image
25
+ parameters["samx"] = fast
26
+ parameters["samz"] = slow
27
+
28
+ task = SelectArea(
29
+ inputs={
30
+ "xrf_results_uri": f"{filename}::/1.1/regrid/results",
31
+ "bliss_scan_uri": f"{filename}::/1.1",
32
+ "signal": "Ta_L",
33
+ }
34
+ )
35
+ task.execute()
36
+
37
+ numpy.testing.assert_allclose(task.outputs.sample_area, [3, 2, 2.9, 1.9])
38
+ numpy.testing.assert_allclose(task.outputs.pixel_size, 0.1)
@@ -0,0 +1,15 @@
1
+ from ewokscore import load_graph
2
+ from ewokscore.workflow_discovery import discover_workflows_from_modules
3
+ from ewoksutils.import_utils import import_qualname
4
+
5
+
6
+ def test_workflows():
7
+ workflows = discover_workflows_from_modules("ewokssoleildemo.workflows.*")
8
+ assert sorted(workflows) == [
9
+ "ewokssoleildemo.workflows.xrfmap_flyscan",
10
+ "ewokssoleildemo.workflows.xrfmap_flyscan_select_area",
11
+ ]
12
+ for workflow in workflows:
13
+ graph = load_graph(workflow, representation="json_module").graph
14
+ for _, node in graph.nodes(data=True):
15
+ import_qualname(node["task_identifier"])
File without changes
@@ -0,0 +1,133 @@
1
+ {
2
+ "graph": {
3
+ "id": "xrfmap_flyscan",
4
+ "label": "XRF map: FlyScan, sum detectors before fit",
5
+ "schema_version": "1.1"
6
+ },
7
+ "nodes": [
8
+ {
9
+ "id": "convert",
10
+ "label": "FlyScan to Bliss",
11
+ "task_type": "class",
12
+ "task_identifier": "ewokssoleildemo.tasks.flyscan.FlyscanToBliss"
13
+ },
14
+ {
15
+ "id": "sum",
16
+ "label": "Sum spectra",
17
+ "task_type": "class",
18
+ "task_identifier": "ewoksfluo.tasks.sum_detectors.sum_spectra.SumXrfSpectra"
19
+ },
20
+ {
21
+ "id": "fit",
22
+ "label": "Fit",
23
+ "task_type": "class",
24
+ "task_identifier": "ewoksfluo.tasks.fit.tasks.FitSingleScanSingleDetector"
25
+ },
26
+ {
27
+ "id": "norm",
28
+ "label": "Normalize",
29
+ "task_type": "class",
30
+ "task_identifier": "ewoksfluo.tasks.normalization.norm_results.NormalizeXrfResults"
31
+ },
32
+ {
33
+ "id": "counters",
34
+ "label": "Raw counters",
35
+ "task_type": "class",
36
+ "task_identifier": "ewoksfluo.tasks.raw_counters.extract_counters.ExtractRawCounters"
37
+ },
38
+ {
39
+ "id": "regrid",
40
+ "label": "Regrid",
41
+ "task_type": "class",
42
+ "task_identifier": "ewoksfluo.tasks.regrid.regrid.RegridXrfResults"
43
+ }
44
+ ],
45
+ "links": [
46
+ {
47
+ "source": "convert",
48
+ "target": "sum",
49
+ "data_mapping": [
50
+ {
51
+ "source_output": "bliss_scan_uri",
52
+ "target_input": "bliss_scan_uri"
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "source": "sum",
58
+ "target": "fit",
59
+ "data_mapping": [
60
+ {
61
+ "source_output": "bliss_scan_uri",
62
+ "target_input": "bliss_scan_uri"
63
+ },
64
+ {
65
+ "source_output": "output_root_uri",
66
+ "target_input": "output_root_uri"
67
+ },
68
+ {
69
+ "source_output": "detector_name",
70
+ "target_input": "detector_name"
71
+ },
72
+ {
73
+ "source_output": "xrf_spectra_uri_template",
74
+ "target_input": "xrf_spectra_uri_template"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "source": "fit",
80
+ "target": "norm",
81
+ "data_mapping": [
82
+ {
83
+ "source_output": "bliss_scan_uri",
84
+ "target_input": "bliss_scan_uri"
85
+ },
86
+ {
87
+ "source_output": "output_root_uri",
88
+ "target_input": "output_root_uri"
89
+ },
90
+ {
91
+ "source_output": "xrf_results_uri",
92
+ "target_input": "xrf_results_uri"
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "source": "norm",
98
+ "target": "counters",
99
+ "data_mapping": [
100
+ {
101
+ "source_output": "bliss_scan_uri",
102
+ "target_input": "bliss_scan_uri"
103
+ },
104
+ {
105
+ "source_output": "output_root_uri",
106
+ "target_input": "output_root_uri"
107
+ },
108
+ {
109
+ "source_output": "xrf_results_uri",
110
+ "target_input": "xrf_results_uri"
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "source": "counters",
116
+ "target": "regrid",
117
+ "data_mapping": [
118
+ {
119
+ "source_output": "bliss_scan_uri",
120
+ "target_input": "bliss_scan_uri"
121
+ },
122
+ {
123
+ "source_output": "output_root_uri",
124
+ "target_input": "output_root_uri"
125
+ },
126
+ {
127
+ "source_output": "xrf_results_uri",
128
+ "target_input": "xrf_results_uri"
129
+ }
130
+ ]
131
+ }
132
+ ]
133
+ }
@@ -0,0 +1,153 @@
1
+ {
2
+ "graph": {
3
+ "id": "xrfmap_flyscan_select_area",
4
+ "label": "XRF map: FlyScan, select the next scan area",
5
+ "schema_version": "1.1"
6
+ },
7
+ "nodes": [
8
+ {
9
+ "id": "convert",
10
+ "label": "FlyScan to Bliss",
11
+ "task_type": "class",
12
+ "task_identifier": "ewokssoleildemo.tasks.flyscan.FlyscanToBliss"
13
+ },
14
+ {
15
+ "id": "sum",
16
+ "label": "Sum spectra",
17
+ "task_type": "class",
18
+ "task_identifier": "ewoksfluo.tasks.sum_detectors.sum_spectra.SumXrfSpectra"
19
+ },
20
+ {
21
+ "id": "fit",
22
+ "label": "Fit",
23
+ "task_type": "class",
24
+ "task_identifier": "ewoksfluo.tasks.fit.tasks.FitSingleScanSingleDetector"
25
+ },
26
+ {
27
+ "id": "norm",
28
+ "label": "Normalize",
29
+ "task_type": "class",
30
+ "task_identifier": "ewoksfluo.tasks.normalization.norm_results.NormalizeXrfResults"
31
+ },
32
+ {
33
+ "id": "counters",
34
+ "label": "Raw counters",
35
+ "task_type": "class",
36
+ "task_identifier": "ewoksfluo.tasks.raw_counters.extract_counters.ExtractRawCounters"
37
+ },
38
+ {
39
+ "id": "regrid",
40
+ "label": "Regrid",
41
+ "task_type": "class",
42
+ "task_identifier": "ewoksfluo.tasks.regrid.regrid.RegridXrfResults"
43
+ },
44
+ {
45
+ "id": "select",
46
+ "label": "Select area",
47
+ "task_type": "class",
48
+ "task_identifier": "ewokssoleildemo.tasks.select_area.SelectArea"
49
+ }
50
+ ],
51
+ "links": [
52
+ {
53
+ "source": "convert",
54
+ "target": "sum",
55
+ "data_mapping": [
56
+ {
57
+ "source_output": "bliss_scan_uri",
58
+ "target_input": "bliss_scan_uri"
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "source": "sum",
64
+ "target": "fit",
65
+ "data_mapping": [
66
+ {
67
+ "source_output": "bliss_scan_uri",
68
+ "target_input": "bliss_scan_uri"
69
+ },
70
+ {
71
+ "source_output": "output_root_uri",
72
+ "target_input": "output_root_uri"
73
+ },
74
+ {
75
+ "source_output": "detector_name",
76
+ "target_input": "detector_name"
77
+ },
78
+ {
79
+ "source_output": "xrf_spectra_uri_template",
80
+ "target_input": "xrf_spectra_uri_template"
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "source": "fit",
86
+ "target": "norm",
87
+ "data_mapping": [
88
+ {
89
+ "source_output": "bliss_scan_uri",
90
+ "target_input": "bliss_scan_uri"
91
+ },
92
+ {
93
+ "source_output": "output_root_uri",
94
+ "target_input": "output_root_uri"
95
+ },
96
+ {
97
+ "source_output": "xrf_results_uri",
98
+ "target_input": "xrf_results_uri"
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "source": "norm",
104
+ "target": "counters",
105
+ "data_mapping": [
106
+ {
107
+ "source_output": "bliss_scan_uri",
108
+ "target_input": "bliss_scan_uri"
109
+ },
110
+ {
111
+ "source_output": "output_root_uri",
112
+ "target_input": "output_root_uri"
113
+ },
114
+ {
115
+ "source_output": "xrf_results_uri",
116
+ "target_input": "xrf_results_uri"
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "source": "counters",
122
+ "target": "regrid",
123
+ "data_mapping": [
124
+ {
125
+ "source_output": "bliss_scan_uri",
126
+ "target_input": "bliss_scan_uri"
127
+ },
128
+ {
129
+ "source_output": "output_root_uri",
130
+ "target_input": "output_root_uri"
131
+ },
132
+ {
133
+ "source_output": "xrf_results_uri",
134
+ "target_input": "xrf_results_uri"
135
+ }
136
+ ]
137
+ },
138
+ {
139
+ "source": "regrid",
140
+ "target": "select",
141
+ "data_mapping": [
142
+ {
143
+ "source_output": "bliss_scan_uri",
144
+ "target_input": "bliss_scan_uri"
145
+ },
146
+ {
147
+ "source_output": "xrf_results_uri",
148
+ "target_input": "xrf_results_uri"
149
+ }
150
+ ]
151
+ }
152
+ ]
153
+ }
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: ewokssoleildemo
3
+ Version: 1.0.0
4
+ Summary: Ewoks workflows for the SOLEIL FlyScan test bench
5
+ Author-email: ESRF <dau-pydev@esrf.fr>
6
+ License: # MIT License
7
+
8
+ **Copyright (c) 2026 European Synchrotron Radiation Facility**
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
11
+ this software and associated documentation files (the "Software"), to deal in
12
+ the Software without restriction, including without limitation the rights to
13
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14
+ the Software, and to permit persons to whom the Software is furnished to do so,
15
+ subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+
27
+ Project-URL: Homepage, https://github.com/ewoks-apps/ewokssoleildemo/
28
+ Project-URL: Documentation, https://ewokssoleildemo.readthedocs.io/
29
+ Project-URL: Repository, https://github.com/ewoks-apps/ewokssoleildemo/
30
+ Project-URL: Issues, https://github.com/ewoks-apps/ewokssoleildemo/issues
31
+ Project-URL: Changelog, https://github.com/ewoks-apps/ewokssoleildemo/blob/main/CHANGELOG.md
32
+ Keywords: ewoks
33
+ Classifier: Intended Audience :: Science/Research
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Programming Language :: Python :: 3
36
+ Requires-Python: >=3.10
37
+ Description-Content-Type: text/markdown
38
+ License-File: LICENSE.md
39
+ Requires-Dist: ewokscore
40
+ Requires-Dist: ewoksutils
41
+ Requires-Dist: ewoksfluo>=1.3
42
+ Requires-Dist: ewoksorange<6
43
+ Requires-Dist: h5py
44
+ Requires-Dist: numpy
45
+ Requires-Dist: pydantic
46
+ Requires-Dist: scipy
47
+ Provides-Extra: job
48
+ Requires-Dist: ewoksjob[redis,sql,worker]; extra == "job"
49
+ Provides-Extra: test
50
+ Requires-Dist: pytest>=7; extra == "test"
51
+ Provides-Extra: dev
52
+ Requires-Dist: ewokssoleildemo[test]; extra == "dev"
53
+ Requires-Dist: ruff; extra == "dev"
54
+ Provides-Extra: doc
55
+ Requires-Dist: ewokssoleildemo[test]; extra == "doc"
56
+ Requires-Dist: sphinx>=4.5; extra == "doc"
57
+ Requires-Dist: sphinx-autodoc-typehints>=1.16; extra == "doc"
58
+ Requires-Dist: pydata-sphinx-theme; extra == "doc"
59
+ Requires-Dist: sphinx-copybutton; extra == "doc"
60
+ Requires-Dist: ewokssphinx>=2.0; extra == "doc"
61
+ Dynamic: license-file
62
+
63
+ # ewokssoleildemo
64
+
65
+ Ewoks workflows for the SOLEIL FlyScan test bench.
66
+ They make X-ray fluorescence maps from FlyScan NeXus files.
67
+
68
+ ## Getting started
69
+
70
+ ```bash
71
+ pip install "ewokssoleildemo[job]"
72
+ ```
73
+
74
+ Then process a FlyScan file with `ewoks execute xrfmap_flyscan --workflow-module ewokssoleildemo.workflows`.
75
+ To check the inputs first, use `ewoks show` with the same options.
76
+ See the tutorial "Scenario 1: process a FlyScan file" in the documentation.
77
+
78
+ ## Documentation
79
+
80
+ https://ewokssoleildemo.readthedocs.io/
@@ -0,0 +1,17 @@
1
+ ewokssoleildemo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ ewokssoleildemo/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ ewokssoleildemo/tasks/flyscan.py,sha256=1o85laE5OFqYs457w5wU414OkqLp_0MJCO7grdrpNx4,5724
4
+ ewokssoleildemo/tasks/select_area.py,sha256=dHoLkteKysvhbOC9j4h4Etk3nqreVF9b486qjUHP4Es,3187
5
+ ewokssoleildemo/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ ewokssoleildemo/tests/test_flyscan.py,sha256=dR8ltlkJg_gRQxFydMStQwVhExmWzg46ojDJsgppwYM,1705
7
+ ewokssoleildemo/tests/test_select_area.py,sha256=ARbXaxCDWTtk77LApW0u-rr1JJUzuGWDeKnO0PVTWwg,1337
8
+ ewokssoleildemo/tests/test_workflows.py,sha256=HdVZL6rFgRjXDqC0I-M746nJYSjUA9Y4q29IWZMxCG8,621
9
+ ewokssoleildemo/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ ewokssoleildemo/workflows/xrfmap_flyscan.json,sha256=LlshxXxV-Ke8nJripbOL16zA9NDBgv4FhIfz_KpwVjY,3233
11
+ ewokssoleildemo/workflows/xrfmap_flyscan_select_area.json,sha256=2buF5f7cUaVQMfgHdC2KR8DqRow2FoVdpo4rCHCLMIY,3727
12
+ ewokssoleildemo-1.0.0.dist-info/licenses/LICENSE.md,sha256=jhnnemwVcGW_Dc_FbaaD12x2Vz9mIqjX_MtyKrjw3gQ,1102
13
+ ewokssoleildemo-1.0.0.dist-info/METADATA,sha256=j8AU2wwy_FoGMNFoarKbyx3A_aXkFj1Z511DwWHXK5E,3365
14
+ ewokssoleildemo-1.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
15
+ ewokssoleildemo-1.0.0.dist-info/entry_points.txt,sha256=3PKY8BlEGkQgASGkOOR29Y73cNEvNvzhTtgtrkD08Y4,127
16
+ ewokssoleildemo-1.0.0.dist-info/top_level.txt,sha256=n7uTu9IYB3udx0ZHAXBonlDf1KDz7IPfdXcTp9oUma0,16
17
+ ewokssoleildemo-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,5 @@
1
+ [ewoks.tasks.class]
2
+ ewokssoleildemo.tasks.* = ewokssoleildemo
3
+
4
+ [ewoks.workflows]
5
+ ewokssoleildemo.workflows.* = ewokssoleildemo
@@ -0,0 +1,20 @@
1
+ # MIT License
2
+
3
+ **Copyright (c) 2026 European Synchrotron Radiation Facility**
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ ewokssoleildemo