Skip to content

Commit

Permalink
IntegrateBaseline: interpolate before computing baseline
Browse files Browse the repository at this point in the history
For speed. Results should be the same.
  • Loading branch information
markotoplak committed Oct 10, 2023
1 parent 926b23f commit 69b2522
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion orangecontrib/spectroscopy/preprocess/integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 69b2522

Please sign in to comment.