From 172942f6ca020c32e12b88d2dd3cd96346380bba Mon Sep 17 00:00:00 2001 From: gfreychet Date: Mon, 4 Nov 2024 17:16:13 +0100 Subject: [PATCH] Adding the option to ad a beamstop to the Xeuss 1M detector --- smi_analysis/Detector.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/smi_analysis/Detector.py b/smi_analysis/Detector.py index bc13c15..9fb5f45 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): + def calc_mask(self, img, bs, bs_kind=None): ''' :return: (a 2D array) A mask array with 0 and 1 with 0s where the image will be masked ''' @@ -285,7 +285,12 @@ def calc_mask(self, img): self.shape= np.shape(img) mask[np.where(img<-0.5)]=False - mask[:, :5], mask[:, -5:], mask[:5, :], mask[-5:, - :] = False, False, False, False - - return np.logical_not(mask) + 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)