I'm using python 2.7 (on jupyter notebook, win10 64 bit) to perform my analysis. I need to perform continuum removal (CR) on a reflectance spectrum data. I need it to be as described [here].
I used the following code to perform CR on a reflectance spectrum:
from scipy.spatial import ConvexHull import numpy as np import matplotlib.pyplot as plt i = Xdata.iloc[15,:] #get the data from a pandas df ii = i.tolist() mat = np.column_stack((wavelenght_list,ii)) hull = ConvexHull(mat) plt.plot(mat[:,0], mat[:,1], 'o') for simplex in hull.simplices: plt.plot(mat[simplex, 0], mat[simplex, 1], 'k-')
The result I get is:
[![enter image description here]]
I have 3 questions about it:
Why it did not capture the local maxima at 550?
How can I remove the baseline of the convelHull (the black curve)?
How can I divide my spectrum by the "upper" conveHull in order to get CR spectrum? : http://www.harrisgeospatial.com/docs/ContinuumRemoval.html : https://i.stack.imgur.com/C5qah.jpg
Thanks you all for your help- I found a more suitable module for my needs to perform the continuum removal algorithm: