raman.solvent_subtract_chi2

raman.solvent_subtract_chi2(y, solvent, scaling='const', shiftx=False)

Subtract a solvent or ground state spectrum from a spectrum or list of spectra. The optimum scaling of the spectrum to subtract is found by minimizing the sum over the residual spectrum squared. This function works good if the residual spectrum has weaker peaks than the solvent / ground state 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).
  • scaling (str) – Type of scaling function (‘const’, default, or ‘linear’). Linear scaling is used to account for self-absorption effects.
  • shiftx (bool) – If True, the spectrum to subtract can also be translated along the x-axis (default = False).
Returns:

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