Skip to content

Commit

Permalink
make sure accumulator is float64
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Nov 10, 2023
1 parent 1c8d0a1 commit d92d41e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drizzle/tests/test_drizzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def centroid(image, size, center):
xhi = min(xlo + size, image.shape[1])

yx1 = np.mgrid[ylo:yhi, xlo:xhi, 1:2]
center = (yx1[..., 0] * image[ylo:yhi, xlo:xhi]).sum(axis=(1, 2))
center = (yx1[..., 0] * image[ylo:yhi, xlo:xhi]).sum(
axis=(1, 2),
dtype=np.float64,
)

if center[2] == 0.0:
return None
Expand Down

0 comments on commit d92d41e

Please sign in to comment.