Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubberband baseline correction edited #28

Merged
merged 1 commit into from
Aug 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rampy/baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def baseline(x_input,y_input,bir,method, **kwargs):
# code from this stack-exchange forum
#https://dsp.stackexchange.com/questions/2725/how-to-perform-a-rubberband-correction-on-spectroscopic-data

x = x.flatten()
# Find the convex hull
v = ConvexHull([[X[0], X[1]] for X in zip(x, y)]).vertices

v = ConvexHull(np.array(list(zip(x, y))), incremental=True).vertices
#v = ConvexHull(np.vstack((x.ravel(), y.ravel())).T).vertices

# Rotate convex hull vertices until they start from the lowest one
Expand Down