From 1e2c0ed9cdab439bc15b314c9f7e26ce75d3c9bc Mon Sep 17 00:00:00 2001 From: Mark Farnum Date: Tue, 14 Jan 2025 15:15:17 -0500 Subject: [PATCH] Fix issue with old version of numpy --- romanisim/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/romanisim/image.py b/romanisim/image.py index a45e72f..7f678cf 100644 --- a/romanisim/image.py +++ b/romanisim/image.py @@ -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 )