Fix scaling reflectivity leading to stacking of scaling factors due to norm.monitor being numpy scalar and not float
Unit Testing / test (3.8) (push) Successful in 1m39s
Unit Testing / test (3.11) (push) Successful in 1m42s
Unit Testing / test (3.12) (push) Successful in 1m44s
Unit Testing / test (3.10) (push) Successful in 1m44s
Unit Testing / test (3.9) (push) Successful in 1m45s

This commit is contained in:
glavic_a committed 2026-11-11 10:29:17 +01:00
1 parent 6dea38ddb0
commit 2ecdc5e042
1 file changed
+2 -2
+2 -2
View File
@@ -25,7 +25,7 @@ class LZNormalisation:
self.angle = reference.geometry.nu-reference.geometry.mu
lamda_e = reference.data.events.lamda
detZ_e = reference.data.events.detZ
self.monitor = np.sum(reference.data.pulses.monitor)
self.monitor = float(np.sum(reference.data.pulses.monitor))
norm_lz, _, _ = np.histogram2d(lamda_e, detZ_e, bins=(grid.lamda(), grid.z()))
if normalisationMethod==NormalisationMethod.direct_beam:
self.norm = np.flip(norm_lz, 1)
@@ -52,7 +52,7 @@ class LZNormalisation:
self.file_list = np.load(fh, allow_pickle=True).tolist()
self.angle = np.load(fh, allow_pickle=True)
self.norm = np.load(fh, allow_pickle=True)
self.monitor = np.load(fh, allow_pickle=True)
self.monitor = float(np.load(fh, allow_pickle=True))
if check_hash is not None and hash != check_hash:
logging.info(' file hash does not match this reduction configuration')
raise ValueError('file hash does not match this reduction configuration')