The new Python code provides a comprehensive set of functionalities for Raman spectroscopy data analysis:
The user has the flexibility to choose from four baseline removal methods:
a. Asymmetric Least Squares (ALS)
- Developed by P. Eilers and H. Boelens (2005).
- Source: [StackOverflow - Python Baseline Correction Library]
b. BaselineRemoval Package
- Developed by Md Azimul Haque (2022).
- Implements three methods:
- Modpoly: Modified multi-polynomial fit by Lieber & Mahadevan-Jansen (2003).
- IModPoly: Improved ModPoly by Zhao (2007).
- ZhangFit: Adaptive iteratively reweighted penalized least squares by Zhi-Min Zhang (2010).
- Source: [PyPI – BaselineRemoval]
The code offers smoothing using the Savitzky-Golay filter, commonly used for noisy data. Users can specify:
- The length of the smoothing window.
- The order of the polynomial used for fitting the data within the window.
- Implementation available in the SciPy library.
- Source: [SciPy - savgol_filter]
The code includes a peak-picking algorithm to identify local maxima in the signal. Users can customize:
- The minimum peak height.
- The minimum horizontal peak spacing.
- The minimum peak width.
- Implementation available in the SciPy library.
- Source: [SciPy - find_peaks]
The code provides an optional plotting feature for data visualization.
The code enables users to determine the type of an unknown polymer by comparing the peaks values. Users can specify:
- The absolute difference between the peaks of the unknown polymer and the values in a polymer library.
- The percentage of closeness or similarity, which can be highlighted based on this difference.
This Python code offers a versatile toolbox for Raman spectroscopy data analysis, with various customization options for baseline removal, smoothing, peak picking, and polymer identification.
numpy
: Import asnp
. Usually installed withpip install numpy
.pandas
: Import aspd
. Usually installed withpip install pandas
.matplotlib
: Specifically,matplotlib.pyplot
, import asplt
. Usually installed withpip install matplotlib
.scipy
: Includessparse
,sparse.linalg
(asspsolve
), andsignal
(assavgol_filter
,find_peaks
). Usually installed withpip install scipy
.ipywidgets
: Import aswidgets
. Usually installed withpip install ipywidgets
.IPython
: Specifically,IPython.display
, import asdisplay
. Usually installed withpip install ipython
.BaselineRemoval
: For baseline removal algorithms. Usually installed withpip install BaselineRemoval
.openpyxl
: Import asWorkbook
,NamedStyle
, and useutils.dataframe
(asdataframe_to_rows
). Usually installed withpip install openpyxl
.xlsxwriter
: For writing files in the XLSX file format. Usually installed withpip install XlsxWriter
.