Skip to content

MacDumi/RAMAN-Deconvolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deconvolution of Raman spectra

This application is designed for deconvolution of Raman spectra.

Screenshot

Dependencies

Before running this script, please make sure that Python3 and all the required libraries are installed by running:

$ pip install -r requirements.txt

Usage:

$ python RD.py

Input data format

The data should be in a text file with two columns (Raman shift and Intensity) separated by any commonly used delimiter. The script also accepts .wdf files (generated by the WIRE software of Renishaw Inc.)

Spike detection

The script has an integrated "spike" detector. To detect "spikes" the moving average of two adjacent points is compared and, if the difference is higher than the threshold value, the point is considered as a spike. If the algorithm fails to detect spikes, the user can specify another threshold value and try again.

Baseline subtraction

By default the baseline is calculated using a third degree polynomial function. However, the user is able to change the degree of the poly-function if the baseline does not fit the experimental data. A preview of the calculated baseline and the experimental data can be displayed.

Deconvolution

The deconvolution can be performed with either a conventional least squares method or Markov chains Monte Carlo algorithm (MCMC). Regardless of the method, the shape, bounds and initial guess for all the bands can be adjusted. Currently, 4 peak shapes are supported: Lorentzian, Gaussian, Voigt, and Breit-Wigner-Fano.

Batch deconvolution

It is possible to deconvolute multiple files at once (only with the least squares method). The user should carefully choose the region of interest and input parameters and ensure that all the spikes are removed. It is possible to choose the number of processes that will be spawned/forked.

Configuration

Default values are loaded from the configuration file (./config/config.ini). To change the initial guess, bounds and the shape of peaks, edit the ./config/initialData.csv

WDF conversion

You can convert wdf files to a more manageable format with the convertwdf.py script

$./convertwdf.py <fileName>

If the file contains only one spectrum the output will be a text file with two columns, if the file contains multiple spectra a csv file will be created with columns corresponding to each of the present spectra.