Skip to content

Commit 94d6dce

Browse files
authored
Merge pull request #6 from LowellObservatory/doc_bug_fixes
Flesh out the documentation and fix bugs
2 parents 18c1c62 + 05b6032 commit 94d6dce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+18413
-209
lines changed

.github/workflows/documentation.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jobs:
1010
with:
1111
# we want to find git tags to pass version to sphinx
1212
fetch-depth: 0
13-
- uses: actions/setup-python@v3
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.11'
1416
- name: Install dependencies
1517
run: |
1618
pip install sphinx sphinx_rtd_theme sphinx-automodapi .[dev]

README.rst

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
.. |License| image:: https://img.shields.io/github/license/LowellObservatory/LDTObserverTools
22
:target: https://github.com/LowellObservatory/LDTObserverTools/blob/main/LICENSE
33

4-
.. |astropy| image:: https://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
4+
.. |astropy| image:: https://img.shields.io/badge/powered%20by-AstroPy-blue.svg?style=flat
55
:target: https://www.astropy.org/
66

77
.. |forks| image:: https://img.shields.io/github/forks/LowellObservatory/LDTObserverTools?style=social
8-
:target: https://github.com/LowellObservatory/LDTObserverTools
8+
:target: https://github.com/LowellObservatory/LDTObserverTools/forks
99

10-
.. |issues| image:: https://img.shields.io/github/issues/LowellObservatory/LDTObserverTools?style=social
11-
:target: https://github.com/LowellObservatory/LDTObserverTools
10+
.. |issues| image:: https://img.shields.io/github/issues/LowellObservatory/LDTObserverTools?style=badge
11+
:target: https://github.com/LowellObservatory/LDTObserverTools/issues
12+
13+
.. |pulls| image:: https://img.shields.io/github/issues-pr/LowellObservatory/LDTObserverTools?style=badge
14+
:target: https://github.com/LowellObservatory/LDTObserverTools/pulls
1215

1316
.. |stars| image:: https://img.shields.io/github/stars/LowellObservatory/LDTObserverTools?style=social
14-
:target: https://github.com/LowellObservatory/LDTObserverTools
17+
:target: https://github.com/LowellObservatory/LDTObserverTools/stargazers
1518

1619
.. |watch| image:: https://img.shields.io/github/watchers/LowellObservatory/LDTObserverTools?style=social
17-
:target: https://github.com/LowellObservatory/LDTObserverTools
20+
:target: https://github.com/LowellObservatory/LDTObserverTools/watchers
1821

1922
.. |github| image:: https://img.shields.io/badge/GitHub-LDTObserverTools-brightgreen
2023
:target: https://github.com/LowellObservatory/LDTObserverTools
2124

25+
.. |language| image:: https://img.shields.io/github/languages/top/LowellObservatory/LDTObserverTools
26+
:target: https://github.com/LowellObservatory/LDTObserverTools
27+
2228
.. image:: https://raw.githubusercontent.com/LowellObservatory/LDTObserverTools/main/doc/_static/obstools_logo.png
2329
:target: https://github.com/LowellObservatory/LDTObserverTools
2430
:width: 500
@@ -32,6 +38,7 @@ LDTObserverTools |forks| |stars| |watch|
3238

3339
|github| |astropy| |License|
3440

41+
|language| |issues| |pulls|
3542

3643
The LDTObserverTools package is a collection of command-line and GUI tools
3744
for observers at the Lowell Discovery Telescope (LDT) in Happy Jack, AZ.
@@ -103,7 +110,7 @@ action is to setup a clean python environment into which the installation will
103110
occur. This mitigates any possible dependency conflicts with other packages
104111
you use.
105112

106-
The recommended method of setting up a new envrionment is with ``conda``:
113+
The recommended method of setting up a new environment is with ``conda``:
107114

108115
.. code-block:: console
109116
@@ -150,16 +157,16 @@ simply be a matter of executing:
150157
Optional Dependencies
151158
^^^^^^^^^^^^^^^^^^^^^
152159

153-
There are no optional dependencies at this time.
160+
.. There are no optional dependencies at this time.
154161
155-
.. Some of the instrument-specific routines in this package require additional dependencies
156-
.. that are not otherwise needed by the majority of the routines herein.
162+
Some of the instrument-specific routines in this package require additional dependencies
163+
that are not otherwise needed by the majority of the routines herein.
157164

158-
.. - If you are using the ``deveny_pickup_cleaner`` routine, you will need the
159-
.. spectroscopic data reduction pipeline PypeIt for the iterative cleaning of
160-
.. the pickup noise. It can be installed by including it in the optional
161-
.. dependencies, `e.g.`:
165+
- If you are using the ``scrub_deveny_pickup`` tool, you will need the
166+
spectroscopic data reduction pipeline `PypeIt <https://pypeit.readthedocs.io/en/release/>`_
167+
for the iterative cleaning of the pickup noise. It can be installed by
168+
including it in the optional dependencies, *e.g.*:
162169

