diff --git a/ctapipe/instrument/camera.py b/ctapipe/instrument/camera.py index 5b85e194f54..abf4ea6e041 100644 --- a/ctapipe/instrument/camera.py +++ b/ctapipe/instrument/camera.py @@ -611,12 +611,12 @@ def position_to_pix_index(self, x, y): index = np.where(pix_indices == borderpix_index)[0][0] # compare with inside pixel: xprime = (points_searched[0][index, 0] - - self.pix_x.to_value(u.m)[borderpix_index] - + self.pix_x.to_value(u.m)[insidepix_index]) + - self.pix_x[borderpix_index].to_value(u.m) + + self.pix_x[insidepix_index].to_value(u.m)) yprime = (points_searched[0][index, 1] - - self.pix_y.to_value(u.m)[borderpix_index] - + self.pix_y.to_value(u.m)[insidepix_index]) - dist_check, index_check = kdtree.query([xprime, yprime], + - self.pix_y[borderpix_index].to_value(u.m) + + self.pix_y[insidepix_index].to_value(u.m)) + dist_check, index_check = kdtree.query([xprime, yprime], distance_upper_bound=circum_rad) del dist_check if index_check != insidepix_index: