Warning

You are reading the documentation related to the development version. Go here if you are looking for the documentation of the stable release.

spectrochempy.BaselineCorrector

class BaselineCorrector(X=None, initial_ranges=None)[source]

Launch a GUI for baseline corrections.

Wrapper of BaselineCorrection(X), with widgets for dataset slicing, input parameters and graphical output. Should be run in jupyter notebook (does not always run properly in jupyter lab) with the widget backend (magic %matplotlib widget ).

Parameters
  • X (NDDataset, default: None) – The NDDataset to process. If None, an upload button can be used to load data.

  • initial_ranges (list, optional, default: None) – The initial regions where to compute the baseline. If not given, 5% on each side of the spectra will be taken as a starting range’s list.

original[source]

The (sliced) NDDataset, without baseline correction.

Type

NDDataset

corrected

The baseline corrected NDDataset.

Type

NDDataset

baseline

The baselines.

Type

NDDataset

See also

BaselineCorrection

Baseline correction method.

Notes

The BaselineCorrector() widget can be used in jupyter notebook and jupyter lab.

  • The GUI buttons are the following:
    • upload: allows uploading files. Uploading file will trigger the reading and processing with default parameters (linear baseline with ranges of 5% of the x-axis at both ends). If a NDDataset has been passed or a file has been previously loaded, BaselineCorrector will be reset with the new file(s).

    • process: triggers baseline correct and plotting of original dataset + baseline and corrected datasets

    • save as: save the baseline corrected dataset

  • The x slice and y slice textboxes can be used to slice the initial dataset with the usual [start:stop:step] format. In both dimensions, coordinates or indexes can be used (for example, [3000.0::2] or [:100:5] are valid entries).

  • Method and Interpolation dropdown fields are self explaining, see BaselineCorrection() for details.

  • Ranges should be entered as a series of intervals or wavenumbers, e.g.

    ` [5900.0, 5400.0], 2000.0, [1550.0, 1555.0], `

Examples

Runs only in Jupyter notebook/ipython environment. See : User’s Guide > Processing > Baseline corrections for an example.

[In 2] X = scp.read_omnic(“irdata/nh4y-activation.spg”)

out = scp.BaselineCorrector(X)

Examples using spectrochempy.BaselineCorrector