From 4ff5f6399243d78881a68a89a42ec641898b9d77 Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Tue, 19 May 2020 10:45:42 +0200 Subject: [PATCH] Bugfix: calculate exposure time correctly --- esbo_etc/classes/sensor/Imager.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/esbo_etc/classes/sensor/Imager.py b/esbo_etc/classes/sensor/Imager.py index cc3a24b..6334e30 100644 --- a/esbo_etc/classes/sensor/Imager.py +++ b/esbo_etc/classes/sensor/Imager.py @@ -144,17 +144,14 @@ class Imager(ASensor): signal_current, background_current, read_noise, dark_current = self.__exposePixels() # Calculate the electron currents for all pixels signal_current_tot = signal_current.sum() - background_current_tot = background_current.sum() - read_noise_tot = read_noise.sum() - dark_current_tot = dark_current.sum() # Fix the physical units of the SNR snr = snr * u.electron ** 0.5 # Calculate the ratio of the background- and dark-current to the signal current as auxiliary variable - current_ratio = (background_current_tot + dark_current_tot) / signal_current_tot + current_ratio = (background_current.sum() + dark_current.sum()) / signal_current_tot # Calculate the necessary exposure time as inverse of the CCD-equation exp_time = snr ** 2 * ( - 1 + current_ratio + np.sqrt((1 + current_ratio) ** 2 + 4 * read_noise_tot ** 2 / snr ** 2)) / ( + 1 + current_ratio + np.sqrt((1 + current_ratio) ** 2 + 4 * (read_noise ** 2).sum() / snr ** 2)) / ( 2 * signal_current_tot) # Print information if exp_time.size > 1: