Fix for direct beam normalization and monitor low count rate
Unit Testing / test (3.11) (push) Successful in 54s
Unit Testing / test (3.10) (push) Successful in 58s
Unit Testing / test (3.8) (push) Successful in 52s
Unit Testing / test (3.12) (push) Successful in 54s
Unit Testing / test (3.9) (push) Successful in 56s

This commit is contained in:
2026-06-24 10:49:47 +02:00
parent 28eaa47a1d
commit bfac8ea716
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -241,6 +241,7 @@ class LZProjection(ProjectionInterface):
ref_lz *= norm.monitor/self.monitor
ref_lz[np.logical_not(self.data.mask)] = np.nan
self.data.norm = norm_lz
self.norm_monitor = norm.monitor
self.data.ref = ref_lz
self.calc_error()
self.is_normalized = True
+5 -1
View File
@@ -314,6 +314,7 @@ class ReflectivityReduction:
scale = self.config.reduction.scale[i]
except IndexError:
scale = self.config.reduction.scale[-1]
# TODO: causes error if no '-s' argumnet is given
proj.scale(scale)
# projection on qz-grid
@@ -451,6 +452,9 @@ class ReflectivityReduction:
proj.apply_norm_mask(self.norm, min_norm=self.config.reduction.normalizationFilter,
min_theta=self.config.reduction.normAngleFilter)
if self.monitor<=1e-6:
self.monitor = np.nan
proj.project(dataset, self.monitor)
if self.config.reduction.normalisationMethod == NormalisationMethod.over_illuminated:
@@ -465,7 +469,7 @@ class ReflectivityReduction:
else:
logging.error('unknown normalisation method! Use [u]nder, [o]ver or [d]irect illumination')
proj.normalize_no_footprint(self.norm)
if self.monitor<=1e-6:
if self.monitor is np.nan:
logging.info(' low monitor -> nan output')
proj.data.ref *= np.nan