Skip to content

Commit

Permalink
Merge pull request #14 from jason-neal/develop
Browse files Browse the repository at this point in the history
Get docs branch up to date with develop.
  • Loading branch information
jason-neal committed Apr 21, 2017
2 parents 0dced37 + a715e39 commit e202e8d
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 76 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#sync
.sync/

#notebook and html
#*.ipynb
*.html
Expand Down
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ before_install:
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
install:
install:
#- conda install --yes python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib #nose atlas dateutil pandas statsmodels
# Coverage packages are on my binstar channel
#- conda install --yes -c dan_blanchard python-coveralls nose-cov
Expand All @@ -32,19 +32,19 @@ install:
- python setup.py install


- pip install python-coveralls
- pip install pytest-cov
# install:
- pip install pytest-cov python-coveralls
- pip install -r requirements.txt
# install:
# - pip install numpy
# - pip install tox
# - pip install matplotlib
# - pip install hypothesis

# command to run tests
script:
script:
# - py.test -cov coveralls --cov-report term-missing
# - py.test --cov=spectrum_overload spectrum_overload/ --cov-report term-missing
- py.test --cov=spectrum_overload --cov-report term-missing

after_success:
- coveralls
- coveralls
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pyastronomy
numpy
astropy
scipy
hypothesis
pytest
pytest-cov
python-coveralls
42 changes: 42 additions & 0 deletions spectrum_overload/Differential.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""Differential Class which takes the difference between two spectral types."""
from spectrum_overload.Spectrum import Spectrum
# Begin Feburary 2017


class DifferentialSpectrum(object):
"""Make differential spectrum."""

def __init__(self, Spectrum1, Spectrum2):
"""Initalise lass with both spectra."""
if not(Spectrum1.calibrated and Spectrum2.calibrated):
raise ValueError("Input spectra are not calibrated.")

self.spec1 = Spectrum1
self.spec2 = Spectrum2
self.params = None
self.diff = None

def barycentric_correct(self):
"""Barycentic correct each spectra."""
pass

def rest_frame(self, frame):
"""Change restframe to one of the spectra."""
pass

def diff(self):
"""Calculate difference between the two spectra."""
# TODO: Access interpolations
return self.spec1 - self.spec2

def sort(self, method="time"):
"""Sort spectra in specific order. e.g. time, reversed."""
pass

def swap(self):
"""Swap order of the two spectra."""
self.spec1, self.spec2 = self.spec2, self.spec1

def add_orbital_params(self, params):
"""Acecpt dictionary of orbital parameters to use for shifting frames."""
self.params = params
Loading

0 comments on commit e202e8d

Please sign in to comment.