Skip to content

Commit 6b4d262

Browse files
authored
Merge pull request #148 from scipp/monitor-norm-nansum
Mask zero values in the monitor
2 parents 55b858d + ee7ec6d commit 6b4d262

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ess/powder/conversion.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Coordinate transformations for powder diffraction.
55
"""
66

7-
import numpy as np
87
import sciline as sl
98
import scipp as sc
109
import scippneutron as scn
@@ -317,8 +316,7 @@ def compute_monitor_time_of_flight(
317316
wf[time_of_flight.PulseStride] = pulse_stride
318317
wf[time_of_flight.PulseStrideOffset] = pulse_stride_offset
319318
out = wf.compute(time_of_flight.ResampledTofData)
320-
inds = out.values == 0.0
321-
out.values[inds] = np.nan
319+
out.masks["zero_counts"] = out.data == sc.scalar(0.0, unit=out.data.unit)
322320
return TofMonitorData[RunType, MonitorType](out)
323321

324322

0 commit comments

Comments
 (0)