From 4f86417a960c16ac2c78440b624b801c6488ff30 Mon Sep 17 00:00:00 2001
From: Danilo Ferreira de Lima <danilo.enoque.ferreira.de.lima@xfel.de>
Date: Wed, 11 Oct 2023 08:46:03 +0200
Subject: [PATCH] Pad arrays with zeros when in multi-bunch mode.

---
 pes_to_spec/model.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pes_to_spec/model.py b/pes_to_spec/model.py
index 8291089..f488c27 100644
--- a/pes_to_spec/model.py
+++ b/pes_to_spec/model.py
@@ -314,7 +314,7 @@ class SelectRelevantLowResolution(TransformerMixin, BaseEstimator):
                    if channel in self.channels}
             # pad it with zeros, if we reach the edge of the array
             for channel in y.keys():
-                y[channel] = [np.pad(y[channel][j], (0, 2*delta_tof - len(y[channel][j])))
+                y[channel] = [np.pad(y[channel][j], (0, 2*self.delta_tof - len(y[channel][j])))
                               for j in range(len(y[channel]))]
                 y[channel] = np.stack(y[channel], axis=1)
         if not keep_dictionary_structure:
-- 
GitLab