From 2ecdc5e042055533332ce8b03b2384e4b835ba9c Mon Sep 17 00:00:00 2001 From: Artur Glavic Date: Wed, 11 Nov 2026 10:29:17 +0100 Subject: [PATCH] Fix scaling reflectivity leading to stacking of scaling factors due to norm.monitor being numpy scalar and not float --- eos/normalization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eos/normalization.py b/eos/normalization.py index abf362a..eb17775 100644 --- a/eos/normalization.py +++ b/eos/normalization.py @@ -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')