Skip to content

Commit

Permalink
Adding the option to ad a beamstop to the Xeuss 1M detector
Browse files Browse the repository at this point in the history
  • Loading branch information
gfreychet committed Nov 4, 2024
1 parent a3416e6 commit 172942f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 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):
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
'''
Expand All @@ -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)

0 comments on commit 172942f

Please sign in to comment.