diff --git a/hexrd/instrument/detector.py b/hexrd/instrument/detector.py index a05fc6c9c..587faced5 100644 --- a/hexrd/instrument/detector.py +++ b/hexrd/instrument/detector.py @@ -878,10 +878,9 @@ def clip_to_panel(self, xy, buffer_edges=True): idx = np.logical_or(roff, coff) - pix[idx, :] = 0 - - on_panel = self.panel_buffer[pix[:, 0], pix[:, 1]] - on_panel[idx] = False + on_panel = np.full(pix.shape[0], False) + valid_pix = pix[~idx, :] + on_panel[~idx] = self.panel_buffer[valid_pix[:, 0], valid_pix[:, 1]] else: xlim -= self.panel_buffer[0] ylim -= self.panel_buffer[1] @@ -931,6 +930,7 @@ def interpolate_nearest(self, xy, img, pad_with_nans=True): int_xy[on_panel] = int_vals return int_xy + def interpolate_bilinear(self, xy, img, pad_with_nans=True): """ Interpolate an image array at the specified cartesian points.