nirs4all.operators.transforms.signal module
- class nirs4all.operators.transforms.signal.Baseline(*, copy=True)[source]
Bases:
TransformerMixin,BaseEstimatorRemoves baseline (mean) from each spectrum.
- Parameters:
copy (bool, optional) – Flag to indicate whether to make a copy of the object, by default True.
- fit(X, y=None)[source]
Compute the minimum and maximum to be used for later scaling.
- Parameters:
X (array-like of shape (n_samples, n_features)) – The data used to compute the per-feature minimum and maximum used for later scaling along the features axis.
y (None) – Ignored.
- Returns:
self – Fitted Baseline object.
- Return type:
- nirs4all.operators.transforms.signal.baseline(spectra)[source]
Removes baseline (mean) from each spectrum.
- Parameters:
spectra (numpy.ndarray) – NIRS data matrix.
- Returns:
Mean-centered NIRS data matrix.
- Return type:
- nirs4all.operators.transforms.signal.detrend(spectra, bp=0)[source]
Perform spectral detrending to remove linear trend from data.
- Parameters:
spectra (numpy.ndarray) – NIRS data matrix.
bp (list, optional) – A sequence of break points. If given, an individual linear fit is performed for each part of data between two break points. Break points are specified as indices into data. Default is 0.
- Returns:
Detrended NIR spectra.
- Return type:
- nirs4all.operators.transforms.signal.gaussian(spectra, order=2, sigma=1)[source]
Computes 1D gaussian filter using scipy.ndimage gaussian 1d filter.
- Parameters:
spectra (numpy.ndarray) – NIRS data matrix.
order (float, optional) – Order of the derivation.
sigma (int, optional) – Sigma of the gaussian.
- Returns:
Gaussian NIR spectra.
- Return type: