Skip to content

Commit 7b12827

Browse files
authored
Merge pull request #4 from LowellObservatory/deveny_pickup
Deveny Pickup Scrubber Tool
2 parents 52a5e82 + cb35602 commit 7b12827

File tree

68 files changed

+117249
-818
lines changed

Some content is hidden

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

68 files changed

+117249
-818
lines changed

.github/workflows/documentation.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Docs
2+
on: [push, pull_request, workflow_dispatch]
3+
permissions:
4+
contents: write
5+
jobs:
6+
docs:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
# we want to find git tags to pass version to sphinx
12+
fetch-depth: 0
13+
- uses: actions/setup-python@v3
14+
- name: Install dependencies
15+
run: |
16+
pip install sphinx sphinx_rtd_theme sphinx-automodapi .[dev]
17+
- name: Sphinx build
18+
run: |
19+
cd doc ; make clean ; make html
20+
- name: Deploy to GitHub Pages
21+
uses: peaceiris/actions-gh-pages@v3
22+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
23+
with:
24+
publish_branch: gh-pages
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: doc/_build/html
27+
force_orphan: true

README.rst

+48-87
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
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:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
5-
:target: http://www.astropy.org/
4+
.. |astropy| image:: https://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
5+
:target: https://www.astropy.org/
66

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

10+
.. |issues| image:: https://img.shields.io/github/issues/LowellObservatory/LDTObserverTools?style=social
11+
:target: https://github.com/LowellObservatory/LDTObserverTools
12+
1013
.. |stars| image:: https://img.shields.io/github/stars/LowellObservatory/LDTObserverTools?style=social
1114
:target: https://github.com/LowellObservatory/LDTObserverTools
1215

@@ -30,10 +33,18 @@ LDTObserverTools |forks| |stars| |watch|
3033
|github| |astropy| |License|
3134

3235

33-
**Version**: |version|
36+
The LDTObserverTools package is a collection of command-line and GUI tools
37+
for observers at the Lowell Discovery Telescope (LDT) in Happy Jack, AZ.
3438

35-
LDTObserverTools is a collection of command-line and GUI tools for observers at
36-
the Lowell Discovery Telescope (LDT) in Happy Jack, AZ.
39+
Some of these tools are Python ports of existing tools written in other
40+
languages, and others are newly written to meet particular needs of the
41+
observing community. Detailed instructions on how to use each tool are
42+
contained in the `online documentation
43+
<https://lowellobservatory.github.io/LDTObserverTools/>`__. Please use
44+
the GitHub `Issues
45+
<https://github.com/LowellObservatory/LDTObserverTools/issues>`__ and/or
46+
`Pull Requests <https://github.com/LowellObservatory/LDTObserverTools/pulls>`__
47+
features to report bugs or suggest new tools and features.
3748

3849
.. contents:: Table of Contents
3950
:depth: 1
@@ -51,81 +62,28 @@ List of Programs
5162
Tools Contained in this Package:
5263
--------------------------------
5364

54-
- ``deveny_grangle``: Compute the desired grating angle based on selected
55-
grating and desired central wavelength. This routine comes with two interfaces.
56-
The default GUI features a dropdown menu for grating selection and contains error
57-
checking on the input for central wavelength. There is a ``MAX_GUI`` option for
58-
computing central wavelength given the grating angle in addition to the standard
59-
GUI features. Also included is a command-line interface, identical to the old
60-
IDL function. Online help is available with the ``-h`` option.
61-
[`Completed: 2021-01-26`]
62-
63-
- ``dfocus``: Compute the needed collimator focus based on a series of arc line
64-
frames taken at various collimator settings. Read in the arc lamp frames in
65-
the current night's focus directory, find the appropriate spectral lines in each
66-
frame, compute the FHWM (or other measure) of those lines, plot the FHWM as a
67-
function of collimator position and suggest the optimal focus position. This
68-
program is executed identically to the old IDL version. The python version
69-
uses :obj:`scipy.signal` processing routines for identifying line peaks and widths,
70-
resulting in more accurate and consistent estimates of the correct collimator
71-
focus position. Rather than separately producing plots to the screen and disk,
72-
this version writes all plots to a PDF, then launches ``Preview.app`` to display
73-
the plots on the screen. Newly added is a readout of the mount temperature so
74-
the user can determine when/if the collimator needs to be refocused during the
75-
night. Online help is available with the ``-h`` option. [`Completed: 2021-11-19`]
76-
77-
- ``fix_ldt_header``: Replace / add / update FITS keyword values. While named for
78-
the LDT, it can beused with any FITS file (or list of files). The inspiration for
79-
this script is the cases when the LDT / LOUI does not input the proper information
80-
in FITS headers (`e.g.`, ``GRATING = UNKNOWN`` for DeVeny before the drop-down
81-
menu has been selected). Online help is available with the ``-h`` option.
82-
[`Completed: 2022-10-17`]
83-
84-
- ``deveny_collfocus``: Use the specified grating angle and mount temperature
85-
to suggest a range for use with the DeVeny LOUI collimator Focus Sequence
86-
function. This GUI computes the expected focus from an emperical equation
87-
derived from DeVeny data from 2017-2020, and then suggests the focus range.
88-
This is important because, unlike all other focus routines at LDT,
89-
this function takes the **starting point**, step, and number of exoposures
90-
rather than the **expected focus value**, step, and number of exposures.
91-
[`Completed: 2023-07-31`]
65+
- DeVeny Spectrograph grating angle calculator (``deveny_grangle``)
66+
67+
- DeVeny Spectrograph collimator focus sequence estimator (``deveny_collfocus``)
68+
69+
- DeVeny Spectrograph collimator focus calculator (``dfocus``)
70+
71+
- DeVeny Spectrograph pickup noise scrubber (``scrub_deveny_pickup`` -- *beta testing*)
72+
73+
- Simple FITS header fixing tool (``fix_ldt_header``)
9274

