pybaselines.Baseline2D.individual_axes

Baseline2D.individual_axes(data, axes=(0, 1), method='asls', method_kwargs=None)[source]

Applies a one dimensional baseline correction method along each row and/or column.

Parameters:
dataarray_like, shape (M, N)

The y-values of the measured data.

axes(0, 1) or (1, 0) or 0 or 1, optional

The axes along which to apply baseline correction. The order dictates along which axis baseline correction is first applied. Default is (0, 1), which applies baseline correction along the rows first and then the columns.

methodstr, optional

A string indicating the algorithm to use for fitting the baseline of each row and/or column; can be any one dimensional algorithm in pybaselines. Default is 'asls'.

method_kwargssequence[dict] or dict, optional

A sequence of dictionaries of keyword arguments to pass to the selected method function for each axis in axes. A single dictionary designates that the same keyword arguments will be used for each axis. Default is None, which will use an empty dictionary.

Returns:
numpy.ndarray, shape (M, N)

The calculated baseline.

paramsdict

A dictionary with the following items:

  • 'params_rows': dict[str, list]

    Only if 0 is in axes. A dictionary of the parameters for each fit along the rows. The items within the dictionary will depend on the selected method.

  • 'params_columns': dict[str, list]

    Only if 1 is in axes. A dictionary of the parameters for each fit along the columns. The items within the dictionary will depend on the selected method.

  • 'baseline_rows': numpy.ndarray, shape (M, N)

    Only if 0 is in axes. The fit baseline along the rows.

  • 'baseline_columns': numpy.ndarray, shape (M, N)

    Only if 1 is in axes. The fit baseline along the columns.

Raises:
ValueError

Raised if method_kwargs is a sequence with length greater than axes or if the values in axes are duplicates.

Notes

If using array-like inputs within method_kwargs, they must correspond to their one-dimensional counterparts. For example, weights must be one-dimensional and have a length of M or N when used for fitting the rows or columns, respectively. Correctness of this is NOT verified within this method.