Skip to content

Commit

Permalink
Merge pull request #532 from robelgeda/docs
Browse files Browse the repository at this point in the history
Doc Cleanup
  • Loading branch information
javerbukh committed Nov 7, 2019
2 parents 95d8490 + eb67988 commit 94f96c3
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 24 deletions.
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/logo_icon_32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions docs/_static/specutils.css
@@ -0,0 +1,15 @@
@import url("bootstrap-astropy.css");

div.topbar a.brand {
background: transparent url("logo_icon.png") no-repeat 8px 3px;
background-image: url("logo_icon.png"), none;
background-size: 32px 32px;
}

#logotext1 {
color: #667C8A;
}

#logotext2 {
color: #F09156;
}
7 changes: 4 additions & 3 deletions docs/conf.py
Expand Up @@ -117,7 +117,8 @@
# 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_static_path = ['_static']
html_style = 'specutils.css'

# Please update these texts to match the name of your package.
html_theme_options = {
Expand All @@ -133,12 +134,12 @@

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

# 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
# pixels large.
#html_favicon = ''
html_favicon = 'img/logo_icon.svg'

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down
4 changes: 3 additions & 1 deletion docs/nitpick-exceptions
@@ -1,4 +1,6 @@
# Temporary exception of inherited astropy classes
py:class astropy.nddata.mixins.ndio.NDIOMixin
py:class astropy.nddata.mixins.ndslicing.NDSlicingMixin
py:class astropy.nddata.mixins.ndarithmetic.NDArithmeticMixin
py:class astropy.nddata.mixins.ndarithmetic.NDArithmeticMixin
py:obj NDData
py:obj NDUncertainty
26 changes: 13 additions & 13 deletions docs/spectral_regions.rst
Expand Up @@ -99,11 +99,9 @@ One can also delete a sub-region:
>>> del sr[1]
>>> sr #doctest:+SKIP
[(<Quantity 0.15 um>, <Quantity 0.2 um>),
(<Quantity 0.45 um>, <Quantity 0.6 um>),
(<Quantity 0.8 um>, <Quantity 0.9 um>),
(<Quantity 1. um>, <Quantity 1.2 um>),
(<Quantity 1.3 um>, <Quantity 1.5 um>)]
Spectral Region, 5 sub-regions:
(0.15 um, 0.2 um) (0.45 um, 0.6 um) (0.8 um, 0.9 um)
(1.0 um, 1.2 um) (1.3 um, 1.5 um)
There is also the ability to iterate:

Expand All @@ -118,12 +116,12 @@ There is also the ability to iterate:
>>> for s in sr:
... print(s.lower) #doctest:+SKIP
SpectralRegion: 0.15 um - 0.2 um
SpectralRegion: 0.3 um - 0.4 um
SpectralRegion: 0.45 um - 0.6 um
SpectralRegion: 0.8 um - 0.9 um
SpectralRegion: 1.0 um - 1.2 um
SpectralRegion: 1.3 um - 1.5 um
0.15 um
0.3 um
0.45 um
0.8 um
1.0 um
1.3 um
And, lastly, there is the ability to invert a `~specutils.SpectralRegion` given a
Expand All @@ -142,8 +140,10 @@ defines the baseline/noise regions:
>>> sr_inverted = sr.invert(0.05*u.um, 3*u.um)
>>> sr_inverted #doctest:+SKIP
SpectralRegion: 0.05 um - 0.15 um, 0.2 um - 0.3 um, 0.4 um - 0.45 um, 0.6 um - 0.8 um, 0.9 um - 1.0 um, 1.2 um - 1 .3 um, 1.5 um - 3.0 um
Spectral Region, 7 sub-regions:
(0.05 um, 0.15 um) (0.2 um, 0.3 um) (0.4 um, 0.45 um)
(0.6 um, 0.8 um) (0.9 um, 1.0 um) (1.2 um, 1.3 um)
(1.5 um, 3.0 um)
Region Extraction
-----------------
Expand Down
7 changes: 4 additions & 3 deletions docs/spectrum1d.rst
Expand Up @@ -97,7 +97,7 @@ Providing a FITS-style WCS
>>> import numpy as np
>>> my_wcs = fitswcs.WCS(header={'CDELT1': 1, 'CRVAL1': 6562.8, 'CUNIT1': 'Angstrom', 'CTYPE1': 'WAVE', 'RESTFRQ': 1400000000, 'CRPIX1': 25})
>>> spec = Spectrum1D(flux=[5,6,7] * u.Jy, wcs=my_wcs)
>>> spec.wavelength #doctest:+SKIP
>>> spec.spectral_axis #doctest:+SKIP
<Quantity [ 6538.8, 6539.8, 6540.8] Angstrom>
>>> spec.wcs.pixel_to_world(np.arange(3)) #doctest:+SKIP
array([6.5388e-07, 6.5398e-07, 6.5408e-07])
Expand Down Expand Up @@ -126,8 +126,8 @@ common spectral axis.
>>> spec = Spectrum1D(spectral_axis=np.arange(5000, 5010)*u.AA, flux=np.random.sample((5, 10))*u.Jy)
>>> spec_slice = spec[0] #doctest:+SKIP
>>> spec_slice.wavelength #doctest:+SKIP
<Quantity [0., 1., 2., 3., 4., 5., 6., 7., 8., 9.] Angstrom>
>>> spec_slice.spectral_axis #doctest:+SKIP
<Quantity [5000., 5001., 5002., 5003., 5004., 5005., 5006., 5007., 5008., 5009.] Angstrom>
>>> spec_slice.flux #doctest:+SKIP
<Quantity [0.72722821, 0.32147784, 0.70256482, 0.04445197, 0.03390352,
0.50835299, 0.87581725, 0.50270413, 0.08556376, 0.53713355] Jy>
Expand All @@ -143,6 +143,7 @@ Reference/API

.. automodapi:: specutils
:no-main-docstr:
:inherited-members:
:no-heading:
:headings: -~

Expand Down
8 changes: 4 additions & 4 deletions docs/spectrum_collection.rst
Expand Up @@ -36,9 +36,9 @@ solution.
(5,)
>>> spec_coll.flux.unit
Unit("Jy")
>>> spec_coll.wavelength.shape
>>> spec_coll.spectral_axis.shape
(5, 10)
>>> spec_coll.wavelength.unit
>>> spec_coll.spectral_axis.unit
Unit("Angstrom")
Collections from 1D spectra
Expand All @@ -65,9 +65,9 @@ a list of :class:`~specutils.Spectrum1D`:
(2,)
>>> spec_coll.flux.unit
Unit("Jy")
>>> spec_coll.wavelength.shape
>>> spec_coll.spectral_axis.shape
(2, 50)
>>> spec_coll.wavelength.unit
>>> spec_coll.spectral_axis.unit
Unit("Angstrom")
:class:`~specutils.SpectrumCollection` objects can be treated just like
Expand Down
6 changes: 6 additions & 0 deletions specutils/spectra/spectrum_mixin.py
Expand Up @@ -49,6 +49,9 @@ def _data_with_spectral_axis_first(self):

@property
def spectral_wcs(self):
"""
Returns the spectral axes of the WCS
"""
return self.wcs.axes.spectral

@lazyproperty
Expand Down Expand Up @@ -130,6 +133,9 @@ def new_flux_unit(self, unit, equivalencies=None, suppress_conversion=False):

@property
def velocity_convention(self):
"""
Returns the velocity convention
"""
return self._velocity_convention

def with_velocity_convention(self, velocity_convention):
Expand Down

0 comments on commit 94f96c3

Please sign in to comment.