Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Full documentation of the core code
Browse files Browse the repository at this point in the history
WIP #237
  • Loading branch information
stscieisenhamer committed Dec 28, 2016
1 parent bf200d8 commit 33f7191
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 26 deletions.
46 changes: 41 additions & 5 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,58 @@ SpecViz API
Analysis Functions
------------------
.. automodapi:: specviz.analysis
:no-heading:
:no-heading:


SpecViz core
------------
.. automodapi:: specviz.core
:no-heading:

Data Objects
^^^^^^^^^^^^
.. automodapi:: specviz.core.data
:no-heading:
:no-main-docstr:
:headings:""

Object Event Handling
^^^^^^^^^^^^^^^^^^^^^
.. automodapi:: specviz.core.comms
:no-heading:
:no-main-docstr:
:headings:""

Spectrum Layer Plotting
^^^^^^^^^^^^^^^^^^^^^^^
.. automodapi:: specviz.core.plots
:no-heading:
:no-main-docstr:
:headings:""

Emission/Absorption Line list utilities
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodapi:: specviz.core.linelist
:no-heading:
:no-main-docstr:
:headings:""

Thread Helpers
^^^^^^^^^^^^^^
.. automodapi:: specviz.core.threads
:no-heading:
:no-main-docstr:
:headings:""


Interfaces
----------
.. automodapi:: specviz.interfaces
:no-heading:
:no-heading:


I/O module
----------
.. automodapi:: specviz.io
:no-heading:
:no-heading:

.. automodapi:: specviz.io.yaml_loader
:no-heading:
2 changes: 1 addition & 1 deletion specviz/core/comms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Object Event Handling
Elevator Pitch: The singleton `Dispatch` object manages the
The singleton `Dispatch` object manages the
set of `EventNode` events. Handlers or **listeners** are attached
to `EventNode`s. The `DispatchHandle` decorator is used to
decorate classes that handle events.
Expand Down
12 changes: 10 additions & 2 deletions specviz/core/data.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""This module handles spectrum data objects."""
"""
Data Objects
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)

# STDLIB
import logging
logging.basicConfig(level=logging.INFO)
import re

# THIRD-PARTY
Expand All @@ -13,6 +14,13 @@
from ..third_party.py_expression_eval import Parser
from specutils.core.generic import Spectrum1DRef

logging.basicConfig(level=logging.INFO)

__all__ = [
'Spectrum1DRefLayer',
'Spectrum1DRefModelLayer',
]


class Spectrum1DRefLayer(Spectrum1DRef):
"""
Expand Down
8 changes: 6 additions & 2 deletions specviz/core/linelist.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Utilities and classes to handle Emission/Absorption Line lists
Emission/Absorption Line list utilities
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
Expand All @@ -10,6 +10,11 @@

from astropy.table import Table, vstack

__all__ = [
'LineList',
'ingest',
]

FORMAT = 'line_list'
COLUMN_NAME = 'name'
COLUMN_START = 'start'
Expand All @@ -18,7 +23,6 @@
ID_COLUMN = 'Line ID'
UNITS_COLUMN = 'units'


def ingest(range):
"""
Returns a list with LineList instances.
Expand Down
30 changes: 18 additions & 12 deletions specviz/core/plots.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Line plotting classes
Spectrum Layer Plotting
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
Expand All @@ -12,17 +12,23 @@
import logging
import numpy as np

AVAILABLE_COLORS = cycle([(0, 0, 0),
(0.2980392156862745, 0.4470588235294118, 0.6901960784313725),
(0.3333333333333333, 0.6588235294117647, 0.40784313725490196),
(0.7686274509803922, 0.3058823529411765, 0.3215686274509804),
(0.5058823529411764, 0.4470588235294118, 0.6980392156862745),
(0.8, 0.7254901960784313, 0.4549019607843137),
(0.39215686274509803, 0.7098039215686275, 0.803921568627451),
(0.2980392156862745, 0.4470588235294118, 0.6901960784313725),
(0.3333333333333333, 0.6588235294117647, 0.40784313725490196),
(0.7686274509803922, 0.3058823529411765, 0.3215686274509804),
(0.5058823529411764, 0.4470588235294118, 0.6980392156862745)])
__all__ = [
'LinePlot',
]

AVAILABLE_COLORS = cycle([
(0, 0, 0),
(0.2980392156862745, 0.4470588235294118, 0.6901960784313725),
(0.3333333333333333, 0.6588235294117647, 0.40784313725490196),
(0.7686274509803922, 0.3058823529411765, 0.3215686274509804),
(0.5058823529411764, 0.4470588235294118, 0.6980392156862745),
(0.8, 0.7254901960784313, 0.4549019607843137),
(0.39215686274509803, 0.7098039215686275, 0.803921568627451),
(0.2980392156862745, 0.4470588235294118, 0.6901960784313725),
(0.3333333333333333, 0.6588235294117647, 0.40784313725490196),
(0.7686274509803922, 0.3058823529411765, 0.3215686274509804),
(0.5058823529411764, 0.4470588235294118, 0.6980392156862745)
])


class LinePlot(object):
Expand Down
6 changes: 5 additions & 1 deletion specviz/core/threads.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Threaded tasks
Thread Helpers
"""
from qtpy.QtCore import QThread, Signal
import os
Expand All @@ -10,6 +10,10 @@

import astropy.io.registry as io_registry

__all__ = [
'FileLoadThread',
'FitModelThread',
]

class FileLoadThread(QThread):
"""
Expand Down
9 changes: 6 additions & 3 deletions specviz/io/yaml_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
from specviz.core import linelist
from specviz.core.linelist import LineList

__all__ = ['fits_reader', 'fits_identify',
'ascii_reader', 'ascii_identify',
'linelist_reader', 'linelist_identify']
__all__ = [
'AsciiYamlRegister',
'FitsYamlRegister',
'LineListYamlRegister',
'YamlRegister',
]

# Loader automatically falls back to these units for some cases
default_waveunit = u.Unit('Angstrom')
Expand Down

0 comments on commit 33f7191

Please sign in to comment.