Skip to main content

Crate baselines

Crate baselines 

Source
Expand description

Baseline correction algorithms for one-dimensional signals and spectra.

This crate is an independent Rust implementation inspired by the baseline correction literature. The Python project pybaselines is used as an API and behavioral reference, not as copied implementation code.

The simplest Rust API estimates or corrects a signal with one function:

use baselines::prelude::*;

let y = vec![1.0, 1.1, 4.2, 1.2, 1.0];
let corrected = correct(&y)?;

Use Baseline and Baseline2D when you need to tune parameters. The family modules remain public for explicit parameter structs, workspace reuse, and direct behavioral comparisons against published examples.

Re-exports§

pub use api::Baseline;
pub use api::Baseline2D;
pub use api::BaselineXY;
pub use classification::ClassificationFit;
pub use data::MatrixLayout;
pub use data::MatrixShape;
pub use data::MatrixView;
pub use data::MatrixViewMut;
pub use error::BaselineError;
pub use error::Result;
pub use fit::Fit;
pub use fit::Fit1D;
pub use fit::Fit2D;
pub use fit::FitHistory;
pub use fit::FitReport;
pub use simple::Method;
pub use simple::Method2D;
pub use simple::baseline;
pub use simple::baseline_2d;
pub use simple::baseline_2d_with;
pub use simple::baseline_with;
pub use simple::correct;
pub use simple::correct_2d;
pub use simple::correct_2d_with;
pub use simple::correct_with;

Modules§

api
Ergonomic method-chain API.
backend
Execution backends.
classification
Classification-style baseline algorithms.
data
Slice-based data views used by one- and two-dimensional algorithms.
error
Error types used by baseline correction algorithms.
fit
Fit outputs and convergence metadata.
gallery
Gallery Outputs
linalg
Linear algebra helpers.
misc
Miscellaneous baseline algorithms.
morphology
Morphological and smoothing baseline algorithms.
optimizers
Optimizing and meta-algorithm baseline routines.
polynomial
Polynomial baseline algorithms.
prelude
Common imports for the simple and method-chain APIs.
reference_examples
Reference Gallery Examples
simple
Small, batteries-included entry points for common baseline corrections.
smoothing
Smoothing baseline algorithms.
spline
Penalized spline baseline algorithms.
two_d
Two-dimensional baseline correction algorithms.
whittaker
Whittaker-style penalized least-squares baseline algorithms.
workspace
Shared validation and reusable workspaces.