Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Stolker committed Feb 26, 2019
1 parent 4e1a18e commit 81fefaf
Show file tree
Hide file tree
Showing 17 changed files with 288 additions and 158 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

SPECIES Copyright (C) 2018 Tomas Stolker
species Copyright (C) 2018 Tomas Stolker
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
17 changes: 11 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SPECIES
species
=======

**Spectral and Photometric Examination Code for Investigating Exoplanet and Substellar atmospheres**
**spectral and photometric examination code for investigating exoplanet and substellar atmospheres**

.. image:: https://badge.fury.io/py/species.svg
:target: https://badge.fury.io/py/species
Expand All @@ -24,7 +24,7 @@ SPECIES
.. image:: https://img.shields.io/badge/License-GPLv3-blue.svg
:target: https://github.com/tomasstolker/species/blob/master/LICENSE

SPECIES is a toolkit for analyzing spectral and photometric data of planetary and substellar objects.
*species* is a toolkit for analyzing spectral and photometric data of planetary and substellar objects. It provides a coherent framework to characterize the atmospheres of directly imaged companions by combining data from various resources. A central database is used to store various data sets such as spectral and photometric libraries, atmospheric models, photometry of individual targets, filter transmission curves, and analysis results. There are tools available for creating color-magnitude diagrams, fitting atmospheric models and retrieving the posterior distributions, creating synthetic photometry, plotting spectra, etc. The package has been released on `PyPI <https://pypi.org/project/species/>`_ but is still under active development.

Documentation
-------------
Expand All @@ -34,11 +34,16 @@ Documentation can be found at `http://species.readthedocs.io <http://species.rea
Attribution
-----------

Please cite Stolker et al. in prep. whenever results from SPECIES are used in a publication. Please also make sure to give credit the relevant papers regarding the use of the publicly available data that SPECIES is using, such as the photometric and spectral libraries, atmospheric models, filter transmission curves, and photometry of individual objects. More details will follow.
Please cite Stolker et al. in prep. whenever results from *species* are used in a publication. Please also make sure to give credit to the relevant papers regarding the use of the publicly available data that *species* is profiting from. More details will follow.

Contributing
------------

Contributions are very welcome, please consider forking the repository and creating a pull request. Bug reports can be provided by creating an `issue <https://github.com/tomasstolker/species/issues>`_ on the Github page.

License
-------

Copyright 2018 Tomas Stolker
Copyright 2019 Tomas Stolker

SPECIES is distributed under the GNU General Public License v3. See the LICENSE file for the terms and conditions.
*species* is distributed under the GNU General Public License v3. See the LICENSE file for the terms and conditions.
4 changes: 2 additions & 2 deletions docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ About
Questions & feedback
--------------------

SPECIES is developed by Tomas Stolker (tomas.stolker@phys.ethz.ch). Feel free to send an email for questions, comments, or suggestions.
*species* is developed by Tomas Stolker (tomas.stolker@phys.ethz.ch). Feel free to send an email for questions, comments, or suggestions.

Attribution
-----------

Please cite Stolker et al. in prep. whenever results from SPECIES are used in a publication. Please also make sure to give credit the relevant papers regarding the use of the publicly available data that SPECIES is using, such as the photometric and spectral libraries, atmospheric models, filter transmission curves, and photometry of individual objects. More details will follow.
Please cite Stolker et al. in prep. whenever results from *species* are used in a publication. Please also make sure to give credit the relevant papers regarding the use of the publicly available data that *species* is using, such as the photometric and spectral libraries, atmospheric models, filter transmission curves, and photometry of individual objects. More details will follow.
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Here photometric data of 51 Eri b (Rajan et al. 2017) is added to the database.

import species

species.SpeciesInit("./", "./data")
species.SpeciesInit("./")

magnitudes = {"MKO/NSFCam.J":19.04, "MKO/NSFCam.H":18.99, "MKO/NSFCam.K":18.67, "Keck/NIRC2.Lp":16.20, "Keck/NIRC2.Mp":16.1}

Expand Down
18 changes: 1 addition & 17 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
.. Welcome to SPECIES' documentation!
.. =================================
..
.. .. toctree::
.. :maxdepth: 2
.. :caption: Contents:
..
..
..
.. Indices and tables
.. ==================
..
.. * :ref:`genindex`
.. * :ref:`modindex`
.. * :ref:`search`
.. _index:

Documentation for SPECIES
Documentation for species
=========================

.. toctree::
Expand Down
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
Installation
============

SPECIES can be installed from the |pypi| with the |pip|::
*species* can be installed from the |pypi| with the |pip|::

$ pip install species

Alternatively, the repository can be cloned from |github|::

$ git clone git@github.com:tomasstolker/species.git

In that case, the dependencies can be installed from the SPECIES folder::
In that case, the dependencies can be installed from the *species* folder::

$ pip install -r requirements.txt

The installation can be tested by starting Python in interactive mode and printing the SPECIES version::
The installation can be tested by starting Python in interactive mode and printing the *species* version::

>>> import species
>>> print species.__version__
Expand Down
32 changes: 32 additions & 0 deletions docs/species.data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ species.data package
Submodules
----------

species.data.btnextgen module
-----------------------------

.. automodule:: species.data.btnextgen
:members:
:undoc-members:
:show-inheritance:

species.data.companions module
------------------------------

.. automodule:: species.data.companions
:members:
:undoc-members:
:show-inheritance:

species.data.database module
----------------------------

Expand All @@ -20,6 +36,14 @@ species.data.drift\_phoenix module
:undoc-members:
:show-inheritance:

species.data.filters module
---------------------------

.. automodule:: species.data.filters
:members:
:undoc-members:
:show-inheritance:

species.data.irtf module
------------------------

