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 (
NDDatasetor array-like, optional) β 1-D reference spectrum. IfNone, the mean spectrum is used.dim (
strorint, optional, default:βyβ) β Dimension that identifies individual observations (spectra).inplace (
bool, optional, default:False) β IfTrue, MSC is performed in place.
- Returns:
NDDatasetβ The MSC-corrected dataset.
Examples
>>> dataset = scp.read("irdata/nh4.spg") >>> nd = dataset.msc()