From ad09275de119aef90d5b20ee5c26ef53b34b2254 Mon Sep 17 00:00:00 2001 From: Simon Heybrock Date: Tue, 9 Jun 2026 09:19:18 +0000 Subject: [PATCH 1/2] Project chopper axle onto incident beam for flight distance The chopper-cascade LUT derived each chopper's flight distance from `norm(axle_position - source_position)`. A disk chopper's axle sits above or below the beam by design, so that straight-line distance overestimates the beam-path length. For closely-spaced choppers a large transverse axle offset can even reorder the cascade: e.g. DREAM's pulse-shaping choppers PSC1 (axle 0.7 m off-beam, 6.145 m downstream) and PSC2 (on-beam, 6.155 m) swap order under the norm (6.185 m vs 6.155 m), so PSC1 is applied last or, over a narrow distance range, never at all. Compute the distance as the projection of the axle position onto the incident-beam direction (source to sample) instead. This matches the straight-line `Ltotal` used for detectors and monitors, where the component lies on the beam and the projection reduces to the norm, so on-axis choppers are unaffected. This adds `sample_position` as an input to `compute_frame_sequence` and `simulate_chopper_cascade_using_tof`; workflows built from NeXus already provide it. Co-Authored-By: Claude Opus 4.8 --- .../essreduce/src/ess/reduce/unwrap/fakes.py | 4 ++ .../essreduce/src/ess/reduce/unwrap/lut.py | 51 ++++++++++++++++-- packages/essreduce/tests/unwrap/lut_test.py | 53 ++++++++++++++++++- .../essreduce/tests/unwrap/unwrap_test.py | 4 +- packages/essreduce/tests/unwrap/wfm_test.py | 10 +++- .../essreduce/tests/unwrap/workflow_test.py | 1 + 6 files changed, 116 insertions(+), 7 deletions(-) diff --git a/packages/essreduce/src/ess/reduce/unwrap/fakes.py b/packages/essreduce/src/ess/reduce/unwrap/fakes.py index 117a686dc..9a02d49ec 100644 --- a/packages/essreduce/src/ess/reduce/unwrap/fakes.py +++ b/packages/essreduce/src/ess/reduce/unwrap/fakes.py @@ -117,3 +117,7 @@ def pulse_skipping_choppers(): def source_position(): return sc.vector([0, 0, 0], unit='m') + + +def sample_position(): + return sc.vector([0, 0, 77], unit='m') diff --git a/packages/essreduce/src/ess/reduce/unwrap/lut.py b/packages/essreduce/src/ess/reduce/unwrap/lut.py index 64aa15d02..281b60abf 100644 --- a/packages/essreduce/src/ess/reduce/unwrap/lut.py +++ b/packages/essreduce/src/ess/reduce/unwrap/lut.py @@ -429,9 +429,44 @@ def _to_component_reading(component) -> BeamlineComponentReading: ) +def chopper_distance_along_beam( + axle_position: sc.Variable, + source_position: sc.Variable, + sample_position: sc.Variable, +) -> sc.Variable: + """Flight distance from the source to a chopper along the incident beam. + + A disk chopper's axle is offset from the beam (the disk sits above or below + it), so the straight-line distance ``norm(axle_position - source_position)`` + overestimates the flight distance, and for closely-spaced choppers can even + place them in the wrong order along the cascade. The neutron crosses the disk + where the incident beam (source to sample) intersects it, so the flight + distance is the projection of the axle position onto the incident-beam + direction. This matches the straight-line ``Ltotal`` used for detectors and + monitors, where the component lies on the beam and the projection reduces to + the norm. + + Parameters + ---------- + axle_position: + Position of the chopper's rotation axle. + source_position: + Position of the neutron source. + sample_position: + Position of the sample, defining the incident-beam direction together + with the source. + """ + source_position = source_position.to(unit=axle_position.unit) + incident_beam = sample_position.to(unit=axle_position.unit) - source_position + return sc.dot( + axle_position - source_position, incident_beam / sc.norm(incident_beam) + ) + + def simulate_chopper_cascade_using_tof( choppers: DiskChoppers[RunType], source_position: Position[snx.NXsource, RunType], + sample_position: Position[snx.NXsample, RunType], neutrons: NumberOfSimulatedNeutrons, pulse_stride: PulseStride[RunType], seed: SimulationSeed, @@ -452,6 +487,10 @@ def simulate_chopper_cascade_using_tof( source_position: A scalar variable with ``dtype=vector3`` that defines the source position. Must be in the same coordinate system as the choppers' axle positions. + sample_position: + A scalar variable with ``dtype=vector3`` that defines the sample position. + Together with the source it defines the incident-beam direction onto which + chopper axle positions are projected to obtain their flight distance. neutrons: Number of neutrons to simulate. pulse_stride: @@ -471,8 +510,8 @@ def simulate_chopper_cascade_using_tof( tof_choppers = [] for name, ch in choppers.items(): chop = tof.Chopper.from_diskchopper(ch, name=name) - chop.distance = sc.norm( - ch.axle_position - source_position.to(unit=ch.axle_position.unit) + chop.distance = chopper_distance_along_beam( + ch.axle_position, source_position, sample_position ) tof_choppers.append(chop) @@ -618,6 +657,7 @@ def compute_frame_sequence( pulse_period: PulsePeriod, disk_choppers: DiskChoppers[RunType], source_position: Position[snx.NXsource, RunType], + sample_position: Position[snx.NXsample, RunType], source_bounds: SourceBounds, pulse_stride: PulseStride[RunType], ) -> ChopperFrameSequence[RunType]: @@ -633,6 +673,9 @@ def compute_frame_sequence( Disk chopper parameters. source_position: Position of the neutron source. + sample_position: + Position of the sample, defining the incident-beam direction onto which + chopper axle positions are projected to obtain their flight distance. source_bounds: Time and wavelength range of the source pulse. pulse_stride: @@ -657,8 +700,8 @@ def compute_frame_sequence( chops = { key: chopper_cascade.Chopper( - distance=sc.norm( - ch.axle_position - source_position.to(unit=ch.axle_position.unit) + distance=chopper_distance_along_beam( + ch.axle_position, source_position, sample_position ), time_open=ch.time_offset_open( pulse_frequency=frequency_for_chopper_rotation diff --git a/packages/essreduce/tests/unwrap/lut_test.py b/packages/essreduce/tests/unwrap/lut_test.py index 6c87c55d8..ab0030e2a 100644 --- a/packages/essreduce/tests/unwrap/lut_test.py +++ b/packages/essreduce/tests/unwrap/lut_test.py @@ -8,16 +8,21 @@ from ess.reduce import unwrap from ess.reduce.nexus.types import AnyRun, FrameMonitor0, Position from ess.reduce.unwrap import GenericUnwrapWorkflow, LookupTableWorkflow, SourceBounds +from ess.reduce.unwrap.lut import chopper_distance_along_beam sl = pytest.importorskip("sciline") def _make_workflow(wavelength_from: str = "analytical") -> sl.Pipeline: - return GenericUnwrapWorkflow( + wf = GenericUnwrapWorkflow( run_types=[AnyRun], monitor_types=[FrameMonitor0], wavelength_from=wavelength_from, ) + # Choppers sit on the beam axis (+z); the sample only fixes the incident-beam + # direction onto which chopper axle positions are projected. + wf[Position[snx.NXsample, AnyRun]] = sc.vector([0, 0, 77], unit='m') + return wf @pytest.mark.parametrize("detector_or_monitor", ["detector", "monitor"]) @@ -167,6 +172,51 @@ def _make_choppers(): } +def _single_slit_chopper(axle_position: sc.Variable) -> DiskChopper: + return DiskChopper( + frequency=sc.scalar(-14.0, unit='Hz'), + beam_position=sc.scalar(0.0, unit='deg'), + phase=sc.scalar(0.0, unit='deg'), + axle_position=axle_position, + slit_begin=sc.array(dims=['cutout'], values=[0.0], unit='deg'), + slit_end=sc.array(dims=['cutout'], values=[10.0], unit='deg'), + slit_height=sc.scalar(10.0, unit='cm'), + radius=sc.scalar(30.0, unit='cm'), + ) + + +def test_chopper_distance_along_beam_projects_offset_axle_onto_beam(): + source = sc.vector([0, 0, 0], unit='m') + sample = sc.vector([0, 0, 30], unit='m') + # Axle sits 3 m above the beam and 10 m downstream of the source. + axle = sc.vector([0, 3, 10], unit='m') + distance = chopper_distance_along_beam(axle, source, sample) + assert sc.isclose(distance, sc.scalar(10.0, unit='m')) + # The straight-line distance to the offset axle would overestimate this. + assert sc.norm(axle - source) > sc.scalar(10.0, unit='m') + + +def test_chopper_cascade_orders_offset_axle_by_beam_projection(): + # Two closely-spaced choppers; the upstream one's axle is offset far enough + # from the beam that ``norm(axle - source)`` (6.185 m) exceeds the downstream + # chopper's distance (6.155 m). Ordering must follow the beam-projected + # distance, otherwise the upstream chopper is wrongly applied last (or, for a + # narrow distance range, never at all). + wf = _make_workflow("analytical") + wf[Position[snx.NXsource, AnyRun]] = sc.vector([0, 0, 0], unit='m') + wf[Position[snx.NXsample, AnyRun]] = sc.vector([0, 0, 30], unit='m') + wf[unwrap.PulseStride[AnyRun]] = 1 + wf[unwrap.DiskChoppers[AnyRun]] = { + 'near': _single_slit_chopper(sc.vector([0, 0.7, 6.145], unit='m')), + 'far': _single_slit_chopper(sc.vector([0, 0, 6.155], unit='m')), + } + + frames = wf.compute(unwrap.ChopperFrameSequence[AnyRun]) + + distances = sorted(f.distance.to(unit='m').value for f in frames) + assert distances == pytest.approx([0.0, 6.145, 6.155]) + + @pytest.mark.parametrize("detector_or_monitor", ["detector", "monitor"]) @pytest.mark.parametrize("wavelength_from", ["analytical", "simulation"]) def test_lut_workflow_computes_table_with_choppers( @@ -290,6 +340,7 @@ def test_lut_workflow_computes_table_using_alias(detector_or_monitor, wavelength wf = LookupTableWorkflow(use_simulation=(wavelength_from == "simulation")) wf[unwrap.DiskChoppers[AnyRun]] = {} wf[Position[snx.NXsource, AnyRun]] = sc.vector([0, 0, 0], unit='m') + wf[Position[snx.NXsample, AnyRun]] = sc.vector([0, 0, 77], unit='m') wf[unwrap.PulseStride[AnyRun]] = 1 if wavelength_from == "simulation": diff --git a/packages/essreduce/tests/unwrap/unwrap_test.py b/packages/essreduce/tests/unwrap/unwrap_test.py index cde50ca11..31c491a72 100644 --- a/packages/essreduce/tests/unwrap/unwrap_test.py +++ b/packages/essreduce/tests/unwrap/unwrap_test.py @@ -4,7 +4,7 @@ import pytest import scipp as sc from scippneutron.chopper import DiskChopper -from scippnexus import NXsource +from scippnexus import NXsample, NXsource from ess.reduce import unwrap from ess.reduce.nexus.types import ( @@ -29,6 +29,7 @@ def simulate_with_tof(choppers, pulse_stride, neutrons=None, seed=None): return simulate_chopper_cascade_using_tof( choppers=choppers, source_position=fakes.source_position(), + sample_position=fakes.sample_position(), neutrons=neutrons, pulse_stride=pulse_stride, seed=seed, @@ -72,6 +73,7 @@ def _initialize_workflow(wavelength_from, distance, error_threshold, choppers): } wf[unwrap.DiskChoppers[SampleRun]] = choppers wf[Position[NXsource, SampleRun]] = fakes.source_position() + wf[Position[NXsample, SampleRun]] = fakes.sample_position() return wf diff --git a/packages/essreduce/tests/unwrap/wfm_test.py b/packages/essreduce/tests/unwrap/wfm_test.py index d0d4e8344..25ab878d6 100644 --- a/packages/essreduce/tests/unwrap/wfm_test.py +++ b/packages/essreduce/tests/unwrap/wfm_test.py @@ -5,7 +5,7 @@ import pytest import scipp as sc from scippneutron.chopper import DiskChopper -from scippnexus import NXsource +from scippnexus import NXsample, NXsource from ess.reduce import unwrap from ess.reduce.nexus.types import NeXusDetectorName, Position, RawDetector, SampleRun @@ -112,10 +112,17 @@ def dream_source_position() -> sc.Variable: return sc.vector(value=[0, 0, -76.55], unit="m") +def _downstream_sample(source_position: sc.Variable) -> sc.Variable: + # Choppers sit on the beam axis (+z); the sample only fixes the incident-beam + # direction onto which chopper axle positions are projected. + return source_position + sc.vector([0, 0, 100], unit=source_position.unit) + + def simulate_with_tof(choppers, pulse_stride, source_position): return simulate_chopper_cascade_using_tof( choppers=choppers, source_position=source_position, + sample_position=_downstream_sample(source_position), neutrons=300_000, pulse_stride=pulse_stride, seed=432, @@ -151,6 +158,7 @@ def setup_workflow( wf[unwrap.LookupTableRelativeErrorThreshold] = {"detector": error_threshold} wf[unwrap.DiskChoppers[SampleRun]] = choppers wf[Position[NXsource, SampleRun]] = source_position + wf[Position[NXsample, SampleRun]] = _downstream_sample(source_position) return wf diff --git a/packages/essreduce/tests/unwrap/workflow_test.py b/packages/essreduce/tests/unwrap/workflow_test.py index b658c4a24..3b9802632 100644 --- a/packages/essreduce/tests/unwrap/workflow_test.py +++ b/packages/essreduce/tests/unwrap/workflow_test.py @@ -103,6 +103,7 @@ def simulation_results_psc_choppers(): return simulate_chopper_cascade_using_tof( choppers=fakes.psc_choppers(), source_position=fakes.source_position(), + sample_position=fakes.sample_position(), neutrons=1e6, pulse_stride=1, seed=333, From d3790b4b2f7699abc01b4d1f7ecd3dd024db2c95 Mon Sep 17 00:00:00 2001 From: Simon Heybrock Date: Wed, 10 Jun 2026 08:52:19 +0000 Subject: [PATCH 2/2] Use z-component for chopper flight distance projection Project the chopper axle onto the incident beam by taking the z-component of the offset from the source, assuming the beam runs along z. This keeps the correct cascade ordering for off-beam axles without requiring a sample position as workflow input. Co-Authored-By: Claude Opus 4.8 --- .../essreduce/src/ess/reduce/unwrap/fakes.py | 4 -- .../essreduce/src/ess/reduce/unwrap/lut.py | 45 ++++++------------- packages/essreduce/tests/unwrap/lut_test.py | 11 +---- .../essreduce/tests/unwrap/unwrap_test.py | 4 +- packages/essreduce/tests/unwrap/wfm_test.py | 10 +---- .../essreduce/tests/unwrap/workflow_test.py | 1 - 6 files changed, 17 insertions(+), 58 deletions(-) diff --git a/packages/essreduce/src/ess/reduce/unwrap/fakes.py b/packages/essreduce/src/ess/reduce/unwrap/fakes.py index 9a02d49ec..117a686dc 100644 --- a/packages/essreduce/src/ess/reduce/unwrap/fakes.py +++ b/packages/essreduce/src/ess/reduce/unwrap/fakes.py @@ -117,7 +117,3 @@ def pulse_skipping_choppers(): def source_position(): return sc.vector([0, 0, 0], unit='m') - - -def sample_position(): - return sc.vector([0, 0, 77], unit='m') diff --git a/packages/essreduce/src/ess/reduce/unwrap/lut.py b/packages/essreduce/src/ess/reduce/unwrap/lut.py index 281b60abf..ce42d94f7 100644 --- a/packages/essreduce/src/ess/reduce/unwrap/lut.py +++ b/packages/essreduce/src/ess/reduce/unwrap/lut.py @@ -432,19 +432,19 @@ def _to_component_reading(component) -> BeamlineComponentReading: def chopper_distance_along_beam( axle_position: sc.Variable, source_position: sc.Variable, - sample_position: sc.Variable, ) -> sc.Variable: """Flight distance from the source to a chopper along the incident beam. - A disk chopper's axle is offset from the beam (the disk sits above or below - it), so the straight-line distance ``norm(axle_position - source_position)`` - overestimates the flight distance, and for closely-spaced choppers can even - place them in the wrong order along the cascade. The neutron crosses the disk - where the incident beam (source to sample) intersects it, so the flight - distance is the projection of the axle position onto the incident-beam - direction. This matches the straight-line ``Ltotal`` used for detectors and - monitors, where the component lies on the beam and the projection reduces to - the norm. + A disk chopper's axle is offset from the beam (the disk sits above, below, or + to the side of it), so the straight-line distance + ``norm(axle_position - source_position)`` overestimates the flight distance, + and for closely-spaced choppers can even place them in the wrong order along + the cascade. The neutron crosses the disk where the incident beam intersects + it, so the flight distance is the projection of the axle position onto the + incident-beam direction. Assuming the incident beam runs along the z axis, + this is the z-component of the offset from the source. This matches the + straight-line ``Ltotal`` used for detectors and monitors, where the component + lies on the beam and the projection reduces to the norm. Parameters ---------- @@ -452,21 +452,14 @@ def chopper_distance_along_beam( Position of the chopper's rotation axle. source_position: Position of the neutron source. - sample_position: - Position of the sample, defining the incident-beam direction together - with the source. """ source_position = source_position.to(unit=axle_position.unit) - incident_beam = sample_position.to(unit=axle_position.unit) - source_position - return sc.dot( - axle_position - source_position, incident_beam / sc.norm(incident_beam) - ) + return (axle_position - source_position).fields.z def simulate_chopper_cascade_using_tof( choppers: DiskChoppers[RunType], source_position: Position[snx.NXsource, RunType], - sample_position: Position[snx.NXsample, RunType], neutrons: NumberOfSimulatedNeutrons, pulse_stride: PulseStride[RunType], seed: SimulationSeed, @@ -487,10 +480,6 @@ def simulate_chopper_cascade_using_tof( source_position: A scalar variable with ``dtype=vector3`` that defines the source position. Must be in the same coordinate system as the choppers' axle positions. - sample_position: - A scalar variable with ``dtype=vector3`` that defines the sample position. - Together with the source it defines the incident-beam direction onto which - chopper axle positions are projected to obtain their flight distance. neutrons: Number of neutrons to simulate. pulse_stride: @@ -510,9 +499,7 @@ def simulate_chopper_cascade_using_tof( tof_choppers = [] for name, ch in choppers.items(): chop = tof.Chopper.from_diskchopper(ch, name=name) - chop.distance = chopper_distance_along_beam( - ch.axle_position, source_position, sample_position - ) + chop.distance = chopper_distance_along_beam(ch.axle_position, source_position) tof_choppers.append(chop) source = tof.Source( @@ -657,7 +644,6 @@ def compute_frame_sequence( pulse_period: PulsePeriod, disk_choppers: DiskChoppers[RunType], source_position: Position[snx.NXsource, RunType], - sample_position: Position[snx.NXsample, RunType], source_bounds: SourceBounds, pulse_stride: PulseStride[RunType], ) -> ChopperFrameSequence[RunType]: @@ -673,9 +659,6 @@ def compute_frame_sequence( Disk chopper parameters. source_position: Position of the neutron source. - sample_position: - Position of the sample, defining the incident-beam direction onto which - chopper axle positions are projected to obtain their flight distance. source_bounds: Time and wavelength range of the source pulse. pulse_stride: @@ -700,9 +683,7 @@ def compute_frame_sequence( chops = { key: chopper_cascade.Chopper( - distance=chopper_distance_along_beam( - ch.axle_position, source_position, sample_position - ), + distance=chopper_distance_along_beam(ch.axle_position, source_position), time_open=ch.time_offset_open( pulse_frequency=frequency_for_chopper_rotation ), diff --git a/packages/essreduce/tests/unwrap/lut_test.py b/packages/essreduce/tests/unwrap/lut_test.py index ab0030e2a..323c45974 100644 --- a/packages/essreduce/tests/unwrap/lut_test.py +++ b/packages/essreduce/tests/unwrap/lut_test.py @@ -14,15 +14,11 @@ def _make_workflow(wavelength_from: str = "analytical") -> sl.Pipeline: - wf = GenericUnwrapWorkflow( + return GenericUnwrapWorkflow( run_types=[AnyRun], monitor_types=[FrameMonitor0], wavelength_from=wavelength_from, ) - # Choppers sit on the beam axis (+z); the sample only fixes the incident-beam - # direction onto which chopper axle positions are projected. - wf[Position[snx.NXsample, AnyRun]] = sc.vector([0, 0, 77], unit='m') - return wf @pytest.mark.parametrize("detector_or_monitor", ["detector", "monitor"]) @@ -187,10 +183,9 @@ def _single_slit_chopper(axle_position: sc.Variable) -> DiskChopper: def test_chopper_distance_along_beam_projects_offset_axle_onto_beam(): source = sc.vector([0, 0, 0], unit='m') - sample = sc.vector([0, 0, 30], unit='m') # Axle sits 3 m above the beam and 10 m downstream of the source. axle = sc.vector([0, 3, 10], unit='m') - distance = chopper_distance_along_beam(axle, source, sample) + distance = chopper_distance_along_beam(axle, source) assert sc.isclose(distance, sc.scalar(10.0, unit='m')) # The straight-line distance to the offset axle would overestimate this. assert sc.norm(axle - source) > sc.scalar(10.0, unit='m') @@ -204,7 +199,6 @@ def test_chopper_cascade_orders_offset_axle_by_beam_projection(): # narrow distance range, never at all). wf = _make_workflow("analytical") wf[Position[snx.NXsource, AnyRun]] = sc.vector([0, 0, 0], unit='m') - wf[Position[snx.NXsample, AnyRun]] = sc.vector([0, 0, 30], unit='m') wf[unwrap.PulseStride[AnyRun]] = 1 wf[unwrap.DiskChoppers[AnyRun]] = { 'near': _single_slit_chopper(sc.vector([0, 0.7, 6.145], unit='m')), @@ -340,7 +334,6 @@ def test_lut_workflow_computes_table_using_alias(detector_or_monitor, wavelength wf = LookupTableWorkflow(use_simulation=(wavelength_from == "simulation")) wf[unwrap.DiskChoppers[AnyRun]] = {} wf[Position[snx.NXsource, AnyRun]] = sc.vector([0, 0, 0], unit='m') - wf[Position[snx.NXsample, AnyRun]] = sc.vector([0, 0, 77], unit='m') wf[unwrap.PulseStride[AnyRun]] = 1 if wavelength_from == "simulation": diff --git a/packages/essreduce/tests/unwrap/unwrap_test.py b/packages/essreduce/tests/unwrap/unwrap_test.py index 31c491a72..cde50ca11 100644 --- a/packages/essreduce/tests/unwrap/unwrap_test.py +++ b/packages/essreduce/tests/unwrap/unwrap_test.py @@ -4,7 +4,7 @@ import pytest import scipp as sc from scippneutron.chopper import DiskChopper -from scippnexus import NXsample, NXsource +from scippnexus import NXsource from ess.reduce import unwrap from ess.reduce.nexus.types import ( @@ -29,7 +29,6 @@ def simulate_with_tof(choppers, pulse_stride, neutrons=None, seed=None): return simulate_chopper_cascade_using_tof( choppers=choppers, source_position=fakes.source_position(), - sample_position=fakes.sample_position(), neutrons=neutrons, pulse_stride=pulse_stride, seed=seed, @@ -73,7 +72,6 @@ def _initialize_workflow(wavelength_from, distance, error_threshold, choppers): } wf[unwrap.DiskChoppers[SampleRun]] = choppers wf[Position[NXsource, SampleRun]] = fakes.source_position() - wf[Position[NXsample, SampleRun]] = fakes.sample_position() return wf diff --git a/packages/essreduce/tests/unwrap/wfm_test.py b/packages/essreduce/tests/unwrap/wfm_test.py index 25ab878d6..d0d4e8344 100644 --- a/packages/essreduce/tests/unwrap/wfm_test.py +++ b/packages/essreduce/tests/unwrap/wfm_test.py @@ -5,7 +5,7 @@ import pytest import scipp as sc from scippneutron.chopper import DiskChopper -from scippnexus import NXsample, NXsource +from scippnexus import NXsource from ess.reduce import unwrap from ess.reduce.nexus.types import NeXusDetectorName, Position, RawDetector, SampleRun @@ -112,17 +112,10 @@ def dream_source_position() -> sc.Variable: return sc.vector(value=[0, 0, -76.55], unit="m") -def _downstream_sample(source_position: sc.Variable) -> sc.Variable: - # Choppers sit on the beam axis (+z); the sample only fixes the incident-beam - # direction onto which chopper axle positions are projected. - return source_position + sc.vector([0, 0, 100], unit=source_position.unit) - - def simulate_with_tof(choppers, pulse_stride, source_position): return simulate_chopper_cascade_using_tof( choppers=choppers, source_position=source_position, - sample_position=_downstream_sample(source_position), neutrons=300_000, pulse_stride=pulse_stride, seed=432, @@ -158,7 +151,6 @@ def setup_workflow( wf[unwrap.LookupTableRelativeErrorThreshold] = {"detector": error_threshold} wf[unwrap.DiskChoppers[SampleRun]] = choppers wf[Position[NXsource, SampleRun]] = source_position - wf[Position[NXsample, SampleRun]] = _downstream_sample(source_position) return wf diff --git a/packages/essreduce/tests/unwrap/workflow_test.py b/packages/essreduce/tests/unwrap/workflow_test.py index 3b9802632..b658c4a24 100644 --- a/packages/essreduce/tests/unwrap/workflow_test.py +++ b/packages/essreduce/tests/unwrap/workflow_test.py @@ -103,7 +103,6 @@ def simulation_results_psc_choppers(): return simulate_chopper_cascade_using_tof( choppers=fakes.psc_choppers(), source_position=fakes.source_position(), - sample_position=fakes.sample_position(), neutrons=1e6, pulse_stride=1, seed=333,