163-
.. .. code-block:: console
170+
.. code-block:: console
164171
165-
.. pip install "obstools[pypeit] @ git+https://github.com/LowellObservatory/LDTObserverTools"
172+
pip install "obstools[pypeit] @ git+https://github.com/LowellObservatory/LDTObserverTools"

doc/api/obstools.etc_calc.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

doc/api/obstools.lmi_etc.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
obstools.lmi\_etc module
2+
========================
3+
4+
.. automodule:: obstools.lmi_etc
5+
:members:
6+
:private-members:
7+
:undoc-members:
8+
:show-inheritance:

doc/api/obstools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Submodules
1212
obstools.deveny_collfocus
1313
obstools.deveny_grangle
1414
obstools.dfocus
15-
obstools.etc_calc
1615
obstools.fix_ldt_header
16+
obstools.lmi_etc
1717
obstools.neocp_ephem
1818
obstools.scrub_deveny_pickup
1919
obstools.utils

doc/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"sphinx.ext.mathjax",
4848
"sphinx.ext.ifconfig",
4949
"sphinx.ext.viewcode",
50+
"sphinx_subfigure",
5051
# "sphinx.ext.autosectionlabel",
5152
]
5253

@@ -125,11 +126,13 @@
125126
# Example configuration for intersphinx: refer to the Python standard library.
126127
intersphinx_mapping = {
127128
"python": ("https://docs.python.org/3/", None),
128-
"astropy": ("https://docs.astropy.org/en/stable/", None),
129129
"attrs": ("https://www.attrs.org/en/stable/", None),
130+
"astropy": ("https://docs.astropy.org/en/stable/", None),
131+
"ccdproc": ("https://ccdproc.readthedocs.io/en/stable/", None),
130132
"matplotlib": ("https://matplotlib.org/stable/", None),
131133
"numpy": ("https://numpy.org/doc/stable/", None),
132134
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
133135
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
134136
"pypeit": ("https://pypeit.readthedocs.io/en/release/", None),
137+
"stomp": ("https://jasonrbriggs.github.io/stomp.py/", None),
135138
}

doc/deveny_collfocus.rst

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.. include:: include/links.rst
2+
3+
.. |nbsp| unicode:: 0xA0
4+
:trim:
5+
6+
.. _deveny_collfocus:
7+
18
=================================
29
DeVeny Collimator Focus Estimator
310
=================================
@@ -26,7 +33,8 @@ yield the approximate relationship:
2633
\end{aligned}
2734
2835
where :math:`T_{\rm m}` is the mount temperature and tilt is the grating tilt
29-
angle. This equation is coded into the GUI tool.
36+
angle. The RMS of the fit is :math:`\sim 0.6` |nbsp| mm. This equation is coded into
37+
the GUI tool.
3038

3139
Unlike other focus procedures at LDT, the DeVeny LOUI focus sequence script
3240
does not take the *expected* focus value, but rather one end of the range,
@@ -45,10 +53,15 @@ The script usage can be displayed by calling the script with the
4553

4654
.. include:: help/deveny_collfocus.rst
4755

48-
When the application launches, a GUI window will appear:
56+
When the application launches, a GUI window will appear as in
57+
:numref:`collfocus_startup`.
4958

50-
.. image:: figures/deveny_collfocus_startup.png
59+
.. _collfocus_startup:
60+
.. figure:: figures/deveny_collfocus_startup.png
5161
:class: with-shadow
62+
:alt: GUI at startup
63+
64+
-- The ``deveny_collfocus`` GUI at startup.
5265

5366

5467
If the application is launched from one of the observer computers at LDT
@@ -66,10 +79,16 @@ windows. You will always need to select the rear filter setting you are using.
6679

6780
When you click "Compute", the bottom half of the GUI is populated with the
6881
estimated focus value from the equation above and values to enter into the
69-
DeVeny LOUI focus sequence tab.
82+
DeVeny LOUI focus sequence tab. See :numref:`collfocus_values`.
7083

71-
.. image:: figures/deveny_collfocus_values.png
84+
.. _collfocus_values:
85+
.. figure:: figures/deveny_collfocus_values.png
7286
:class: with-shadow
87+
:alt: GUI after clicking "Compute"
88+
89+
-- The ``deveny_collfocus`` GUI after clicking "Compute". The estimated
90+
focus value (with uncertainty) is printed, along with suggested values for
91+
use with the LOUI Focus Sequence tab.
7392