Expand All @@ -28,6 +52,14 @@ species.data.irtf module
:undoc-members:
:show-inheritance:

species.data.leggett module
---------------------------

.. automodule:: species.data.leggett
:members:
:undoc-members:
:show-inheritance:

species.data.queries module
---------------------------

Expand Down
16 changes: 8 additions & 8 deletions docs/species.plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ species.plot package
Submodules
----------

species.plot.plot\_chisquare module
-----------------------------------

.. automodule:: species.plot.plot_chisquare
:members:
:undoc-members:
:show-inheritance:

species.plot.plot\_mcmc module
------------------------------

Expand All @@ -36,6 +28,14 @@ species.plot.plot\_spectrum module
:undoc-members:
:show-inheritance:

species.plot.util module
------------------------

.. automodule:: species.plot.util
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------
Expand Down
2 changes: 1 addition & 1 deletion species/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from species.plot.plot_mcmc import plot_posterior, \
plot_walkers

from species.plot.plot_photometry import plot_color_magnitude
from species.plot.plot_color import plot_color_magnitude, plot_color_color

from species.plot.plot_spectrum import plot_spectrum

Expand Down
2 changes: 2 additions & 0 deletions species/analysis/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def store_samples(self,
:type sampler: emcee.ensemble.EnsembleSampler
:param model: Atmospheric model.
:type model: str
:param tag: Database tag.
:type tag: str
:param chisquare: Maximum likelihood solution. Tuple with the chi-square value and related
parameter values.
:type chisquare: tuple(float, float)
Expand Down
75 changes: 53 additions & 22 deletions species/core/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Box module.
"""

import numpy as np


def open_box(box):
"""
Expand All @@ -19,19 +17,24 @@ def create_box(boxtype, **kwargs):
:return:
"""

if boxtype == 'model':
if boxtype == 'colormag':
box = ColorMagBox()
box.library = kwargs['library']
box.object_type = kwargs['object_type']
box.filters_color = kwargs['filters_color']
box.filter_mag = kwargs['filter_mag']
box.color = kwargs['color']
box.magnitude = kwargs['magnitude']
box.sptype = kwargs['sptype']

elif boxtype == 'model':
box = ModelBox()
box.model = kwargs['model']
box.type = kwargs['type']
box.wavelength = kwargs['wavelength']
box.flux = kwargs['flux']
box.parameters = kwargs['parameters']

elif boxtype == 'photometry':
box = PhotometryBox()
box.name = kwargs['name']
box.wavelength = kwargs['wavelength']
box.flux = kwargs['flux']

elif boxtype == 'object':
box = ObjectBox()
box.name = kwargs['name']
Expand All @@ -40,6 +43,12 @@ def create_box(boxtype, **kwargs):
box.flux = kwargs['flux']
box.distance = kwargs['distance']

elif boxtype == 'photometry':
box = PhotometryBox()
box.name = kwargs['name']
box.wavelength = kwargs['wavelength']
box.flux = kwargs['flux']

elif boxtype == 'samples':
box = SamplesBox()
box.model = kwargs['model']
Expand All @@ -49,9 +58,10 @@ def create_box(boxtype, **kwargs):

elif boxtype == 'spectrum':
box = SpectrumBox()
box.spectrum = kwargs['spectrum']
box.wavelength = kwargs['wavelength']
box.flux = kwargs['flux']
box.name = kwargs['name']
box.wavelength = np.asarray([kwargs['wavelength']])
box.flux = np.asarray([kwargs['flux']])

elif boxtype == 'synphot':
box = SynphotBox()
Expand All @@ -61,7 +71,7 @@ def create_box(boxtype, **kwargs):
return box


class SpectrumBox:
class ColorMagBox:
"""
Text
"""
Expand All @@ -71,13 +81,13 @@ def __init__(self):
:return:
"""

self.spectrum = None
self.wavelength = None
self.flux = None
self.name = None
self.simbad = None
self.library = None
self.object_type = None
self.filters_color = None
self.filter_mag = None
self.color = None
self.magnitude = None
self.sptype = None
self.distance = None


class ModelBox:
Expand All @@ -97,6 +107,23 @@ def __init__(self):
self.parameters = None


class ObjectBox:
"""
Text
"""

def __init__(self):
"""
:return:
"""

self.name = None
self.filter = None
self.magnitude = None
self.flux = None
self.distance = None


class PhotometryBox:
"""
Text
Expand Down Expand Up @@ -127,7 +154,8 @@ def __init__(self):
self.samples = None
self.chisquare = None

class ObjectBox:

class SpectrumBox:
"""
Text
"""
Expand All @@ -137,12 +165,15 @@ def __init__(self):
:return:
"""

self.name = None
self.filter = None
self.magnitude = None
self.spectrum = None
self.wavelength = None
self.flux = None
self.name = None
self.simbad = None
self.sptype = None
self.distance = None


class SynphotBox:
"""
Text
Expand Down
2 changes: 1 addition & 1 deletion species/data/companions.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_data():
'Paranal/SPHERE.IRDIS_D_H23_2':(18.41, 0.26), # Samland et al. 2017
'Paranal/SPHERE.IRDIS_D_K12_1':(17.55, 0.14), # Samland et al. 2017
'Keck/NIRC2.Lp':(16.20, 0.11), # Rajan et al. 2017
'Keck/NIRC2.Mp':(16.1, 0.5)}}, # Rajan et al. 2017
'Keck/NIRC2.Ms':(16.1, 0.5)}}, # Rajan et al. 2017

'GSC 06214 B':{'distance':108.84,
'app_mag':{'MKO/NSFCam.J':(16.24, 0.04), # Ireland et al. 2011
Expand Down

0 comments on commit 81fefaf

Please sign in to comment.