Skip to content

Commit

Permalink
Reverting change in mask for Eiger detector from Xeuss
Browse files Browse the repository at this point in the history
  • Loading branch information
gfreychet committed Nov 4, 2024
1 parent 172942f commit 4f67df2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions smi_analysis/Detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
Expand All @@ -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)
2 changes: 1 addition & 1 deletion smi_analysis/SMI_beamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4f67df2

Please sign in to comment.