raman.solvent_subtract

raman.solvent_subtract(y, solvent, peaks, scaling='const', type='lor')

Subtract solvent or ground state spectrum from a spectrum or a list of spectra. The optimum scaling of the spectrum to subtract is found by fitting one or more solvent peaks using a Lorentzian or Gaussian. This function works well with spectra having peaks of similar intensity as the solvent spectrum.

Parameters:
  • y (array) – Input spectrum. If y is a list or 2d array of spectra, apply solvent subtraction to each spectrum.
  • solvent (array) – Spectrum to subtract (same shape as y).
  • peaks (array) – Array of tuples, one for each solvent peak, giving the data interval in indices used for fitting. Each peak is fit by a single Lorentzian or Gaussian.
  • scaling (str) – Type of scaling function (‘const’, default, or ‘linear’). Linear scaling is used to account for self-absorption effects and requires at least two solvent peaks.
  • type (str) – Type of fit function (‘lor’, default, or ‘gauss’).
Returns:

Solvent / ground state corrected spectrum with same shape as y.