astropy:docs

Baseliner

class omnifit.utils.Baseliner(ax, spec)[source] [edit on github]

A class for interactive baseliner of spectroscopic data.

The class works by being fed a spectrum and a matplotlib axis on which it should be plotted. The spectrum is then plotted to the given axis, and a number of interactive options are made available to the user.

Left-clicking with the mouse for the first time starts defining a window from the x-axis location of the click. A second click finishes the window between the locations of the first and second click. A third click will finish selecting windows, and perform the baselining. Alternately, right-clicking will cancel the last left-clicking action, allowing misplaced windows to be adjusted.

Two keys are also accepted: Pressing “q” will cause the baselining process to be canceled, effectively skipping the baselining of this spectrum. Pressing “a” will allow an additional window to be defined, assuming one has been defined so far (by left-clicking twice to define its boundaries).

Attributes

windows (list) A list of all the set windows.

Initialise the Baseliner class by giving it the target axis and spectrum.

Parameters:

ax : matplotlib.axis

The matplotlib axis on which the interation will happen.

spec : omnifit.spectrum.BaseSpectrum

The spectrum which will be plotted as the visual reference on the given axis.

Page Contents