diff --git a/doc/changelog.rst b/doc/changelog.rst index c6f5ba5333312c10f05584d63a0a189ac172ff63..b2753d2bb8e7f9d5b8366049af56dd6e4f2e3bd6 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -18,7 +18,7 @@ unreleased - move loading logic to mnemonics :mr:`283`, :mr:`286` - adds MaranaX mnemonics :mr:`285` - adds Chem diagnostics and Gotthard II mnemonics :mr:`292` - + - make hRIXS centroid threshold configurable :mr:`298` - **New Features** diff --git a/src/toolbox_scs/detectors/hrixs.py b/src/toolbox_scs/detectors/hrixs.py index 40b769facf90964ad6cf8312dd292576d0c7eb4d..608f800ba4ed0200a5c54cce8e2362910a20893b 100644 --- a/src/toolbox_scs/detectors/hrixs.py +++ b/src/toolbox_scs/detectors/hrixs.py @@ -247,9 +247,13 @@ class hRIXS: self.Y_RANGE = np.s_[:] # centroid + # centroid_one threshold self.THRESHOLD = None # pixel counts above which a hit candidate is assumed self.STD_THRESHOLD = 3.5 # same as THRESHOLD, in standard deviations self.DBL_THRESHOLD = 0.1 # factor used for double hits in centroid_one + # centroid_two threshold + self.CENTROID_THRESHOLD = [0.2, 1] + self.CURVE_A = 0 # curvature parameters as determined elsewhere self.CURVE_B = 0 @@ -418,13 +422,16 @@ class hRIXS: The function returns arrays containing the single and double hits as x and y coordinates """ + # Prepare + threshold = self.CENTROID_THRESHOLD + # Multiplication factor * ADU/photon photons = energy/3.6/1.06 - SpotLOW = 0.2 * photons - SpotHIGH = 1.5 * photons - low_th_px = 0.2 * photons - high_th_px = 1.0 * photons - + SpotLOW = threshold[0] * photons + SpotHIGH = threshold[1] * photons + low_th_px = threshold[0] * photons + high_th_px = threshold[1] * photons + if self.AVOID_DBL: SpotHIGH = 100000