Skip to content

Commit

Permalink
Merge pull request #4 from igoumiri/docs/small-fixes
Browse files Browse the repository at this point in the history
Add basic documentation + small fixes
  • Loading branch information
SuperdoerTrav authored Jul 19, 2024
2 parents 63f5f8e + 2d5412b commit e4036a0
Show file tree
Hide file tree
Showing 18 changed files with 155 additions and 88 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ cover/

# Sphinx documentation
docs/_build/
docs/source/api
docs/source/modules

# Jupyter Notebook
**/*.ipynb_checkpoints
Expand Down
22 changes: 22 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SSAPy Documentation
===================

Building the docs
-----------------

First, build and _install_ `ssapy` following the `Installing SSAPy <https://LLNL.github.io/SSAPy/installation.html>`_ section of the documentation.

Then, to build the HTML documentation locally, from the `docs` directory, run

.. code-block:: bash
make html
(run it twice to generate all files.)

Then open `_build/html/index.html` to browse the docs locally.

Alternatively, you can run `sphinx-autobuild . _build/html` to start a server that watches for changes in `/docs`
and regenerates the HTML docs automatically while serving them at http://127.0.0.1:8000/.

Note that if you updated docstrings, you'll need to re-build and re-install ssapy before re-building the docs.
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These requirements can be easily installed on most modern macOS and Linux system
.. code-block:: console
brew update
brew install gcc git git-lfs python3 svn graphviz
brew install gcc git git-lfs python3 graphviz
Installation
------------
Expand Down
5 changes: 5 additions & 0 deletions ssapy/accel.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Classes for modeling accelerations.
"""

import numpy as np

from . import _ssapy
Expand Down Expand Up @@ -101,6 +105,7 @@ def __eq__(self, rhs):


class AccelProd(Accel):
"""Acceleration defined as the product of an acceleration with a constant factor."""
def __init__(self, accel, factor):
super().__init__()
self.accel = accel
Expand Down
4 changes: 4 additions & 0 deletions ssapy/body.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Classes representing celestial bodies.
"""

import erfa
import numpy as np
from .utils import _gpsToTT, iers_interp
Expand Down
4 changes: 4 additions & 0 deletions ssapy/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
A collection of physical constants.
"""

import numpy as np

# GM
Expand Down
4 changes: 2 additions & 2 deletions ssapy/correlate_tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ def summarize_tracklet(arc):
pmra, pmdec: the proper motion in right ascension and declination
dpmra, dpmdec: the uncertainty in the proper motion in RA and declination
"""
unit = ssapy.utils.lb2unit(arc['ra'].to(u.rad).value,
unit = ssapy.utils.lb_to_unit(arc['ra'].to(u.rad).value,
arc['dec'].to(u.rad).value)
meanunit = np.mean(unit, axis=0)
# defines tangent plane
Expand All @@ -2033,7 +2033,7 @@ def summarize_tracklet(arc):
rasig = np.sqrt(np.diag(racovar))
decp, deccovar = np.polyfit(dt, dectp, 1, w=1./dpos, cov='unscaled')
decsig = np.sqrt(np.diag(deccovar))
meanra, meandec = ssapy.utils.unit2lb(meanunit[None, :])
meanra, meandec = ssapy.utils.unit_to_lb(meanunit[None, :])
rap[1] += meanra[0]
decp[1] += meandec[0]
out = [(rap[1]*u.rad, decp[1]*u.rad),
Expand Down
8 changes: 8 additions & 0 deletions ssapy/ellipsoid.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""
Class to handle transformations between ECEF x,y,z coords and geodetic
longitude, latitude, and height.
Technically, only handles a one-axis ellipsoid, defined via a flattening
parameter f, but that's good enough for simple Earth models.
"""

import numpy as np

from ._ssapy import Ellipsoid
Expand Down
10 changes: 7 additions & 3 deletions ssapy/gravity.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"""
Classes for gravity-related accelerations.
"""

# from functools import lru_cache

import numpy as np

from .accel import Accel, _invnorm
from .accel import Accel as _Accel, _invnorm
from .utils import find_file, norm
from . import _ssapy

Expand Down Expand Up @@ -220,7 +224,7 @@ def __eq__(self, rhs):
)


class AccelThirdBody(Accel):
class AccelThirdBody(_Accel):
"""Acceleration due to a third body.
Parameters
Expand Down Expand Up @@ -254,7 +258,7 @@ def __call__(self, r, v, t, **kwargs):
return -self.body.mu * (s / norm(s)**3 - d / norm(d)**3)


class AccelHarmonic(Accel):
class AccelHarmonic(_Accel):
"""Acceleration due to a harmonic potential.
Parameters
Expand Down
4 changes: 4 additions & 0 deletions ssapy/io.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Collection of functions to read from and write to various file formats.
"""

import datetime
import numpy as np
from astropy.time import Time
Expand Down
Loading

0 comments on commit e4036a0

Please sign in to comment.