.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/2_Experimental_spectra/plot_remove_baseline.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note You can download :ref:`below ` the full example code and run it with 🔬 `Radis-Lab `__, .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_2_Experimental_spectra_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/2_Experimental_spectra/images/sphx_glr_plot_remove_baseline_001.png :alt: plot remove baseline :srcset: /auto_examples/2_Experimental_spectra/images/sphx_glr_plot_remove_baseline_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none | .. code-block:: Python # 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.264 seconds) .. _sphx_glr_download_auto_examples_2_Experimental_spectra_plot_remove_baseline.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_remove_baseline.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_remove_baseline.py `