/
You are viewing the documentation for metbit 8.7.7. Change release context

metbit.baseline

Baseline correction utilities for 1D NMR spectra.

import metbit.baseline

Functions

baseline_correct(X: pd.DataFrame, method: Literal['asls', 'arpls', 'airpls', 'modpoly', 'imodpoly', 'rubberband']='asls', x: Optional[np.ndarray]=None, return_baseline: bool=False, **kwargs: Any)

Apply baseline correction across spectra in a DataFrame.

Parameters

Xpd.DataFrame

Rows are spectra; columns are ppm (x-axis) values.

methodstr
One of'asls', 'arpls', 'airpls', 'modpoly', 'imodpoly', 'rubberband'.
xnp.ndarray, optional

Explicit x-axis to use (same length as columns). If None, tries to infer from `X.columns` by casting to float, else uses index positions.

return_baselinebool

If True, also return a DataFrame of the estimated baselines. **kwargs : Any Algorithm-specific keyword arguments (e.g., lam, p, max_iter, poly_order, ...).

Returns

correctedpd.DataFrame

Baseline-corrected spectra.

baseline_dfpd.DataFrame (optional)

Estimated baselines (returned if return_baseline=True).

bline(X: pd.DataFrame, lam: float=10000000.0, max_iter: int=30)

Backwards-compatible wrapper for ALS baseline correction.

Parameters

Xpd.DataFrame

Rows are spectra; columns are ppm values.

lamfloat

Smoothing parameter for ASLS.

max_iterint

Max iterations for ASLS.

Source

metbit/baseline.py at v8.7.7
Downloads for metbit 8.7.7PyPI and GitHub measure different distribution channels. Statistics refresh daily.

Counts are distribution activity, not unique users. GitHub source archives and Git clones are not included. Sources: PyPI Stats, Pepy, ClickPy, and GitHub Releases.

metbit 8.7.7 documentation