See
|
# Clip `monitor` to the range of `detector`, where the bins at the boundary |
|
# may extend past the detector range (how label-based indexing works). |
|
det_coord = ( |
|
detector.coords[dim] if dim in detector.coords else detector.bins.coords[dim] |
|
) |
|
lo = det_coord.nanmin() |
|
hi = det_coord.nanmax() |
|
monitor = monitor[dim, lo:hi] |
|
# Strictly limit `monitor` to the range of `detector`. |
|
edges = sc.concat([lo, monitor.coords[dim][1:-1], hi], dim=dim) |
|
monitor = sc.rebin(monitor, {dim: edges}) |
I think this is a bug, which likely was not noticed so far since neither 2-theta nor wavelength masking is used.