From 4f67df22c231684b5b678c5592fb5804c3e9d16d Mon Sep 17 00:00:00 2001 From: gfreychet Date: Mon, 4 Nov 2024 17:19:58 +0100 Subject: [PATCH] Reverting change in mask for Eiger detector from Xeuss --- smi_analysis/Detector.py | 15 +++++---------- smi_analysis/SMI_beamline.py | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/smi_analysis/Detector.py b/smi_analysis/Detector.py index 9fb5f45..bc13c15 100644 --- a/smi_analysis/Detector.py +++ b/smi_analysis/Detector.py @@ -276,7 +276,7 @@ class Eiger1M_xeuss(Eiger1M): ''' aliases = ["Eiger1M_xeuss"] - def calc_mask(self, img, bs, bs_kind=None): + def calc_mask(self, img): ''' :return: (a 2D array) A mask array with 0 and 1 with 0s where the image will be masked ''' @@ -285,12 +285,7 @@ def calc_mask(self, img, bs, bs_kind=None): self.shape= np.shape(img) mask[np.where(img<-0.5)]=False - mask[:, :5], mask[:, -5:], mask[:5, :], mask[-5:, :] = False, False, False, False - mask[bs[1]:, bs[0] - 8: bs[0] + 8] = False - - #Beamstop - if bs == [0, 0]: - return np.logical_not(mask) - else: - mask[bs[1]:, bs[0] - 8 : bs[0] + 8] = False - return np.logical_not(mask) + mask[:, :5], mask[:, -5:], mask[:5, :], mask[-5:, + :] = False, False, False, False + + return np.logical_not(mask) diff --git a/smi_analysis/SMI_beamline.py b/smi_analysis/SMI_beamline.py index 780a702..229ccc1 100644 --- a/smi_analysis/SMI_beamline.py +++ b/smi_analysis/SMI_beamline.py @@ -139,7 +139,7 @@ def open_data_db(self, lst_img, optional_mask=None): self.imgs = [] for img, bs in zip(lst_img, self.bs): - if self.detector != 'rayonix': + if self.detector != 'rayonix' and self.detector != 'Eiger1M_xeuss': self.masks.append(self.det.calc_mask(bs=bs, bs_kind=self.bs_kind, optional_mask=optional_mask)) if self.detector == 'Pilatus1m': self.imgs.append(img)