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

Commit

Permalink
Merge pull request #595 from nmearl/update-docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
nmearl committed Nov 30, 2018
2 parents a7f0351 + 02ac29e commit f1c74b8
Show file tree
Hide file tree
Showing 24 changed files with 177,328 additions and 85,191 deletions.
1 change: 1 addition & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ dependencies:
- numpy
- pip:
- sphinx-astropy
- sphinx-rtd-theme
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ env:

# List other runtime dependencies for the package that are available as
# pip packages here.
- PIP_DEPENDENCIES='pyqt5 pyqtgraph qtawesome qtpy click git+https://github.com/astropy/specutils sphinx-astropy pytest-astropy pytest-qt'
- PIP_DEPENDENCIES='pyqt5 pyqtgraph qtawesome qtpy click specutils>=0.5.1 sphinx-astropy sphinx-rtd-theme pytest-astropy pytest-qt'

# Conda packages for affiliated packages are hosted in channel
# "astropy" while builds for astropy LTS with recent numpy versions
Expand Down
Binary file added docs/_static/disabled_data_item.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/loader_select.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/logo_icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/open_file_dialog.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_static/spec_icon.png
Binary file not shown.
Binary file added docs/_static/specviz_horizontal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/title_horizontal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,23 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. To override the custom theme, set this to the
# name of a builtin theme or the name of a custom theme in html_theme_path.
#html_theme = None
html_theme = "sphinx_rtd_theme"


# Please update these texts to match the name of your package.
html_theme_options = {
'logotext1': 'spec', # white, semi-bold
'logotext2': 'viz', # orange, light
'logotext3': ':docs' # white, light
}
# html_theme_options = {
# 'logotext1': 'spec', # white, semi-bold
# 'logotext2': 'viz', # orange, light
# 'logotext3': ':docs' # white, light
# }


# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = '_static/specviz_logo.png'
html_logo = '_static/logo_icon.png'

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand Down
23 changes: 0 additions & 23 deletions docs/getting-started.rst

This file was deleted.

90 changes: 90 additions & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.. _specviz-start:

Getting Started
===============

Loading a Basic Spectrum
------------------------

Lets start by loading a simple, known spectrum. If you followed the steps in
:ref:`specviz-launching`, you should see the specviz window up, but without a
spectrum.

There are two options to load a spectrum data file:

1. Load the spectrum with a pre-defined data loader, or a custom user-defined data loader.
2. Utilize the :doc:`Loader Wizard </loader_wizard>` to create a new custom loader, and use that to load your data.

Either way, the specific loader for your data can be selected from the drop
down list in the open file dialog

.. image:: _static/open_file_dialog.png

.. image:: _static/loader_select.png

Once the file has been loaded, you will be greeted with a plotted spectrum.


Exporting Spectra
-----------------

A user can export a given spectrum in the data list by highlighting the
spectrum and clicking the ``Export Data`` button in the main toolbar. This
will provide the user with a save file dialog where they may choose where to
save the exported spectrum file.

.. note::

`ECSV <http://docs.astropy.org/en/stable/api/astropy.io.ascii.Ecsv.html>`_
is currently the only supported export format. This will change in the
future as more exporting formats are supported in the specutils package.


Workspaces and Plots
--------------------

Loaded data is added to the global data list for the entire workspace. A
workspace is an instance of the SpecViz application. Several can be
open at once and more can be added by selecting ``File > New Workspace`` from
the menu bar. Workspaces are completely independent of one another, and the
user can have as many workspaces are they wish.

Plots are the visual representation of a selection of data items within a
particular workspace. A user can have as many plots as they wish, and new plots
can be created by clicking the ``New Plot`` button in the main toolbar.
Likewise, plot windows can be removed by clicking the ``X`` button in the plot
tab.

Plots all share the same data list within a workspace. The caveat is that plots
can only show data that have equivalent units. Any data that cannot be added
to a plot will show as disabled in the data list.

.. image:: _static/disabled_data_item.png

Clicking the checkbox next to an item in the data list will plot the data
item on the current plot.


Using Regions
-------------

Interesting regions can be defined by adding an ROI to the plot. This is done
via the ``Add Region`` button in the plot toolbar. Multiple regions can be
used when defining e.g. areas the user might wish to use for model fitting.

A blue highlighted region is considered the _active_ region, and will in cases
where it is imported (e.g. statistics), will be used to define the region
used in the calculations.

.. note::

Currently, only one region can be the "selected" region. This will change
in the future to allow a subset of plotted region to be defined as
"selected".

Removing a region is accomplished by clicking the ``Remove Region`` button.
Only the currently selected region is removed.




41 changes: 33 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
Specviz
=======
.. image:: _static/title_horizontal.png

