From 69b252210402f908633c072dac30ba1c21451f4e Mon Sep 17 00:00:00 2001 From: Marko Toplak Date: Tue, 10 Oct 2023 16:14:13 +0200 Subject: [PATCH] IntegrateBaseline: interpolate before computing baseline For speed. Results should be the same. --- orangecontrib/spectroscopy/preprocess/integrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orangecontrib/spectroscopy/preprocess/integrate.py b/orangecontrib/spectroscopy/preprocess/integrate.py index 75af3ee2e..59f0b09bd 100644 --- a/orangecontrib/spectroscopy/preprocess/integrate.py +++ b/orangecontrib/spectroscopy/preprocess/integrate.py @@ -90,10 +90,10 @@ def compute_baseline(self, x, y): return edge_baseline(x, y) def compute_integral(self, x, y_s): - y_s = y_s - self.compute_baseline(x, y_s) if np.any(np.isnan(y_s)): # interpolate unknowns as trapz can not handle them y_s, _ = nan_extend_edges_and_interpolate(x, y_s) + y_s = y_s - self.compute_baseline(x, y_s) return np.trapz(y_s, x, axis=1) def compute_draw_info(self, x, ys):