Skip to content

Commit

Permalink
only convert units for single array entry
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzhuetten committed Jan 25, 2019
1 parent a34e9bd commit fd5d48f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ctapipe/instrument/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fd5d48f

Please sign in to comment.