From a43a625548b8154e64fcc57fc60be490ea1a40f7 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:49:33 +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 f488c27..98c6400 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*self.delta_tof - len(y[channel][j]))) + y[channel] = [np.pad(y[channel][j], (0, 2*self.delta_tof - y[channel][j].shape[1])) for j in range(len(y[channel]))] y[channel] = np.stack(y[channel], axis=1) if not keep_dictionary_structure: -- GitLab