9375
.. _future:
9476

9577
Future Tools (planned or in development):
9678
-----------------------------------------
9779

98-
- ``lmi_etc``: Python GUI version of the LMI exposure time calculator
99-
(http://www2.lowell.edu/users/massey/LMI/etc_calc.php).
100-
101-
- ``neocp_ephem``: An ephemeris-generating tool for querying the JPL Scout database
102-
for short-shelf- life NEOs that have not yet been assigned a Horizons identifier.
103-
This tool will turn the returned data into a file that can be ingested into the
104-
LDT TCS for observations.
105-
106-
- ``validate_input_list``: The extant input list validation tool
107-
(https://confluence.lowell.edu/display/LDTOI/Validate+Input+List) was
108-
produced in 2015 using an old Java Runtime Environment that is not available on
109-
most modern operating systems. As such, the tool is virtually useless. This
110-
python program would provide this key functionality in a modern environment.
111-
112-
- ``observer_target_list``: The extant observer target list tool
113-
(https://confluence.lowell.edu/display/LDTOI/Observer+Target+List+User+Manual)
114-
was produced in 2015 using an old Java Runtime Environment that is not available on
115-
most modern operating systems. It still runs happily on the LDT observer machines,
116-
but those will need to be replaced at some point. This python version will provide
117-
a future-proof solution.
118-
119-
- ``scrub_deveny_pickup``: The DeVeny spectrograph suffers from EM ground-loop
120-
pickup noise in the readout electronics. While the Instrument Groups is working
121-
diligently to identify the source of this noise, it is still affecting frames at
122-
the 5-10 DN level. This routine will attempt to clean the pattern from the raw
123-
frames. It works in an iterative fashion with the spectroscopic data reduciton
124-
pipeline `PypeIt <https://pypeit.readthedocs.io/en/release/index.html>`_ to
125-
identify and extract sources and sky signal before attempting to fit and remove
126-
the remaining pickup noise. If you wish to use this routine, please follow the
127-
instructions in :ref:`optional-dependencies` to include PypeIt in your
128-
LDTObserverTools installation.
80+
- LMI exposure time calculator (``lmi_etc``)
81+
82+
- NEO Confirmation Page ephemeris generator (``neocp_ephem``)
83+
84+
- Input List Validator (``validate_input_list``)
85+
86+
- Observer Target List Tool (``observer_target_list``)
12987

13088
==================
13189

@@ -139,10 +97,11 @@ Installing
13997
Set up a clean python environment
14098
---------------------------------
14199

142-
Because installing a python tool like LDTObserverTools also installs or upgrades
143-
its :ref:`dependencies`, the best course of action is to set up a clean python
144-
environment into which the installation will occur. This mitigates any possible
145-
dependency conflicts with other packages you use.
100+
Because installing a python tool like LDTObserverTools also installs or
101+
upgrades its :ref:`Package Dependencies <dependencies>`, the best course of
102+
action is to setup a clean python environment into which the installation will
103+
occur. This mitigates any possible dependency conflicts with other packages
104+
you use.
146105

147106
The recommended method of setting up a new envrionment is with ``conda``:
148107

@@ -163,7 +122,7 @@ Installing LDTObserverTools via ``pip``
163122
.. note::
164123
The commands here assume ``pip`` is associated with Python3. To check, run
165124
``pip --version`` from the command line and check that the associated python
166-
version is ``>= 3.9``.
125+
version is ``>= 3.10``.
167126

168127
Also, you will need ``git`` installed on your system / in your environment.
169128

@@ -191,14 +150,16 @@ simply be a matter of executing:
191150
Optional Dependencies
192151
^^^^^^^^^^^^^^^^^^^^^
193152

194-
Some of the instrument-specific routines in this package require additional dependencies
195-
that are not otherwise needed by the majority of the routines herein.
153+
There are no optional dependencies at this time.
154+
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.
196157
197-
- If you are using the ``deveny_pickup_cleaner`` routine, you will need the
198-
spectroscopic data reduction pipeline PypeIt for the iterative cleaning of
199-
the pickup noise. It can be installed by including it in the optional
200-
dependencies, `e.g.`:
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.`:
201162
202-
.. code-block:: console
163+
.. .. code-block:: console
203164
204-
pip install "obstools[pypeit] @ git+https://github.com/LowellObservatory/LDTObserverTools"
165+
.. pip install "obstools[pypeit] @ git+https://github.com/LowellObservatory/LDTObserverTools"

doc/Makefile

+2-10
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,8 @@ clean:
3737

3838
apirst:
3939
SPHINX_APIDOC_OPTIONS=$(SPHINXAPIOPT) $(SPHINXAPI) --separate -o ./api ../obstools ../obstools/version.py
40-
# python3 ./scripts/build_dependency_rst.py
41-
# python3 ./scripts/build_detector_table.py
42-
# python3 ./scripts/build_imgproc_defaults.py
43-
# python3 ./scripts/build_par_rst.py
44-
# python3 ./scripts/build_specobj_rst.py
45-
# python3 ./scripts/build_calib_images_rst.py
46-
# python3 ./scripts/write_script_help.py
47-
# python3 ./scripts/build_bitmask_rst.py
48-
# python3 ./scripts/build_spectbl_rst.py
49-
# python3 ./scripts/make_example_files.py
40+
python ./scripts/write_script_help.py
41+
python ./scripts/build_dependency_rst.py
5042

5143
html:
5244
make apirst

doc/api/obstools.fits_utils.rst

-8
This file was deleted.

doc/api/obstools.fix_ldt_header.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
obstools.fix\_ldt\_header module
2+
================================
3+
4+
.. automodule:: obstools.fix_ldt_header
5+
:members:
6+
:private-members:
7+
:undoc-members:
8+
:show-inheritance:

doc/api/obstools.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Submodules
1313
obstools.deveny_grangle
1414
obstools.dfocus
1515
obstools.etc_calc
16-
obstools.fits_utils
16+
obstools.fix_ldt_header
1717
obstools.neocp_ephem
1818
obstools.scrub_deveny_pickup
1919
obstools.utils

doc/conf.py

+11-16
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,13 @@
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
13-
import os
14-
import sys
15-
16-
sys.path.insert(0, os.path.abspath("."))
17-
from pkg_resources import get_distribution
18-
19-
# Get configuration information from setup.cfg
2013
from configparser import ConfigParser
14+
from importlib import metadata
15+
import pathlib
2116

17+
# Get configuration information from setup.cfg
2218
conf = ConfigParser()
23-
24-
conf.read([os.path.join(os.path.dirname(__file__), "..", "setup.cfg")])
19+
conf.read([pathlib.Path(__file__).parents[1] / "setup.cfg"])
2520
setup_cfg = dict(conf.items("metadata"))
2621

2722
# -- Project information -----------------------------------------------------
@@ -52,7 +47,7 @@
5247
"sphinx.ext.mathjax",
5348
"sphinx.ext.ifconfig",
5449
"sphinx.ext.viewcode",
55-
"sphinx.ext.autosectionlabel",
50+
# "sphinx.ext.autosectionlabel",
5651
]
5752

5853
# automodapi
@@ -70,9 +65,10 @@
7065
napoleon_use_rtype = False
7166

7267
# Autosection
73-
7468
autosectionlabel_prefix_document = True
7569

70+
# Figures
71+
numfig = True
7672

7773
# Add any paths that contain templates here, relative to this directory.
7874
templates_path = ["_templates"]
@@ -109,9 +105,7 @@
109105
# Theme options are theme-specific and customize the look and feel of a theme
110106
# further. For a list of options available for each theme, see the
111107
# documentation.
112-
html_theme_options = {
113-
"logo_only": True,
114-
}
108+
html_theme_options = {"logo_only": True, "prev_next_buttons_location": None}
115109

116110
# The name of an image file (relative to this directory) to place at the top
117111
# of the sidebar.
@@ -126,7 +120,7 @@
126120
master_doc = "index"
127121

128122
# The full version, including alpha/beta/rc tags.
129-
version = get_distribution(setup_cfg["name"]).version
123+
version = metadata.version(setup_cfg["name"])
130124

131125
# Example configuration for intersphinx: refer to the Python standard library.
132126
intersphinx_mapping = {
@@ -136,5 +130,6 @@
136130
"matplotlib": ("https://matplotlib.org/stable/", None),
137131
"numpy": ("https://numpy.org/doc/stable/", None),
138132
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
139-
"scipy": ('https://docs.scipy.org/doc/scipy/', None)
133+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
134+
"pypeit": ("https://pypeit.readthedocs.io/en/release/", None),
140135
}

0 commit comments

Comments
 (0)