Skip to content

Commit 6220922

Browse files
committed
Fix upper edge selection for monitor
1 parent 455454d commit 6220922

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ess/powder/correction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ def normalize_by_monitor_integrated(
106106
)
107107
lo = det_coord.min()
108108
hi = det_coord.max()
109-
hi.value = np.nextafter(hi.value, np.inf)
109+
# hi is shifted towards MINUS infinity because label-based indexing with bin-edges
110+
# in inclusive for the upper edge. But we don't want the literal upper edge
111+
# of the detector to be included.
112+
hi.value = np.nextafter(hi.value, -np.inf)
110113
monitor = monitor[dim, lo:hi]
111114

112115
coord = monitor.coords[dim]

0 commit comments

Comments
 (0)