From 72f008493f628cb1a8bd7af853bc185f265b769b Mon Sep 17 00:00:00 2001 From: Eddie Schlafly Date: Fri, 6 Dec 2024 09:41:32 -0500 Subject: [PATCH] Handle cases where more than 2 billion photons enter a pixel. (#188) --- romanisim/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/romanisim/image.py b/romanisim/image.py index f59723a..0f84e40 100644 --- a/romanisim/image.py +++ b/romanisim/image.py @@ -470,7 +470,7 @@ def simulate_counts_generic(image, exptime, objlist=None, psf=None, rng_numpy_seed = rng.raw() rng_numpy = np.random.default_rng(rng_numpy_seed) image.array[:, :] = rng_numpy.binomial( - image.array.astype('i4'), flat / maxflat) + np.clip(image.array, 0, 2**31 - 1).astype('i4'), flat / maxflat) if dark is not None: workim = image * 0