Skip to content

Commit

Permalink
Merge pull request #4 from bmorris3/docs
Browse files Browse the repository at this point in the history
Adding narrative docs
  • Loading branch information
tzdwi committed Oct 31, 2017
2 parents 33e3b98 + 6185e51 commit 4e5a59a
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- MAIN_CMD='python setup.py'
- SETUP_CMD='test -V'
- SETUP_CMD='test -V --remote-data'
- CONDA_CHANNELS='astropy astropy-ci-extras conda-forge'
- CONDA_DEPENDENCIES='specutils astroquery matplotlib scipy'
- EVENT_TYPE='pull_request push'
Expand All @@ -51,7 +51,7 @@ matrix:
include:
# Try MacOS X
- os: osx
env: SETUP_CMD='test'
env: SETUP_CMD='test -V --remote-data'

# Check for sphinx doc build warnings - we do this first because it
# may run for a long time
Expand Down
2 changes: 1 addition & 1 deletion aesop/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .activity import true_h_centroid, true_k_centroid

__all__ = ["EchelleSpectrum", "slice_spectrum", "interpolate_spectrum",
"cross_corr"]
"cross_corr", "Spectrum1D"]


class Spectrum1D(object):
Expand Down
91 changes: 91 additions & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.. _getting_started:

.. include:: references.txt

***************
Getting started
***************

Contents
========

* :ref:`getting_started-example`
* :ref:`getting_started-norm`

.. _getting_started-example:

Opening example spectra
-----------------------

Example ARCES spectra are available online for you to work with. You can
download them via Python like this:

.. code-block:: python
>>> from astropy.utils.data import download_file
>>> target_url = 'http://staff.washington.edu/bmmorris/docs/KIC8462852.0065.wfrmcpc.fits'
>>> spectroscopic_standard_url = 'http://staff.washington.edu/bmmorris/docs/BD28_4211.0034.wfrmcpc.fits'
>>> target_path = download_file(target_url, show_progress=False) # doctest: +REMOTE_DATA
>>> standard_path = download_file(spectroscopic_standard_url, show_progress=False) # doctest: +REMOTE_DATA
This will download temporary copies of a Kepler target, KIC 8462852, and
spectroscopic standard O star BD+28 4211. We first create an
`~aesop.EchelleSpectrum` object for each star:

.. code-block:: python
>>> from aesop import EchelleSpectrum
>>> target_spectrum = EchelleSpectrum.from_fits(target_path)
>>> standard_spectrum = EchelleSpectrum.from_fits(standard_path)
You can check basic metadata for an `~aesop.EchelleSpectrum` object by printing
it:

.. code-block:: python
>>> print(target_spectrum)
<EchelleSpectrum: 107 orders, 3506.8-10612.5 Angstrom>
The `~aesop.EchelleSpectrum` object behaves a bit like a Python list -- it
supports indexing, where the index counts the order number, starting with index
zero for the order with the shortest wavelengths. Elements of the
`~aesop.EchelleSpectrum` are `~aesop.Spectrum1D` objects. Suppose you want to
make a quick plot of the 32nd order of the target's echelle spectrum:

.. code-block:: python
order32 = target_spectrum[32]
order32.plot()
.. plot::

from astropy.utils.data import download_file

target_url = 'http://staff.washington.edu/bmmorris/docs/KIC8462852.0065.wfrmcpc.fits'
spectroscopic_standard_url = 'http://staff.washington.edu/bmmorris/docs/BD28_4211.0034.wfrmcpc.fits'

target_path = download_file(target_url)
standard_path = download_file(spectroscopic_standard_url)

from aesop import EchelleSpectrum

target_spectrum = EchelleSpectrum.from_fits(target_path)
standard_spectrum = EchelleSpectrum.from_fits(standard_path)

order32 = target_spectrum[32]
order32.plot()

import matplotlib.pyplot as plt
plt.show()

You can see the H-alpha absorption in this O star at 6562 Angstroms.

.. _getting_started-norm:

Normalizing your spectra
------------------------

You can continuum-normalize your echelle spectra with the...
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You can view the
:caption: Contents:

install
getting_started
api


Expand Down

0 comments on commit 4e5a59a

Please sign in to comment.