From e688185b8d065a59ce3758d32a3471ee9e7750da Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Thu, 5 Oct 2023 15:51:14 -0400 Subject: [PATCH] Update the random ramp generator --- tests/test_jump_cas22.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_jump_cas22.py b/tests/test_jump_cas22.py index 26ea1bf6b..375ac658c 100644 --- a/tests/test_jump_cas22.py +++ b/tests/test_jump_cas22.py @@ -178,16 +178,17 @@ def _generate_resultants(read_pattern, n_pixels=1): resultant_total = np.zeros(n_pixels, dtype=np.float32) # Total of all reads in this resultant for _ in reads: # Compute the next value of the ramp - # - Poisson process for the flux - # - Gaussian process for the read noise + # Using a Poisson process for the flux ramp_value += RNG.poisson(FLUX * ROMAN_READ_TIME, size=n_pixels).astype(np.float32) - ramp_value += ( - RNG.standard_normal(size=n_pixels, dtype=np.float32) * READ_NOISE / np.sqrt(len(reads)) - ) # Add to running total for the resultant resultant_total += ramp_value + # Add read noise to the resultant + resultant_total += ( + RNG.standard_normal(size=n_pixels, dtype=np.float32) * READ_NOISE / np.sqrt(len(reads)) + ) + # Record the average value for resultant (i.e., the average of the reads) resultants[index] = (resultant_total / len(reads)).astype(np.float32)