Skip to content

Commit

Permalink
Merge pull request #231 from migueldvb/docs
Browse files Browse the repository at this point in the history
Updating documentation
  • Loading branch information
mkelley committed Mar 23, 2020
2 parents 751bb90 + a6f53a8 commit 7bb7b80
Show file tree
Hide file tree
Showing 34 changed files with 107 additions and 112 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
:alt: sbpy


sbpy is an `Astropy <http://www.astropy.org/>`_ affiliated package for small-body
sbpy is an `Astropy <https://www.astropy.org/>`_ affiliated package for small-body
planetary astronomy.

.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
.. image:: https://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: http://www.astropy.org
:alt: Powered by Astropy Badge

Expand All @@ -16,10 +16,10 @@ planetary astronomy.
:alt: Travis-CI status

.. image:: https://readthedocs.org/projects/sbpy/badge/?version=latest
:target: http://sbpy.readthedocs.io/en/latest/?badge=latest
:target: https://sbpy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation status

.. image:: http://joss.theoj.org/papers/10.21105/joss.01426/status.svg
.. image:: https://joss.theoj.org/papers/10.21105/joss.01426/status.svg
:target: https://doi.org/10.21105/joss.01426
:alt: JOSS documentation

Expand Down Expand Up @@ -51,7 +51,7 @@ For details on the installation process, please refer to the `detailed installat
Documentation
-------------

The official documentation and API reference is available `here <http://sbpy.readthedocs.io/en/latest/>`_.
The official documentation and API reference is available `here <https://sbpy.readthedocs.io/en/latest/>`_.

Status
------
Expand All @@ -66,4 +66,4 @@ Acknowledgements

If you use `sbpy` in your work, please acknowledge it by citing

`Mommert, Kelley, de-Val Borro, Li et al., (2019). sbpy: A Python module for small-body planetary astronomy. Journal of Open Source Software, 4(38), 1426 <http://joss.theoj.org/papers/8b8e7bb15fb4a14f80f2afd06b6ce060>`_
`Mommert, Kelley, de-Val Borro, Li et al., (2019). sbpy: A Python module for small-body planetary astronomy. Journal of Open Source Software, 4(38), 1426 <https://joss.theoj.org/papers/8b8e7bb15fb4a14f80f2afd06b6ce060>`_
2 changes: 1 addition & 1 deletion ah_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@


# What follows are several import statements meant to deal with install-time
# issues with either missing or misbehaving pacakges (including making sure
# issues with either missing or misbehaving packages (including making sure
# setuptools itself is installed):

