essreduce 25.12.1__py3-none-any.whl → 26.1.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.
- ess/reduce/time_of_flight/__init__.py +4 -0
- ess/reduce/time_of_flight/eto_to_tof.py +8 -8
- ess/reduce/time_of_flight/lut.py +5 -5
- ess/reduce/time_of_flight/types.py +9 -2
- ess/reduce/time_of_flight/workflow.py +5 -5
- {essreduce-25.12.1.dist-info → essreduce-26.1.0.dist-info}/METADATA +1 -1
- {essreduce-25.12.1.dist-info → essreduce-26.1.0.dist-info}/RECORD +11 -11
- {essreduce-25.12.1.dist-info → essreduce-26.1.0.dist-info}/WHEEL +0 -0
- {essreduce-25.12.1.dist-info → essreduce-26.1.0.dist-info}/entry_points.txt +0 -0
- {essreduce-25.12.1.dist-info → essreduce-26.1.0.dist-info}/licenses/LICENSE +0 -0
- {essreduce-25.12.1.dist-info → essreduce-26.1.0.dist-info}/top_level.txt +0 -0
|
@@ -30,6 +30,8 @@ from .types import (
|
|
|
30
30
|
TimeOfFlightLookupTableFilename,
|
|
31
31
|
ToaDetector,
|
|
32
32
|
TofDetector,
|
|
33
|
+
TofLookupTable,
|
|
34
|
+
TofLookupTableFilename,
|
|
33
35
|
TofMonitor,
|
|
34
36
|
)
|
|
35
37
|
from .workflow import GenericTofWorkflow
|
|
@@ -54,6 +56,8 @@ __all__ = [
|
|
|
54
56
|
"TimeResolution",
|
|
55
57
|
"ToaDetector",
|
|
56
58
|
"TofDetector",
|
|
59
|
+
"TofLookupTable",
|
|
60
|
+
"TofLookupTableFilename",
|
|
57
61
|
"TofLookupTableWorkflow",
|
|
58
62
|
"TofMonitor",
|
|
59
63
|
"providers",
|
|
@@ -35,9 +35,9 @@ from .types import (
|
|
|
35
35
|
DetectorLtotal,
|
|
36
36
|
MonitorLtotal,
|
|
37
37
|
PulseStrideOffset,
|
|
38
|
-
TimeOfFlightLookupTable,
|
|
39
38
|
ToaDetector,
|
|
40
39
|
TofDetector,
|
|
40
|
+
TofLookupTable,
|
|
41
41
|
TofMonitor,
|
|
42
42
|
)
|
|
43
43
|
|
|
@@ -96,7 +96,7 @@ class TofInterpolator:
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
def _time_of_flight_data_histogram(
|
|
99
|
-
da: sc.DataArray, lookup:
|
|
99
|
+
da: sc.DataArray, lookup: TofLookupTable, ltotal: sc.Variable
|
|
100
100
|
) -> sc.DataArray:
|
|
101
101
|
# In NeXus, 'time_of_flight' is the canonical name in NXmonitor, but in some files,
|
|
102
102
|
# it may be called 'tof' or 'frame_time'.
|
|
@@ -201,7 +201,7 @@ def _guess_pulse_stride_offset(
|
|
|
201
201
|
|
|
202
202
|
def _prepare_tof_interpolation_inputs(
|
|
203
203
|
da: sc.DataArray,
|
|
204
|
-
lookup:
|
|
204
|
+
lookup: TofLookupTable,
|
|
205
205
|
ltotal: sc.Variable,
|
|
206
206
|
pulse_stride_offset: int | None,
|
|
207
207
|
) -> dict:
|
|
@@ -295,7 +295,7 @@ def _prepare_tof_interpolation_inputs(
|
|
|
295
295
|
|
|
296
296
|
def _time_of_flight_data_events(
|
|
297
297
|
da: sc.DataArray,
|
|
298
|
-
lookup:
|
|
298
|
+
lookup: TofLookupTable,
|
|
299
299
|
ltotal: sc.Variable,
|
|
300
300
|
pulse_stride_offset: int | None,
|
|
301
301
|
) -> sc.DataArray:
|
|
@@ -395,7 +395,7 @@ def monitor_ltotal_from_straight_line_approximation(
|
|
|
395
395
|
|
|
396
396
|
def _compute_tof_data(
|
|
397
397
|
da: sc.DataArray,
|
|
398
|
-
lookup:
|
|
398
|
+
lookup: TofLookupTable,
|
|
399
399
|
ltotal: sc.Variable,
|
|
400
400
|
pulse_stride_offset: int,
|
|
401
401
|
) -> sc.DataArray:
|
|
@@ -413,7 +413,7 @@ def _compute_tof_data(
|
|
|
413
413
|
|
|
414
414
|
def detector_time_of_flight_data(
|
|
415
415
|
detector_data: RawDetector[RunType],
|
|
416
|
-
lookup:
|
|
416
|
+
lookup: TofLookupTable,
|
|
417
417
|
ltotal: DetectorLtotal[RunType],
|
|
418
418
|
pulse_stride_offset: PulseStrideOffset,
|
|
419
419
|
) -> TofDetector[RunType]:
|
|
@@ -447,7 +447,7 @@ def detector_time_of_flight_data(
|
|
|
447
447
|
|
|
448
448
|
def monitor_time_of_flight_data(
|
|
449
449
|
monitor_data: RawMonitor[RunType, MonitorType],
|
|
450
|
-
lookup:
|
|
450
|
+
lookup: TofLookupTable,
|
|
451
451
|
ltotal: MonitorLtotal[RunType, MonitorType],
|
|
452
452
|
pulse_stride_offset: PulseStrideOffset,
|
|
453
453
|
) -> TofMonitor[RunType, MonitorType]:
|
|
@@ -481,7 +481,7 @@ def monitor_time_of_flight_data(
|
|
|
481
481
|
|
|
482
482
|
def detector_time_of_arrival_data(
|
|
483
483
|
detector_data: RawDetector[RunType],
|
|
484
|
-
lookup:
|
|
484
|
+
lookup: TofLookupTable,
|
|
485
485
|
ltotal: DetectorLtotal[RunType],
|
|
486
486
|
pulse_stride_offset: PulseStrideOffset,
|
|
487
487
|
) -> ToaDetector[RunType]:
|
ess/reduce/time_of_flight/lut.py
CHANGED
|
@@ -13,7 +13,7 @@ import sciline as sl
|
|
|
13
13
|
import scipp as sc
|
|
14
14
|
|
|
15
15
|
from ..nexus.types import AnyRun, DiskChoppers
|
|
16
|
-
from .types import
|
|
16
|
+
from .types import TofLookupTable
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
@dataclass
|
|
@@ -230,7 +230,7 @@ def make_tof_lookup_table(
|
|
|
230
230
|
pulse_period: PulsePeriod,
|
|
231
231
|
pulse_stride: PulseStride,
|
|
232
232
|
error_threshold: LookupTableRelativeErrorThreshold,
|
|
233
|
-
) ->
|
|
233
|
+
) -> TofLookupTable:
|
|
234
234
|
"""
|
|
235
235
|
Compute a lookup table for time-of-flight as a function of distance and
|
|
236
236
|
time-of-arrival.
|
|
@@ -372,7 +372,7 @@ def make_tof_lookup_table(
|
|
|
372
372
|
# In-place masking for better performance
|
|
373
373
|
_mask_large_uncertainty(table, error_threshold)
|
|
374
374
|
|
|
375
|
-
return
|
|
375
|
+
return TofLookupTable(
|
|
376
376
|
array=table,
|
|
377
377
|
pulse_period=pulse_period,
|
|
378
378
|
pulse_stride=pulse_stride,
|
|
@@ -398,13 +398,13 @@ def simulate_chopper_cascade_using_tof(
|
|
|
398
398
|
) -> SimulationResults:
|
|
399
399
|
"""
|
|
400
400
|
Simulate a pulse of neutrons propagating through a chopper cascade using the
|
|
401
|
-
``tof`` package (https://
|
|
401
|
+
``tof`` package (https://scipp.github.io/tof).
|
|
402
402
|
|
|
403
403
|
Parameters
|
|
404
404
|
----------
|
|
405
405
|
choppers:
|
|
406
406
|
A dict of DiskChopper objects representing the choppers in the beamline. See
|
|
407
|
-
https://scipp.github.io/scippneutron/user-guide/chopper/processing-nexus-choppers.html
|
|
407
|
+
https://scipp.github.io/scippneutron/user-guide/chopper/processing-nexus-choppers.html
|
|
408
408
|
for more information.
|
|
409
409
|
source_position:
|
|
410
410
|
A scalar variable with ``dtype=vector3`` that defines the source position.
|
|
@@ -10,12 +10,15 @@ import scipp as sc
|
|
|
10
10
|
|
|
11
11
|
from ..nexus.types import MonitorType, RunType
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
TofLookupTableFilename = NewType("TofLookupTableFilename", str)
|
|
14
14
|
"""Filename of the time-of-flight lookup table."""
|
|
15
15
|
|
|
16
|
+
TimeOfFlightLookupTableFilename = TofLookupTableFilename
|
|
17
|
+
"""Filename of the time-of-flight lookup table (alias)."""
|
|
18
|
+
|
|
16
19
|
|
|
17
20
|
@dataclass
|
|
18
|
-
class
|
|
21
|
+
class TofLookupTable:
|
|
19
22
|
"""
|
|
20
23
|
Lookup table giving time-of-flight as a function of distance and time of arrival.
|
|
21
24
|
"""
|
|
@@ -47,6 +50,10 @@ class TimeOfFlightLookupTable:
|
|
|
47
50
|
return self.array.plot(*args, **kwargs)
|
|
48
51
|
|
|
49
52
|
|
|
53
|
+
TimeOfFlightLookupTable = TofLookupTable
|
|
54
|
+
"""Lookup table giving time-of-flight as a function of distance and time of arrival
|
|
55
|
+
(alias)."""
|
|
56
|
+
|
|
50
57
|
PulseStrideOffset = NewType("PulseStrideOffset", int | None)
|
|
51
58
|
"""
|
|
52
59
|
When pulse-skipping, the offset of the first pulse in the stride. This is typically
|
|
@@ -9,14 +9,14 @@ from ..nexus import GenericNeXusWorkflow
|
|
|
9
9
|
from . import eto_to_tof
|
|
10
10
|
from .types import (
|
|
11
11
|
PulseStrideOffset,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
TofLookupTable,
|
|
13
|
+
TofLookupTableFilename,
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def load_tof_lookup_table(
|
|
18
|
-
filename:
|
|
19
|
-
) ->
|
|
18
|
+
filename: TofLookupTableFilename,
|
|
19
|
+
) -> TofLookupTable:
|
|
20
20
|
"""Load a time-of-flight lookup table from an HDF5 file."""
|
|
21
21
|
table = sc.io.load_hdf5(filename)
|
|
22
22
|
|
|
@@ -40,7 +40,7 @@ def load_tof_lookup_table(
|
|
|
40
40
|
"error_threshold": table.coords["error_threshold"].value,
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
return
|
|
43
|
+
return TofLookupTable(**table)
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
def GenericTofWorkflow(
|
|
@@ -20,15 +20,15 @@ ess/reduce/nexus/json_nexus.py,sha256=QrVc0p424nZ5dHX9gebAJppTw6lGZq9404P_OFl1gi
|
|
|
20
20
|
ess/reduce/nexus/types.py,sha256=g5oBBEYPH7urF1tDP0tqXtixhQN8JDpe8vmiKrPiUW0,9320
|
|
21
21
|
ess/reduce/nexus/workflow.py,sha256=bVRnVZ6HTEdIFwZv61JuvFUeTt9efUwe1MR65gBhyw8,24995
|
|
22
22
|
ess/reduce/scripts/grow_nexus.py,sha256=hET3h06M0xlJd62E3palNLFvJMyNax2kK4XyJcOhl-I,3387
|
|
23
|
-
ess/reduce/time_of_flight/__init__.py,sha256=
|
|
24
|
-
ess/reduce/time_of_flight/eto_to_tof.py,sha256=
|
|
23
|
+
ess/reduce/time_of_flight/__init__.py,sha256=bNxhK0uePltQpCW2sdNTpPdzXL6dt1IT1ri_cJ5VTL8,1561
|
|
24
|
+
ess/reduce/time_of_flight/eto_to_tof.py,sha256=imKuN7IARMqBjmi8kjAcsseTFg6OD8ORas9X1FolgFY,18777
|
|
25
25
|
ess/reduce/time_of_flight/fakes.py,sha256=BqpO56PQyO9ua7QlZw6xXMAPBrqjKZEM_jc-VB83CyE,4289
|
|
26
26
|
ess/reduce/time_of_flight/interpolator_numba.py,sha256=wh2YS3j2rOu30v1Ok3xNHcwS7t8eEtZyZvbfXOCtgrQ,3835
|
|
27
27
|
ess/reduce/time_of_flight/interpolator_scipy.py,sha256=_InoAPuMm2qhJKZQBAHOGRFqtvvuQ8TStoN7j_YgS4M,1853
|
|
28
|
-
ess/reduce/time_of_flight/lut.py,sha256=
|
|
28
|
+
ess/reduce/time_of_flight/lut.py,sha256=8AupwtfB2983DoyzFgnRjWP3J3s_oPghi3XlXaaxxow,18768
|
|
29
29
|
ess/reduce/time_of_flight/resample.py,sha256=Opmi-JA4zNH725l9VB99U4O9UlM37f5ACTCGtwBcows,3718
|
|
30
|
-
ess/reduce/time_of_flight/types.py,sha256=
|
|
31
|
-
ess/reduce/time_of_flight/workflow.py,sha256=
|
|
30
|
+
ess/reduce/time_of_flight/types.py,sha256=FsSueM6OjJdF80uJHj-TNuyVAci8ixFvMuRMt9oHKDQ,3310
|
|
31
|
+
ess/reduce/time_of_flight/workflow.py,sha256=2jUxeSmP0KweQTctAzIFJLm7Odf_e7kZzAc8MAMKBEs,3084
|
|
32
32
|
ess/reduce/widgets/__init__.py,sha256=SoSHBv8Dc3QXV9HUvPhjSYWMwKTGYZLpsWwsShIO97Q,5325
|
|
33
33
|
ess/reduce/widgets/_base.py,sha256=_wN3FOlXgx_u0c-A_3yyoIH-SdUvDENGgquh9S-h5GI,4852
|
|
34
34
|
ess/reduce/widgets/_binedges_widget.py,sha256=ZCQsGjYHnJr9GFUn7NjoZc1CdsnAzm_fMzyF-fTKKVY,2785
|
|
@@ -41,9 +41,9 @@ ess/reduce/widgets/_spinner.py,sha256=2VY4Fhfa7HMXox2O7UbofcdKsYG-AJGrsgGJB85nDX
|
|
|
41
41
|
ess/reduce/widgets/_string_widget.py,sha256=iPAdfANyXHf-nkfhgkyH6gQDklia0LebLTmwi3m-iYQ,1482
|
|
42
42
|
ess/reduce/widgets/_switchable_widget.py,sha256=fjKz99SKLhIF1BLgGVBSKKn3Lu_jYBwDYGeAjbJY3Q8,2390
|
|
43
43
|
ess/reduce/widgets/_vector_widget.py,sha256=aTaBqCFHZQhrIoX6-sSqFWCPePEW8HQt5kUio8jP1t8,1203
|
|
44
|
-
essreduce-
|
|
45
|
-
essreduce-
|
|
46
|
-
essreduce-
|
|
47
|
-
essreduce-
|
|
48
|
-
essreduce-
|
|
49
|
-
essreduce-
|
|
44
|
+
essreduce-26.1.0.dist-info/licenses/LICENSE,sha256=nVEiume4Qj6jMYfSRjHTM2jtJ4FGu0g-5Sdh7osfEYw,1553
|
|
45
|
+
essreduce-26.1.0.dist-info/METADATA,sha256=WTZ9G8OVIHDjHsgeW9zgv-XJBv6mzYc5HAlxBY-5uXQ,1987
|
|
46
|
+
essreduce-26.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
essreduce-26.1.0.dist-info/entry_points.txt,sha256=PMZOIYzCifHMTe4pK3HbhxUwxjFaZizYlLD0td4Isb0,66
|
|
48
|
+
essreduce-26.1.0.dist-info/top_level.txt,sha256=0JxTCgMKPLKtp14wb1-RKisQPQWX7i96innZNvHBr-s,4
|
|
49
|
+
essreduce-26.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|