From 2e75aaf85efd6c55675af4a2f71bb4b58eef98a0 Mon Sep 17 00:00:00 2001 From: Thibault Barnouin Date: Mon, 7 Jun 2021 13:29:48 +0200 Subject: [PATCH] Fix bug in get_error function, all image wasn't browsed --- src/lib/reduction.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/reduction.py b/src/lib/reduction.py index d512393..44ed2cc 100755 --- a/src/lib/reduction.py +++ b/src/lib/reduction.py @@ -378,15 +378,15 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, # Find the sub-image of smallest integrated flux (suppose no source) #sub-image dominated by background for r in range(temp.shape[1]): - for c in range(temp.shape[0]): + for c in range(temp.shape[2]): temp[i][r,c] = image[r:r+diff[0],c:c+diff[1]].sum() minima = np.unravel_index(np.argmin(temp.sum(axis=0)),temp.shape[1:]) for i, image in enumerate(data): - rectangle[i] = minima[0], minima[1], sub_shape[0], sub_shape[1] + rectangle[i] = minima[1], minima[0], sub_shape[0], sub_shape[1] # Compute error : root mean square of the background - sub_image = image[minima[0]:minima[0]+sub_shape[0],minima[1]:minima[1]+sub_shape[1]] + 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) background[i] = sub_image.sum()