-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from jason-neal/develop
Update master after generation of docs.
- Loading branch information
Showing
18 changed files
with
734 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
docs/.build/ | ||
|
||
#sync | ||
.sync/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Read the Docs Configuration File | ||
|
||
# Build PDF aswell as HTML and JSON | ||
formats: | ||
|
||
# Requirements file | ||
requirements_file: | ||
requirements.txt | ||
|
||
python: | ||
version: 3.5 | ||
setup_py_install: true | ||
# From extras_require in setup.py | ||
extra_requirements: | ||
- tests | ||
- docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,84 @@ | ||
# spectrum_overload [![Build Status](https://travis-ci.org/jason-neal/spectrum_overload.svg)](https://travis-ci.org/jason-neal/spectrum_overload) [![Coverage Status](https://coveralls.io/repos/github/jason-neal/spectrum_overload/badge.svg?branch=develop)](https://coveralls.io/github/jason-neal/spectrum_overload?branch=develop) | ||
Learn to use Classes by creating a Spectrum class to use in my Phd work. | ||
# spectrum_overload | ||
| Branch | Docs | Build | Coverage | Code Climate | Code Issues | | ||
| :----: | :---: | :-----: | :----: | :----------: | :---------: | | ||
| master | [![Documentation Status](https://readthedocs.org/projects/spectrum-overload/badge/?version=latest)](http://spectrum-overload.readthedocs.io/en/latest/?badge=latest) | [![Build Status](https://travis-ci.org/jason-neal/spectrum_overload.svg?branch=master)](https://travis-ci.org/jason-neal/spectrum_overload) | [![Coverage Status](https://coveralls.io/repos/github/jason-neal/spectrum_overload/badge.svg?branch=master)](https://coveralls.io/github/jason-neal/spectrum_overload?branch=master) [![Test Coverage](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/coverage.svg)](https://codeclimate.com/github/jason-neal/spectrum_overload/coverage) | [![Code Climate](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/gpa.svg)](https://codeclimate.com/github/jason-neal/spectrum_overload)[![Issue Count](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/issue_count.svg)](https://codeclimate.com/github/jason-neal/spectrum_overload) | [![Code Issues](https://www.quantifiedcode.com/api/v1/project/6e918445f6f344c1af9c32f50718082e/snapshot/origin:master:HEAD/badge.svg)](https://www.quantifiedcode.com/app/project/6e918445f6f344c1af9c32f50718082e?branch=origin/master) | | ||
| develop | [![Documentation Status](https://readthedocs.org/projects/spectrum-overload/badge/?version=develop)](http://spectrum-overload.readthedocs.io/en/latest/?badge=develop) | [![Build Status](https://travis-ci.org/jason-neal/spectrum_overload.svg?branch=develop)](https://travis-ci.org/jason-neal/spectrum_overload) | [![Coverage Status](https://coveralls.io/repos/github/jason-neal/spectrum_overload/badge.svg?branch=develop)](https://coveralls.io/github/jason-neal/spectrum_overload?branch=develop) [![Test Coverage](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/coverage.svg?branch=develop)](https://codeclimate.com/github/jason-neal/spectrum_overload/coverage?branch=develop) | [![Code Climate](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/gpa.svg?branch=develop)](https://codeclimate.com/github/jason-neal/spectrum_overload?branch=develop)[![Issue Count](https://codeclimate.com/github/jason-neal/spectrum_overload/badges/issue_count.svg?branch=develop)](https://codeclimate.com/github/jason-neal/spectrum_overload?branch=develop) | [![Code Issues](https://www.quantifiedcode.com/api/v1/project/6e918445f6f344c1af9c32f50718082e/snapshot/origin:develop:HEAD/badge.svg)](https://www.quantifiedcode.com/app/project/6e918445f6f344c1af9c32f50718082e?branch=origin/develop) | | ||
|
||
## Overview | ||
The purpose of this was project was to learn how to use and create Classes, and to create a Spectrum object to use within my Phd work. | ||
|
||
Ideas to include: | ||
The main goals of this project are basically complete. | ||
|
||
Variables pixel, flux, wavelength | ||
- create a class to contain spectrum | ||
- automatic interpolation | ||
- overloaded operators | ||
especially | ||
- Spectral division (SpectrumA / SpectrumB ) | ||
- Spectral subtraction (SpectrumA - SpectrumB) | ||
- Powers/exponents (Spectrum ** x) | ||
|
||
Spectral slicing method. (wav_selector) | ||
## Installation | ||
Currently to install and use Spectrum class for your own projects. | ||
|
||
Radial velocity shifts | ||
clone the git repository where you want it: | ||
|
||
Wavelength calibration method. pixel->wavelength | ||
https://github.com/jason-neal/spectrum_overload.git | ||
|
||
Spectral subtraction: SpectrumA - SpectrumB | ||
cd into the downloaded directory: | ||
|
||
Spectral division SpectrumA/SpectrumB | ||
cd spectrum_overload | ||
|
||
and install using: | ||
|
||
python setup.py install | ||
|
||
## Other Spectrum Classes: | ||
|
||
There are many other spectrum classes around but None (sofar) that overload the operators | ||
## Usage | ||
To use import the class using : | ||
|
||
from spectrum_overload import Spectrum | ||
... | ||
my_spectrum = Spectrum.Spectrum(flux, xaxis) | ||
|
||
or : | ||
|
||
from spectrum_overload.Spectrum import Spectrum as spec | ||
... | ||
my_spectrum = spec(flux, xaxis) | ||
|
||
or how ever else you would like to import it. | ||
|
||
A tutorial is provided [here](Notebooks/Tutorial.ipynb) to show an example of how to use this class. | ||
|
||
|
||
## Contributions | ||
Contributions are very welcome. | ||
|
||
I would really appreciate user feedback or suggested improvements if you have any. | ||
|
||
Feel free to submit issues or create pull requests. | ||
|
||
|
||
|
||
## Other Spectrum Classes | ||
|
||
There are many other spectrum classes around but I didn't see any that overload the operators. (I could be blind). | ||
|
||
One of these may better suit your needs | ||
|
||
I will list them here as I find them | ||
- https://github.com/crawfordsm/specreduce | ||
- https://github.com/crawfordsm/pyspectrograph/tree/master/PySpectrograph/Spectra | ||
- http://pyspeckit.bitbucket.org/html/sphinx/spectrum.html#pyspeckit.spectrum.classes.Spectrum | ||
- https://github.com/cokelaer/spectrum | ||
-https://github.com/astropy/specutils | ||
- https://github.com/astropy/specutils | ||
|
||
Wow A lot. I probably should not reinvent the wheel too much then... | ||
|
||
It turns out that astropy/specutils is very similar to what I have created but its direction is uncertain at the moment and they do not use overloaded operators and will not implement in the foreseeable future. | ||
|
||
## TO DO | ||
Some tasks still to do: | ||
|
||
- Improve Documentation | ||
- Generate Calibration solution (outside spectrum class)? | ||
- Push a version to pypi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.. _classes | ||
================= | ||
Available Classes | ||
================= | ||
Currently there are two classes available. | ||
- :ref:`Spectrum <spectrumclass>` | ||
- :ref:`DifferentialSpectrum <diffclass>` | ||
|
||
|
||
.. _spectrumclass: | ||
|
||
.. note:: | ||
Unfortunately the auto-documentation for these classes does not build properly yet due to the ``Pyastronomy`` install dependency `issue. <https://github.com/sczesla/PyAstronomy/issues/22>`_ | ||
I hope to see it here soon. | ||
|
||
If you need you can try and build this documentation yourself from the root `spectrum_overload` directory:: | ||
|
||
pip install -e .[docs] # editable installation, install docs dependencies. | ||
cd docs | ||
make html | ||
|
||
This page will be docs/.build/classes.html | ||
|
||
Spectrum | ||
========= | ||
|
||
A class to contain a spectrum. The operators have been overloaded so that you can easily manipulate spectra. | ||
|
||
.. autoclass:: spectrum_overload.Spectrum.Spectrum | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
.. _diffclass: | ||
|
||
Differential Spectrum | ||
===================== | ||
Compute the difference between two :ref:`Spectrum <spectrumclass>` objects. | ||
|
||
This is in an introductory state and need more work. | ||
|
||
Would be useful add an s-profile function from `Ferluga et al. 1997 <http://aas.aanda.org/articles/aas/ps/1997/01/dst6676.ps.gz>`_. The subtraction of two gaussian lines with a RV offset. | ||
|
||
.. autoclass:: spectrum_overload.Differential.DifferentialSpectrum | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.