.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_remove_baseline.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Run this example online : - Click :ref:`here ` to download the full example code - Then start `Radis-Lab `__, upload the Jupyter notebook, and run it from there. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_remove_baseline.py: ================= Remove a baseline ================= Remove a baseline from an experimental spectrum : .. GENERATED FROM PYTHON SOURCE LINES 10-31 .. image-sg:: /auto_examples/images/sphx_glr_plot_remove_baseline_001.png :alt: plot remove baseline :srcset: /auto_examples/images/sphx_glr_plot_remove_baseline_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none | .. code-block:: default # Get a spectrum: from radis import load_spec from radis.test.utils import getTestFile s_exp = ( load_spec(getTestFile(r"CO2_measured_spectrum_4-5um.spec"), binary=True) .crop(4300, 5000) .sort() ) sb = s_exp.get_baseline(algorithm="als") s_exp.plot() sb.plot(nfig="same", lw=3) # Plot the spectrum minus the baseline : s = s_exp - sb s.plot(nfig="same", lw=2, zorder=0) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.275 seconds) .. _sphx_glr_download_auto_examples_plot_remove_baseline.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_remove_baseline.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_remove_baseline.ipynb `