diff --git a/src/ess/reduce/nexus/generic_types.py b/src/ess/reduce/nexus/generic_types.py index e35275f5..8dcab03e 100644 --- a/src/ess/reduce/nexus/generic_types.py +++ b/src/ess/reduce/nexus/generic_types.py @@ -23,11 +23,14 @@ """ SampleRun = NewType('SampleRun', int) """Sample run.""" +VanadiumRun = NewType('VanadiumRun', int) +"""Vanadium run.""" ScatteringRunType = TypeVar( 'ScatteringRunType', - SampleRun, BackgroundRun, + SampleRun, + VanadiumRun, ) @@ -48,6 +51,7 @@ class TransmissionRun(Generic[ScatteringRunType]): # Note that mypy does not seem to like this nesting, may need to find a workaround TransmissionRun[SampleRun], TransmissionRun[BackgroundRun], + VanadiumRun, ) """TypeVar used for specifying BackgroundRun, EmptyBeamRun or SampleRun""" diff --git a/src/ess/reduce/nexus/workflow.py b/src/ess/reduce/nexus/workflow.py index 8cca2660..92f39261 100644 --- a/src/ess/reduce/nexus/workflow.py +++ b/src/ess/reduce/nexus/workflow.py @@ -334,7 +334,7 @@ def get_calibrated_detector( # the detector array from the raw loader NeXus group, to prevent a source of bugs. return AnyRunCalibratedDetector( da.assign_coords( - position=da.coords['position'] + offset, + position=da.coords['position'] + offset.to(unit=da.coords['position'].unit), source_position=source_position, sample_position=sample_position, gravity=gravity, @@ -389,7 +389,7 @@ def get_calibrated_monitor( """ return AnyRunAnyCalibratedMonitor( nexus.extract_monitor_data(monitor).assign_coords( - position=monitor['position'] + offset, + position=monitor['position'] + offset.to(unit=monitor['position'].unit), source_position=source_position, ) )