Skip to content

Commit

Permalink
Ensure int indices in xraysim
Browse files Browse the repository at this point in the history
  • Loading branch information
omegahm committed Feb 28, 2017
1 parent 06c765f commit 9fc3d18
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions benchmarks/xraysim/python_numpy/xraysimphysics.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def addAAcube( scene,
"""
mincorner, maxcorner = describers
if ref == Reference.relative:
x0,y0,z0 = mincorner
x1,y1,z1 = maxcorner
sshp = np.array(matscene.shape)
x0,y0,z0 = mincorner.astype(np.int64)
x1,y1,z1 = maxcorner.astype(np.int64)
sshp = np.array(matscene.shape, dtype=np.int)
# guard if relative corners are bigger than scene
x0 = x0 if x0 < sshp[0] else sshp[0]
y0 = y0 if y0 < sshp[1] else sshp[1]
Expand Down Expand Up @@ -101,4 +101,3 @@ def x_r(x, x0, x1, xr):
return addAAcube( scene, matscene, rel_describers, material, Reference.relative, verbose )

return False

0 comments on commit 9fc3d18

Please sign in to comment.