This is the documentation for specviz, a qt-based interactive GUI for
visualizing astronomical spectra. It is written in the Python programming
language, and therefore leverages the `specutils` package, and can be run
anywhere Python is supported (See .
|
Introduction
============

SpecViz is a tool for visualization and quick-look analysis of 1D astronomical
spectra. It is written in the Python programming language, and therefore can be
run anywhere Python is supported (see :ref:`specviz-installation`). SpecViz is
built on top of the `SpecUtils <https://specutils.rtfd.io>`_ Astropy-affiliated
python library, providing a visual, interactive interface to the analysis
capabilities in that library.

SpecViz allows spectra to be easily plotted and examined. It supports
flexible spectral units conversions, custom plotting attributes, interactive
selections, multiple plots, and other features.

SpecViz notably includes a measurement tool for spectral lines which
enables the user, with a few mouse actions, to perform and record measurements.
It has a model fitting capability that enables the user to create simple
(e.g., single Gaussian) or multi-component models (e.g., multiple Gaussians for
emission and absorption lines in addition to regions of flat continuua).
A typical data-analysis workflow might involve data exploration using SpecViz
and then scripting to create more complex measurements or modeling workflows
using SpecUtils.

SpecViz will soon include the ability to:

- Measure the average of multiple spectra, detrending, and apply Fourier filters.
- Interactively renormalize data from spectral templates.
- And more...


Installation and Setup
Expand All @@ -23,9 +48,9 @@ Using SpecViz
.. toctree::
:maxdepth: 2

getting-started
getting_started
unit_conversion
arithmetic-layer
loader_wizard
model_fitting
stats_sidebar
statistics
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. highlight:: console

.. _specviz_installation:
.. _specviz-installation:

Installation
============
Expand Down
26 changes: 20 additions & 6 deletions docs/launching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@
Launching SpecViz
=================

Once you've installed SpecViz, you can launch it via the command line::
Once the user has installed SpecViz, they can launch it via the command line::

$ specviz


If you only wish to inspect a single file, you can also pass in the filename
as a command line argument, as follows::
If the user wishes to inspect a single file, they can also pass in the filename
as a command line argument along with the ``-F`` flag as follows::

$ specviz filename
$ specviz -F <filename>

.. code-block::bash
You may also include the name of a custom loader as second optional argument::
$ specviz -F ~/Downloads/COS_FUV.fits
$ specviz filename --format="my-custom-format"
In the above case, the loader registry functionality will attempt to select
the best available loader for the data. If the user wishes to specify a
specific loader for their data, a ``-L`` flag can be passed with the loader
name

$ specviz -F <filename> -L <loader_name>

.. code-block::bash
$ specviz -F ~/Downloads/COS_FUV.fits -L HST/COS
To get further help with the command line options, simply type
``specviz --help``.
4 changes: 2 additions & 2 deletions docs/stats_sidebar.rst → docs/statistics.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _specviz-stats_sidebar:

Right Sidebar Statistics Display
--------------------------------
Spectrum Statistics
-------------------

11 statistic/analysis functions are calculated using the input spectrum
or 
specified region of interest, depending on what is selected in the
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ edit_on_github = True
github_project = spacetelescope/specviz
# install_requires should be formatted as a comma-separated list, e.g.:
# install_requires = astropy, scipy, matplotlib
install_requires = astropy>=3.0, pyqt5, pyqtgraph, qtawesome, qtpy, specutils>=0.4, click, pytest, asteval
install_requires = astropy>=3.0, pyqt5, pyqtgraph, qtawesome, qtpy, specutils>=0.5.1, click, pytest, asteval
# version should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
version = 0.6.dev0
# Note: you will also need to change this in your package's __init__.py
Expand Down
2 changes: 1 addition & 1 deletion specviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, *args, file_path=None, file_loader=None, embedded=False,
super(Application, self).__init__(*args, **kwargs)

# Set application icon
self.setWindowIcon(QIcon(":/icons/icon.png"))
self.setWindowIcon(QIcon(":/icons/specviz.icns"))

# Load local plugins
self.load_local_plugins()
Expand Down
Binary file removed specviz/data/resources/icon.ico
Binary file not shown.
Binary file modified specviz/data/resources/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion specviz/data/resources/resources.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/icons">
<file>specviz.icns</file>
<file>configuration.svg</file>
<file>title.png</file>
<file>005-stats.svg</file>
Expand Down Expand Up @@ -27,6 +28,5 @@
<file>region_remove.svg</file>
<file>selection.svg</file>
<file>house.svg</file>
<file>icon.ico</file>
</qresource>
</RCC>
Binary file modified specviz/data/resources/title.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions specviz/plugins/loader_wizard/loader_wizard.ui
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
<item row="6" column="0">
<widget class="QLabel" name="label_data_units">
<property name="text">
Expand Down Expand Up @@ -594,7 +594,7 @@
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="layout_preview" stretch=""/>
<layout class="QVBoxLayout" name="layout_preview"/>
</item>
</layout>
</widget>
Expand Down Expand Up @@ -742,6 +742,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../data/resources/resources.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit f1c74b8

Please sign in to comment.