Skip to content

Commit

Permalink
Fix issue with old version of numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
farkmarnum committed Jan 14, 2025
1 parent d8938dc commit 1e2c0ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion romanisim/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def simulate_counts_generic(image, exptime, objlist=None, psf=None,
# architectures, converting that value to int32 rolls over to a negative
# number. To resolve, we use `np.nextafter` to get the previous floating
# point number, which is roughly 2^31 - 128.
MAX_SAFE_VALUE = np.nextafter(np.float32(2**31 - 1), 0)
MAX_SAFE_VALUE = np.nextafter(2**31 - 1, 0, dtype=np.float32)
image.array[:, :] = rng_numpy.binomial(
np.clip(image.array, 0, MAX_SAFE_VALUE).astype("i4"), flat / maxflat
)
Expand Down

0 comments on commit 1e2c0ed

Please sign in to comment.