Baseline.LpmBaseline#

Baseline.LpmBaseline.py

estimate_lpm_percent(moment)#

Estimate the percentage of low-q plateau in the distribution using the moment.

Parameters:

moment (Moment) – The moment object containing the distribution information.

Returns:

ratio – The estimated percentage of low-q plateau in the distribution.

Return type:

float

compute_lpm_baseline(x, y, return_also_params=False, **kwargs)#

Compute the linear plus minimum baseline for a given curve. The baseline is computed by fitting a linear function to the data and then taking the minimum of the linear function and the data.

Parameters:
  • x (array-like) – The x-coordinates of the curve.

  • y (array-like) – The y-coordinates of the curve.

  • return_also_params (bool, optional) – If True, the function returns a tuple containing the baseline and a dictionary of the slope and intercept of the linear function. If False, it returns only the baseline.

  • **kwargs (dict, optional) –

    Additional keyword arguments.

    • size_sigma : float — if present, an adaptive p_final is computed per-row (replicating legacy behaviour); otherwise the default PERCENTILE_FINAL=10 is used.

    • mask : array-like of bool — if present, only the elements where mask is True are used for fitting. The returned baseline is evaluated at all x positions.

Returns:

baseline – The computed baseline.

Return type:

array-like

class LpmBaseline(icurve)#

Bases: Curve

A class to represent the linear plus minimum baseline of a curve.

x#

The x-coordinates of the baseline.

Type:

array-like

y#

The y-coordinates of the baseline.

Type:

array-like