pyRaman: A software library for Raman imaging

Introduction

This software library was created to assist user of Renishaw$^{TM}$ Raman spectrometer to analyze Raman scattering data using the Jupyter Notebook. The software was developed specifically to analyze 2-dimensional image Raman scattering data on single crystal and electronic semiconductor materials but can be further used for other type of samples as well. The software was structured so that additional built-in classes and functions can be readily added for other type of analyses. The authors would like to thank lovaulonze for creating the wdfReader library (under the open-sourced MIT license) that allows the extraction of data from the Renishaw$^{TM}$ .wdf file format.

pyRaman software library is licensed under the BSD License.

This tutorial shows a simple self-explanatory usage of the pyRaman library. Data used are from SiC wafer.


Importing the pyRaman library.

In [1]:
import pyRaman as pR
Loading BokehJS ...

Extracting the data from file.

In [2]:
a = pR.scandata('13 Sept 2018/SiC Transparent Area Spot 2.wdf', [20,20], 'spectrum 1')
b = pR.scandata('14 Sept 2018/SiC defect map spot 1.wdf', [11,9], 'spectrum 2')
Total number of spectrums : 400
Pixel area : 20 x 20
Total number of x-axis data : 1011
Total number of spectrums : 99
Pixel area : 11 x 9
Total number of x-axis data : 1011

Plotting the whole spectrum for specific pixel spot.

In [3]:
pR.iplot()
a.spectrumplot(spot = [0,0])
a.spectrumplot(spot = [10,10])
b.spectrumplot(spot = [0,0])
pR.showplot()

Curve fitting for individual peaks


Curve fitting used the Lorentz function with background line fit by linear equation:

  • Lorentz function : $$f(x;I,\gamma,x_0) = I{\bigg[}\frac{\gamma^2}{(x-x_0)^2 + \gamma^2}{\bigg]}$$

Manual fitting to estimate initial Lorentz function parameters for fitting peak in certain spectrum range.

In [4]:
pR.iplot()
a.checkfitting(xrange = [760,792], IntLor = 800.0, mU = 777.0,\
               gammaL = 2.5)
a.checkfitting(spot = [10,10], xrange = [760,792], IntLor = 800.0, mU = 777.0,\
               gammaL = 2.5)
b.checkfitting(spot = [0,0], xrange = [760,792], IntLor = 800.0, mU = 775.0,\
               gammaL = 2.5)
pR.showplot()

Fitting process displaying 3$\sigma$ error range for maximum intensity and the peak Raman wavelength value.

In [5]:
pR.iplot()
a.functionfitting(xrange = [760,792], IntLor = 800.0, mU = 777.0,\
               gammaL = 2.5)
a.functionfitting(spot = [10,10], xrange = [760,792], IntLor = 800.0, mU = 777.0,\
               gammaL = 2.5)
b.functionfitting(spot = [0,0], xrange = [760,792], IntLor = 800.0, mU = 775.0,\
               gammaL = 2.5)
pR.showplot()

Other similar examples on different peak.

In [6]:
pR.iplot()
b.checkfitting(xrange = [1400,1640], IntLor = 30, mU = 1525.0,\
               gammaL = 30.0)
b.checkfitting(spot = [5,6], xrange = [1400,1640], IntLor = 30, mU = 1525.0,\
               gammaL = 30.0)
pR.showplot()
In [7]:
pR.iplot()
b.functionfitting(xrange = [1400,1640], IntLor = 30, mU = 1525.0,\
               gammaL = 30.0)
b.functionfitting(spot = [5,6], xrange = [1400,1640], IntLor = 30, mU = 1525.0,\
               gammaL = 30.0)
pR.showplot()

2-dimensional image on differences in intensity and peak shift (stress) values based on Lorentz fitting.

In [8]:
%matplotlib inline
a.fitallspot(xrange = [755,800], IntLor = 800.0, mU = 777.0,\
             gammaL = 2.5)

*The class and function names seem wanting, probably going to be changed in future.