spectrochempy.msc

msc(dataset, reference=None, dim='y', inplace=False)[source]

Multiplicative Scatter Correction (MSC).

MSC corrects for multiplicative and additive effects caused by light-scattering or path-length variations. Each observation is linearly regressed against a reference spectrum and corrected as:

\[x_i^\prime = \frac{x_i - a_i}{b_i}\]

where \(a_i\) and \(b_i\) are the intercept and slope of the least-squares fit of observation \(i\) to the reference.

Parameters:
  • dataset (NDDataset) – The input data (2-D: observations Γ— features).

  • reference (NDDataset or array-like, optional) – 1-D reference spectrum. If None, the mean spectrum is used.

  • dim (str or int, optional, default:’y’) – Dimension that identifies individual observations (spectra).

  • inplace (bool, optional, default:False) – If True, MSC is performed in place.

Returns:

NDDataset – The MSC-corrected dataset.

Examples

>>> dataset = scp.read("irdata/nh4.spg")
>>> nd = dataset.msc()

See also

snv

Standard Normal Variate correction.

autoscale

General mean-center and unit-variance scaling.