Protomix.baseline_correction

baseline_correction(spectra_df: DataFrame, method='als', lambda_=100, porder=1, maxIter=100, lam=10000.0, ratio=0.05)[source]

Apply different baseline correction algorithms to each row of a DataFrame.

Parameters:
  • spectra_df (pd.DataFrame) – DataFrame where each row is a spectrum to be baseline corrected.

  • method (str) – Method for baseline correction. Options are “als”, “arpls”, “airpls”.

  • lambda (float) – Regularization parameter for ALS and AIRPLS.

  • porder (float) – Asymmetry parameter for ALS.

  • maxIter (int) – Maximum number of iterations for ALS and AIRPLS.

  • lam (float) – Lambda parameter for ARPLS.

  • ratio (float) – Ratio parameter for ARPLS.

Returns:

DataFrame with baseline corrected spectra.

Return type:

pd.DataFrame