fitspy.baseline module

Class dedicated to spectrum baseline manipulation

class fitspy.baseline.BaseLine

Bases: object

Class dedicated to spectrum baseline manipulation

points

List of the (x,y) baseline points coordinates

Type:

list of 2 lists

order_max

Maximum order of the baseline polynomial evaluation

Type:

int

distance

Minimum distance between baseline point to consider when doing automatic detection with ‘Spectrum.auto_baseline’

Type:

float

sigma

Smoothing coefficient (standard deviation) related to a gaussian filtering when defining baseline attached points to the spectrum

Type:

float

attached

Activation key for attach the baseline points to the spectrum

Type:

bool

is_subtracted

Key used to indicate whether the baseline has been subtracted from the spectrum

Type:

bool

add_point(x, y)

Add point in the baseline

attach_points(x, y)

Return baseline points attached to (x,y) ‘spectrum’ profile coords

load_baseline(fname)

Load baseline from ‘fname’ with 1 header line and 2 (x,y) columns

eval(x, y=None)

Evaluate the baseline on a ‘x’ support and a ‘y’ attached profile possibly smoothed with a gaussian filter

plot(ax, x=None, y=None, label='Baseline', show_all=True)

Plot the baseline and its related points

Parameters:
  • ax (Matplotlib.Axes) – Axis to work with

  • x (iterable of floats, optional) – Support to consider for the baseline plotting. If None, create a support from the baseline extrema points

  • y (iterable of floats, optional) – Values for baseline points attachment (if provided), sharing the same x coordinates

  • label (str, optional) – Label displays in the figure

  • show_all (bool, optional) – Activation key to display the primary baseline components (before attachment)