7493
Observers should note that the lower limit on the collimator focus motorized
7594
stage is 7.75 mm. In warm weather and/or for large grating tilt angles, the

doc/deveny_grangle.rst

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.. include:: include/links.rst
2+
3+
.. |nbsp| unicode:: 0xA0
4+
:trim:
5+
6+
.. _deveny_grangle:
7+
18
===============================
29
DeVeny Grating Angle Calculator
310
===============================
@@ -7,14 +14,41 @@ Status: Completed 2021-01-26
714
Overview
815
========
916

10-
- ``deveny_grangle``: Compute the desired grating angle based on selected
11-
grating and desired central wavelength. This routine comes with two interfaces.
12-
The default GUI features a dropdown menu for grating selection and contains error
13-
checking on the input for central wavelength. There is a ``MAX_GUI`` option for
14-
computing central wavelength given the grating angle in addition to the standard
15-
GUI features. Also included is a command-line interface, identical to the old
16-
IDL function. Online help is available with the ``-h`` option.
17-
[`Completed: 2021-01-26`]
17+
.. _grateq:
18+
19+
The Grating Equation
20+
^^^^^^^^^^^^^^^^^^^^
21+
22+
The angles at which the diffracted light reflects off the grating are given
23+
by the grating equation:
24+
25+
.. math::
26+
27+
\begin{equation}
28+
m\lambda = d(\sin \theta _{i}-\sin \theta _{m})~,
29+
\end{equation}
30+
31+
where :math:`d` is the spacing between adjacent grooves on the grating,
32+
:math:`\theta_{i} = \theta_{\rm grangle} + 10^{\circ}` is the incident angle,
33+
and :math:`\theta_{m} = 55^{\circ} - \theta_{i}` is the outgoing angle for light
34+
with wavelength :math:`\lambda` diffracting into order :math:`m` (see the
35+
DeVeny user manual for a description of the physical layout of the
36+
spectrograph). The DeVeny gratings are typically operated in
37+
1\ :superscript:`st`\ order (:math:`m = 1`), although use of :math:`m=2` would
38+
possible with the proper short-pass order-blocking filters to remove
39+
1\ :superscript:`st`\ -order light.
40+
41+
This tool computes the necessary tilt :math:`\theta_{\rm grangle}` by
42+
numerically solving the equation below for a given grating. The computation
43+
uses the groove density (in g/mm) in place of :math:`d`, and finds
44+
:math:`\theta_{\rm grangle}` for a specified 1\ :superscript:`st`\ -order
45+
central wavelength (:math:`\lambda_c`) in Angstroms on the spectral CCD.
46+
47+
.. math::
48+
49+
\begin{equation}
50+
\lambda_c~({\rm \mathring{A}}) = \frac{\sin(\theta_{\rm grangle} +10^{\circ}) - \sin(45^{\circ} - \theta_{\rm grangle})}{ {\rm groove~density~(g/mm)} }\times 10^7
51+
\end{equation}
1852
1953
2054
Usage
@@ -24,3 +58,37 @@ The script usage can be displayed by calling the script with the
2458
``-h`` option:
2559

2660
.. include:: help/deveny_grangle.rst
61+
62+
In its default mode, the tool launches a GUI window as in
63+
:numref:`grangle_startup`.
64+
65+
.. _grangle_startup:
66+
.. figure:: figures/deveny_grangle_startup.png
67+
:class: with-shadow
68+
:alt: GUI at startup
69+
70+
-- The ``deveny_collfocus`` GUI at startup.
71+
72+
Select your grating from the dropdown menu (this selects the groove density),
73+
and enter your desired central wavelength (in angstroms). When you click
74+
"Compute", the bottom half of the GUI is populated with the needed grating tilt
75+
value from the equation above and the computed slit demagnification value (see
76+
the DeVeny user manual for a brief discussion of grating physics). See
77+
:numref:`grangle_values`.
78+
79+
.. _grangle_values:
80+
.. figure:: figures/deveny_grangle_values.png
81+
:class: with-shadow
82+
:alt: GUI after clicking "Compute"
83+
84+
-- The ``deveny_grangle`` GUI after clicking "Compute". The needed grating
85+
tilt angle and computed slit demagnification values have been populated.
86+
87+
There are two optional modes for running this tool:
88+
89+
* ``--cli``: A command-line version of this tool, which looks and functions
90+
identical to the old IDL routine with the same name.
91+
92+
* ``--max``: The GUI will have the option to compute the central wavelength
93+
from :math:`\theta_{\rm grangle}` in addition to the forward calculation
94+
done in the default mode.

0 commit comments

Comments
 (0)