# Check that setuptools 30.3 or later is present
Expand Down
28 changes: 14 additions & 14 deletions docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ derived with methods in `~sbpy.shape`. We also include the most
commonly used 5-parameter version of the Hapke scattering
model. Empirical cometary dust phase functions are implemented, too
(Marcus 2007; Schleicher & Bair 2011,
http://asteroid.lowell.edu/comet/dustphase.html). Some
https://asteroid.lowell.edu/comet/dustphase.html). Some
single-scattering phase functions such as the Henyey-Greenstein
function will also be implemented.

Expand Down Expand Up @@ -395,18 +395,18 @@ methods.



.. _JPL Horizons: http://ssd.jpl.nasa.gov/horizons.cgi
.. _Minor Planet Center: http://minorplanetcenter.net/
.. _IMCCE: http://vo.imcce.fr/webservices/miriade
.. _Lowell Observatory: http://asteroid.lowell.edu
.. _PyEphem: http://rhodesmill.org/pyephem
.. _REBOUND: http://github.com/hannorein/rebound
.. _OpenOrb: http://github.com/oorb/oorb
.. _SpiceyPy: http://github.com/AndrewAnnex/SpiceyPy
.. _web-API: http://minorplanetcenter.net/search_db
.. _JPL Horizons: https://ssd.jpl.nasa.gov/horizons.cgi
.. _Minor Planet Center: https://minorplanetcenter.net/
.. _IMCCE: http://vo.imcce.fr/webservices/miriade/
.. _Lowell Observatory: https://asteroid.lowell.edu
.. _PyEphem: https://rhodesmill.org/pyephem
.. _REBOUND: https://github.com/hannorein/rebound
.. _OpenOrb: https://github.com/oorb/oorb
.. _SpiceyPy: https://github.com/AndrewAnnex/SpiceyPy
.. _web-API: https://minorplanetcenter.net/search_db
.. _Solar System Object Image Search function of the Canadian Astronomy Data Centre: http://goo.gl/2aGYsW
.. _skybot: http://vo.imcce.fr/webservices/skybot
.. _small bodies data ferret: http://sbntools.psi.edu/ferret
.. _github wiki: http://github.com/mommermi/sbpy/wiki
.. _Ginga Image Viewer: http://ejeschke.github.io/ginga/
.. _skybot: http://vo.imcce.fr/webservices/skybot/
.. _small bodies data ferret: https://sbnapps.psi.edu/ferret
.. _github wiki: https://github.com/mommermi/sbpy/wiki
.. _Ginga Image Viewer: https://ejeschke.github.io/ginga/
.. _photutils: https://github.com/astropy/photutils
12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ in 2021.
Current Status
**************

.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: http://www.astropy.org
.. image:: https://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: https://www.astropy.org
:alt: Powered by Astropy Badge

.. image:: https://readthedocs.org/projects/sbpy/badge/?version=latest
:target: http://sbpy.readthedocs.io/en/latest/?badge=latest
:target: https://sbpy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation status

.. image:: http://joss.theoj.org/papers/10.21105/joss.01426/status.svg
.. image:: https://joss.theoj.org/papers/10.21105/joss.01426/status.svg
:target: https://doi.org/10.21105/joss.01426
:alt: JOSS documentation

.. image:: https://travis-ci.org/NASA-Planetary-Science/sbpy.svg?branch=master
.. image:: https://api.travis-ci.org/NASA-Planetary-Science/sbpy.svg?branch=master
:target: https://travis-ci.org/NASA-Planetary-Science/sbpy
:alt: Travis-CI status

Expand Down Expand Up @@ -138,7 +138,7 @@ Acknowledgments

If you use `sbpy` in your work, please acknowledge it by citing

`Mommert, Kelley, de-Val Borro, Li et al., (2019). sbpy: A Python module for small-body planetary astronomy. Journal of Open Source Software, 4(38), 1426 <http://joss.theoj.org/papers/8b8e7bb15fb4a14f80f2afd06b6ce060>`_
`Mommert, Kelley, de-Val Borro, Li et al., (2019). sbpy: A Python module for small-body planetary astronomy. Journal of Open Source Software, 4(38), 1426 <https://joss.theoj.org/papers/8b8e7bb15fb4a14f80f2afd06b6ce060>`_

and also please consider using the `~sbpy.bib` reference tracking
system to properly acknowledge and reference the methods you used in
Expand Down
64 changes: 29 additions & 35 deletions docs/sbpy/activity/gas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ The gas coma models work with sbpy's apertures:
Production Rate calculations
----------------------------

`~sbpy.activity.gas.productionrate` offers various functions that aid in the calculation
of production rates. `~sbpy.data.phys` has a function called `~sbpy.data.Phys.from_jplspec`
Various functions that aid in the calculation of production rates are offered.
`~sbpy.data.Phys` has a function called `~sbpy.data.Phys.from_jplspec`
which takes care of querying the JPL Molecular Spectral Catalog through the use of
`~astroquery.jplspec` and calculates all the necessary constants needed for
production rate calculations in this module. Yet, the option for the user to
provide their own molecular data is possible through the use of an `~sbpy.data.phys`
provide their own molecular data is possible through the use of an `~sbpy.data.Phys`
object, as long as it has the required information. It is imperative to read
the documentation of the functions in this section to understand what is needed
for each. If the user does not have the necessary data, they can build an object
Expand Down Expand Up @@ -132,8 +132,8 @@ at 300 K for a molecule. Yet, in order to calculate production rate, we need
to know the integrated line intensity at a given temperature. This function
takes care of converting the integrated line intensity at 300 K to its equivalent
in the desired temperature using equations provided by the JPLSpec documentation.
For more information on the needed parameters for this function follow the link
for `~sbpy.activity.intensity_conversion` under Reference/API section.
For more information on the needed parameters for this function see
`~sbpy.activity.intensity_conversion`.

.. doctest-skip::

Expand Down Expand Up @@ -161,8 +161,7 @@ allowed to provide their own Einstein Coefficient if they want. If the user
does want to provide their own Einstein Coefficient, they may do so simply
by appending their value with the unit 1/s to the `~sbpy.data.Phys` object, called
`mol_data` in these examples. For more information on the needed parameters
for this function follow the link for `~sbpy.activity.einstein_coeff`
under Reference/API section.
for this function see `~sbpy.activity.einstein_coeff`.

.. doctest-skip::

Expand All @@ -178,17 +177,16 @@ Beta Factor Calculation
^^^^^^^^^^^^^^^^^^^^^^^

Returns beta factor based on timescales from `~sbpy.activity.gas` and distance
from the Sun using an `~sbpy.data.ephem` object. The calculation is
from the Sun using an `~sbpy.data.Ephem` object. The calculation is
parent photodissociation timescale * (distance from comet to Sun)**2
and it accounts for certain photodissociation and geometric factors needed
in the calculation of total number of molecules `~sbpy.activity.total_number_nocd`
in the calculation of total number of molecules `~sbpy.activity.total_number`
If you wish to provide your own beta factor, you can calculate the equation
expressed in units of AU**2 * s , all that is needed is the timescale
of the molecule and the distance of the comet from the Sun. Once you
have the beta factor you can append it to your mol_data phys object
have the beta factor you can append it to your `mol_data` phys object
with the name 'beta' or any of its alternative names. For more information on
the needed parameters for this function follow the link for
`~sbpy.activity.beta_factor` under Reference/API section.
the needed parameters for this function see `~sbpy.activity.beta_factor`.

.. doctest-skip::

Expand Down Expand Up @@ -219,9 +217,8 @@ One of the models followed by this module is based on the following paper:
The following example shows the usage of the function. This LTE model does not
include photodissociation, but it does serve as way to obtain educated
first guesses for other models within sbpy. For more information on the
parameters that are needed for the function follow
the link for the function `from_Drahus` in `~sbpy.activity.LTE`
under Reference/API section.
parameters that are needed for the function see
`~sbpy.activity.LTE.from_Drahus`.

.. doctest-skip::

Expand All @@ -238,7 +235,7 @@ LTE Column Density Calculation

To calculate a column density with no previous column density information,
we can use equation 10 from `Bockelee-Morvan et al. 2004
<https://ui.adsabs.harvard.edu/#abs/2004come.book..391B>`. This function is
<https://ui.adsabs.harvard.edu/abs/2004come.book..391B>`_. This function is
very useful to obtain a column density with no previous guess for it,
and also useful to provide a first guess for the more involved Non-LTE model
for column density explained in the next section.
Expand All @@ -253,32 +250,31 @@ Non-LTE Column Density Calculation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Once the user has a guess for their column density, the user can then
implement the `sbpy.activity` NonLTE function `from_pyradex`. This function
calculates the best fitting column density for the integrated flux data using
the python wrapper pyradex of the Non-LTE iterative code RADEX.
implement the `sbpy.activity` NonLTE function `sbpy.activity.NonLTE.from_pyradex`.
This function calculates the best fitting column density for the integrated
flux data using the python wrapper pyradex of the Non-LTE iterative code RADEX.
The code utilizes the LAMDA catalog collection of molecular data files,
presently this is the only functionality available, yet in the future a function
will be provided by `sbpy` to build your own molecular data file from JPLSpec
for use in this function. The code will look for a 'cdensity' column value
within `mol_data` to use as its first guess. For a more detailed look at the
input parameters and defaults, search for `from_pyradex` in
`~sbpy.activity.NonLTE` under the Reference/API section.
input parameters, please see `~sbpy.activity.NonLTE.from_pyradex`.

.. doctest-skip::

>>> from sbpy.activty import NonLTE
>>> from sbpy.activity import NonLTE
>>> nonlte = NonLTE()
>>> cdensity = nonlte.from_pyradex(integrated_flux, mol_data, iter=500)
>>> mol_data.apply([cdensity.value] * cdensity.unit, name='cdensity')

Note that for this calculation the installation of `pyradex` is needed. Pyradex
is a python wrapper for the RADEX fortran code. See `here
<https://github.com/keflavich/pyradex/blob/master/INSTALL.rstB>` and
`here <https://github.com/keflavich/pyradex>` for installation instruction and
tips as well as a briefing of how pyradex works and what common errors
might arise. You need to make sure you have a fortran compiler installed
in order for pyradex to work (gfortran works and can be installed with
homebrew for easier management).
is a python wrapper for the RADEX fortran code. See `pyradex installation
<https://github.com/keflavich/pyradex/blob/master/INSTALL.rst>`_ and
`README file <https://github.com/keflavich/pyradex/blob/master/README.rst>`_
for installation instruction and tips as well as a briefing of how pyradex
works and what common errors might arise. You need to make sure you have a
fortran compiler installed in order for pyradex to work (gfortran works and can
be installed with homebrew for easier management).

Total Number
^^^^^^^^^^^^
Expand All @@ -291,10 +287,9 @@ in equation 1.3 from:
| coma in comets. PhD Thesis, Georg-August-Universität Göttingen.
If the user prefers to give the total number, they may do so by appending
to the mol_data `~sbpy.data.phys` object with the name `total_number_nocd` or
to the mol_data `~sbpy.data.Phys` object with the name `total_number` or
any of its alternative names. For more information on the needed parameters
for this function follow the link for `~sbpy.activity.total_number_nocd`
under Reference/API section.
for this function see `~sbpy.activity.total_number`.

.. doctest-skip::

Expand Down Expand Up @@ -324,9 +319,8 @@ module found in `~sbpy.activity.gas` to find a ratio between the model
total number of molecules and the number of molecules calculated from the data
to scale the model Q and output the new production rate from the result. This
LTE model does account for the effects of photolysis. For more information
on the parameters that are needed for the function follow
the link for the function `from_Haser` in `~sbpy.activity.LTE`
under Reference/API section.
on the parameters that are needed for the function see
`~sbpy.activity.LTE.from_Haser`.

.. doctest-skip::

Expand Down
2 changes: 1 addition & 1 deletion docs/sbpy/activity/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Activity Module (`sbpy.activity`)
Introduction
------------

`sbpy.activity` models cometary dust and gas activity. It is separated into two main sub-modules: :doc:`dust` and :doc:`gas`. The base module itself defines photmetric apertures that may be useful for observations of comets.
`sbpy.activity` models cometary dust and gas activity. It is separated into two main sub-modules: :doc:`dust` and :doc:`gas`. The base module itself defines photometric apertures that may be useful for observations of comets.

.. toctree::
:maxdepth: 2
Expand Down
4 changes: 2 additions & 2 deletions docs/sbpy/bib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ BibTeX (`~sbpy.bib.to_bibtex`)
month = Sep,
eid = {25.04},
pages = {25.04},
adsurl = {https://ui.adsabs.harvard.edu/#abs/1996DPS....28.2504G},
adsurl = {https://ui.adsabs.harvard.edu/abs/1996DPS....28.2504G},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Expand Down Expand Up @@ -140,7 +140,7 @@ journal rules, can be readily implemented.
Filtering
---------

The aformentioned output functions enable the filtering of references
The aforementioned output functions enable the filtering of references
based on their relevance. For instance, in the examples show above,
the relevance is ``data source``. In order to properly use filter,
only select keywords can be used a relevance: allowed is any string
Expand Down
9 changes: 5 additions & 4 deletions docs/sbpy/calib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ Solar spectra in Sun objects can be plotted at the native resolution of the data
>>> fluxd_binned = sun.observe(wave_binned, unit='W / (m2 um)')
>>> # Plot
>>> plt.plot(sun.wave.to('um'), sun.fluxd.to('W/(m2 um)'),
... ls='steps-mid', color='#1f77b4', label='Native resolution')
>>> plt.plot(wave_binned, fluxd_binned, ls='steps-mid',
... drawstyle='steps-mid', color='#1f77b4',
... label='Native resolution')
>>> plt.plot(wave_binned, fluxd_binned, drawstyle='steps-mid',
... color='#ff7f0e', label='R~25')
>>> plt.setp(plt.gca(), xlim=wrange, xlabel='Wavelength (μm)',
... ylabel='Flux density (W/(m2 μm)')
Expand All @@ -244,8 +245,8 @@ Solar spectra in Sun objects can be plotted at the native resolution of the data
wave_binned = wrange[0] * d**np.arange(n) * u.um
sun = Sun.from_default()
fluxd_binned = sun.observe(wave_binned, unit='W / (m2 um)')
plt.plot(sun.wave.to('um'), sun.fluxd.to('W/(m2 um)'), ls='steps-mid', color='#1f77b4', label='Native resolution')
plt.plot(wave_binned, fluxd_binned, ls='steps-mid', color='#ff7f0e', label='R~25')
plt.plot(sun.wave.to('um'), sun.fluxd.to('W/(m2 um)'), drawstyle='steps-mid', color='#1f77b4', label='Native resolution')
plt.plot(wave_binned, fluxd_binned, drawstyle='steps-mid', color='#ff7f0e', label='R~25')
plt.setp(plt.gca(), xlim=wrange, xlabel='Wavelength (μm)', ylabel='Flux density (W/(m2 μm)')
plt.legend()
plt.tight_layout()
Expand Down
4 changes: 2 additions & 2 deletions docs/sbpy/data/dataclass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ unstructured meta data.

The user is free to add any fields they want to a
`~sbpy.data.DataClass` object. However, in order to enable the
seemless use of `sbpy` functions and methods, we require the user to
seamless use of `sbpy` functions and methods, we require the user to
pick among a few common field names for different properties as listed
:ref:`here <field name list>`. `~sbpy.data.DataClass` objects
are able to identify alternative field names as listed in this
Expand Down Expand Up @@ -428,7 +428,7 @@ The same result can be achieved using the following syntax:
10.243452 -12.40435 2451523.8525 R R
10.25546 -12.3946 2451523.94653 i i

Similarly, exisiting columns can be modified using:
Similarly, existing columns can be modified using:

>>> obs['filter'] = ['g', 'i', 'R', 'V'] # doctest: +SKIP

Expand Down
2 changes: 1 addition & 1 deletion docs/sbpy/data/ephem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ option should be less than a few hundred to prevent corruption of the
query (see `~astroquery.jplhorizons.HorizonsClass.ephemerides` for
details).

Observer locations can be defined as strings using offical `IAU
Observer locations can be defined as strings using official `IAU
observatory codes
<https://www.minorplanetcenter.net/iau/lists/ObsCodesF.html>`__ or
using `~astropy.coordinates.EarthLocation` as shown in the following
Expand Down
4 changes: 2 additions & 2 deletions docs/sbpy/spectroscopy/sources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Observe the source through a low-resolution spectrometer:
>>> wave = np.logspace(0.5, 1.5, 100) * u.um
>>> fluxd = B.observe(wave, unit='MJy')
>>>
>>> plt.plot(wave, fluxd, ls='steps-mid', label=str(B.T))
>>> plt.plot(wave, fluxd, drawstyle='steps-mid', label=str(B.T))
... # doctest: +IGNORE_OUTPUT
>>> plt.setp(plt.gca(), xlabel='Wavelength (μm)', ylabel='$F_ν$ (MJy)')
... # doctest: +IGNORE_OUTPUT
Expand All @@ -57,7 +57,7 @@ Observe the source through a low-resolution spectrometer:
wave = np.logspace(0.5, 1.5, 100) * u.um
fluxd = B.observe(wave, unit='MJy')

plt.plot(wave, fluxd, ls='steps-mid', label=str(B.T))
plt.plot(wave, fluxd, drawstyle='steps-mid', label=str(B.T))
plt.setp(plt.gca(), xlabel='Wavelength (μm)', ylabel='$F_ν$ (MJy)')


Expand Down

0 comments on commit 7bb7b80

Please sign in to comment.