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:
I have 3 questions about it:
1) Why it did not capture the local maxima at 550?
2) How can I remove the baseline of the convelHull (the black curve)?
3) How can I divide my spectrum by the "upper" conveHull in order to get CR spectrum?