{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Calculating the spectral gradient\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from cana.datasets import getspectrum\nimport cana\n\n# First load an spectrum\n# you can do: spec = cana.loadspec('path to your spectrum file')\n\n# For the example, we will just gonna use one from the available datasets.\n\n\nspec = getspectrum('000334', ref='primass')\n\n# Measuring the slope\n# Defaults: wmin=0.4, wmax=0.9, norm=0.55, errormethod='rms',\n#           error_param=None, montecarlo=1000, speckwargs=None\nslope = cana.slope(spec)\n\n# print the results\nprint(slope)\n\n# plot the results\nslope.plot(show=True)\n\n# Note: cana.slope can also get the direct spectrum file path,\n# or a list of spectra file. In this case it would return the a\n# pandas table with results."
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.9"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}