From 5eb2446864b3942c9f6db66493a95f5d66d6fd24 Mon Sep 17 00:00:00 2001 From: Thibault Barnouin Date: Mon, 7 Jun 2021 13:56:57 +0200 Subject: [PATCH] Fix bug when substracting background : change from mean to RMS value --- src/lib/reduction.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/reduction.py b/src/lib/reduction.py index 44ed2cc..ede75a0 100755 --- a/src/lib/reduction.py +++ b/src/lib/reduction.py @@ -387,10 +387,11 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, rectangle[i] = minima[1], minima[0], sub_shape[0], sub_shape[1] # Compute error : root mean square of the background sub_image = image[minima[1]:minima[1]+sub_shape[0],minima[0]:minima[0]+sub_shape[1]] - #error_array[i] *= np.std(sub_image) # Previously computed using standard deviation over the background - error_array[i] *= np.sqrt(np.sum(sub_image**2)/sub_image.size) + #error = np.std(sub_image) # Previously computed using standard deviation over the background + error = np.sqrt(np.sum(sub_image**2)/sub_image.size) + error_array[i] *= error background[i] = sub_image.sum() - data_array[i] = np.abs(data_array[i] - sub_image.mean()) + data_array[i] = np.abs(data_array[i] - error) if display: