.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/1_Spectroscopy/plot_2_slope.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_1_Spectroscopy_plot_2_slope.py: Calculating the spectral gradient --------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 5-31 .. image-sg:: /gallery/1_Spectroscopy/images/sphx_glr_plot_2_slope_001.png :alt: plot 2 slope :srcset: /gallery/1_Spectroscopy/images/sphx_glr_plot_2_slope_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none 000334 slope 5.091623 slope_unc 0.029991 | .. code-block:: default from cana.datasets import getspectrum import cana # First load an spectrum # you can do: spec = cana.loadspec('path to your spectrum file') # For the example, we will just gonna use one from the available datasets. spec = getspectrum('000334', ref='primass') # Measuring the slope # Defaults: wmin=0.4, wmax=0.9, norm=0.55, errormethod='rms', # error_param=None, montecarlo=1000, speckwargs=None slope = cana.slope(spec) # print the results print(slope) # plot the results slope.plot(show=True) # Note: cana.slope can also get the direct spectrum file path, # or a list of spectra file. In this case it would return the a # pandas table with results. .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 7.201 seconds) .. _sphx_glr_download_gallery_1_Spectroscopy_plot_2_slope.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_2_slope.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_2_slope.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_