From 9ad5b45936440ca991218addf23f5b4841ae25eb Mon Sep 17 00:00:00 2001
From: Danilo Ferreira de Lima <danilo.enoque.ferreira.de.lima@xfel.de>
Date: Wed, 22 May 2024 18:25:47 +0200
Subject: [PATCH] Apply roll.

---
 pes_to_spec/model.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pes_to_spec/model.py b/pes_to_spec/model.py
index 644f469..b696dba 100644
--- a/pes_to_spec/model.py
+++ b/pes_to_spec/model.py
@@ -530,6 +530,9 @@ class SelectRelevantLowResolution(TransformerMixin, BaseEstimator):
                 chi2[ch] = np.sum(((meanX[ch] - self.mean[ch][:,0,:])/self.std[ch][:,0,:])**2)
         shift = {ch: shifts[np.argmin(chi2[ch])]
                 for ch in y.keys()}
+        print("Shifts", shift)
+        y = {ch: np.roll(y[ch], shift[ch], axis=-1)
+             for ch in y.keys()}
 
         if not keep_dictionary_structure:
             selected = list(y.values())
-- 
GitLab