Skip to content
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
60d66b3
Merge pull request #2073 from kbwestfall/devup
kbwestfall Feb 18, 2026
f66ae68
Revert "Updates `develop` for changes to `release` and bumps dev doc"
kbwestfall Feb 18, 2026
0dadad8
keep the tox fix
kbwestfall Feb 18, 2026
937fa87
Merge pull request #2075 from pypeit/revert-2073-devup
kbwestfall Feb 19, 2026
6834711
tweak params based on decker
bpholden Feb 19, 2026
e208efc
change exception to warning
bpholden Feb 19, 2026
75d5bf8
remove pdb
bpholden Feb 19, 2026
1c30c3c
Merge branch 'develop' into APF_tweaks
bpholden Feb 22, 2026
079bc13
additional tweak
bpholden Feb 24, 2026
d8690fe
avoid importing from one test into another
kbwestfall Feb 27, 2026
935f6bb
test restructureing
kbwestfall Feb 27, 2026
241caa5
Merge branch 'load_wmko' into init_issues
kbwestfall Feb 27, 2026
4cd02c7
bug
kbwestfall Feb 27, 2026
2fd2b06
restructure cache
kbwestfall Feb 27, 2026
59c28c4
scripts
kbwestfall Feb 27, 2026
70bd2a5
mv eval_tuple and similar to pypeit.utils
kbwestfall Feb 27, 2026
bfff721
imports
kbwestfall Feb 28, 2026
e58e632
bugs
kbwestfall Feb 28, 2026
79debda
test fixes
kbwestfall Mar 2, 2026
ebbe66d
rename pkg dir
kbwestfall Mar 2, 2026
682f2f5
fix imports
kbwestfall Mar 2, 2026
da5eb2c
doc update and fixes
kbwestfall Mar 2, 2026
6a996cc
Merge branch 'autoid_wv_fitting' into pkg_cycles
kbwestfall Mar 2, 2026
d1531e5
Merge branch 'spec_extract' into pkg_cycles
kbwestfall Mar 2, 2026
fc76fdf
Merge branch 'load_kdtree' into pkg_cycles
kbwestfall Mar 2, 2026
9e0a62d
Merge branch 'pydl' into pkg_cycles
kbwestfall Mar 2, 2026
4a53007
Merge branch 'autoid_wv_fitting' into pkg_cycles
kbwestfall Mar 2, 2026
1dcec1c
Merge branch 'spec_extract' into pkg_cycles
kbwestfall Mar 2, 2026
e3512c3
doc update
kbwestfall Mar 2, 2026
428ebb8
Merge branch 'release' into APF_tweaks
kbwestfall Mar 3, 2026
ddd0a8b
Merge branch 'load_wmko' into pkg_cycles
kbwestfall Mar 5, 2026
4f368f5
Merge branch 'develop' into pkg_cycles
kbwestfall Mar 5, 2026
b8d80a4
Merge branch 'load_wmko' into pkg_cycles
kbwestfall Mar 5, 2026
f25af9c
Merge branch 'load_wmko' into pkg_cycles
kbwestfall Mar 6, 2026
f693897
Merge pull request #2079 from pypeit/APF_tweaks
bpholden Mar 7, 2026
aabc9e1
ginga spec1d commands
kbwestfall Mar 11, 2026
92e4fd3
release updates
kbwestfall Mar 11, 2026
6c1d94e
add to whatsnew
kbwestfall Mar 11, 2026
8f16fa3
restore pypeit_modes.py
kbwestfall Mar 23, 2026
5c54674
improve text
kbwestfall Mar 23, 2026
72bf910
exten fix
kbwestfall Mar 23, 2026
ee978b7
doc update
kbwestfall Mar 23, 2026
d5f8d74
Merge pull request #2089 from kbwestfall/spec1d_docs
kbwestfall Mar 23, 2026
da3af48
Merge branch 'develop' into pkg_cycles
kbwestfall Mar 24, 2026
98c6c9b
clean-up and changes
kbwestfall Mar 24, 2026
ce03cca
doc update
kbwestfall Mar 24, 2026
b616ad1
Merge branch 'release' into pkg_cycles
kbwestfall Mar 24, 2026
51cced1
Merge branch 'develop' into pkg_cycles
kbwestfall Mar 31, 2026
475cae1
doc update
kbwestfall Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Thumbs.db
######################################
*/version.py
*/cython_version.py
*/pkg/version.py

# ADDED by KBW
.eggs
Expand Down
8 changes: 0 additions & 8 deletions doc/api/pypeit.cache.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/api/pypeit.logger.rst

This file was deleted.

8 changes: 8 additions & 0 deletions doc/api/pypeit.pkg.cache.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pypeit.pkg.cache module
=======================

.. automodule:: pypeit.pkg.cache
:members:
:private-members:
:show-inheritance:
:undoc-members:
8 changes: 8 additions & 0 deletions doc/api/pypeit.pkg.exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pypeit.pkg.exceptions module
============================

.. automodule:: pypeit.pkg.exceptions
:members:
:private-members:
:show-inheritance:
:undoc-members:
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pypeit.exceptions module
pypeit.pkg.logger module
========================

.. automodule:: pypeit.exceptions
.. automodule:: pypeit.pkg.logger
:members:
:private-members:
:show-inheritance:
Expand Down
8 changes: 8 additions & 0 deletions doc/api/pypeit.pkg.pypeitdata.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pypeit.pkg.pypeitdata module
============================

.. automodule:: pypeit.pkg.pypeitdata
:members:
:private-members:
:show-inheritance:
:undoc-members:
23 changes: 23 additions & 0 deletions doc/api/pypeit.pkg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pypeit.pkg package
==================

Submodules
----------

.. toctree::
:maxdepth: 4

pypeit.pkg.cache
pypeit.pkg.exceptions
pypeit.pkg.logger
pypeit.pkg.pypeitdata
pypeit.pkg.version

Module contents
---------------

.. automodule:: pypeit.pkg
:members:
:private-members:
:show-inheritance:
:undoc-members:
8 changes: 8 additions & 0 deletions doc/api/pypeit.pkg.version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pypeit.pkg.version module
=========================

.. automodule:: pypeit.pkg.version
:members:
:private-members:
:show-inheritance:
:undoc-members:
8 changes: 0 additions & 8 deletions doc/api/pypeit.pypeitdata.rst

This file was deleted.

5 changes: 1 addition & 4 deletions doc/api/pypeit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Subpackages
pypeit.images
pypeit.move_median
pypeit.par
pypeit.pkg
pypeit.scripts
pypeit.setup_gui
pypeit.spectrographs
Expand All @@ -27,15 +28,13 @@ Submodules
pypeit.alignframe
pypeit.archive
pypeit.bitmask
pypeit.cache
pypeit.calibframe
pypeit.calibrations
pypeit.coadd1d
pypeit.coadd2d
pypeit.coadd3d
pypeit.datamodel
pypeit.edgetrace
pypeit.exceptions
pypeit.exposure
pypeit.extraction
pypeit.find_objects
Expand All @@ -44,7 +43,6 @@ Submodules
pypeit.history
pypeit.inputfiles
pypeit.io
pypeit.logger
pypeit.manual_extract
pypeit.metadata
pypeit.multislit_flexure
Expand All @@ -53,7 +51,6 @@ Submodules
pypeit.outputfiles
pypeit.pypeit
pypeit.pypeit_steps
pypeit.pypeitdata
pypeit.pypeitsetup
pypeit.sampling
pypeit.scattlight
Expand Down
1 change: 1 addition & 0 deletions doc/api/pypeit.scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Submodules
pypeit.scripts.skysub_regions
pypeit.scripts.tellfit
pypeit.scripts.trace_edges
pypeit.scripts.util
pypeit.scripts.version
pypeit.scripts.view_fits

Expand Down
8 changes: 8 additions & 0 deletions doc/api/pypeit.scripts.util.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pypeit.scripts.util module
==========================

.. automodule:: pypeit.scripts.util
:members:
:private-members:
:show-inheritance:
:undoc-members:
31 changes: 20 additions & 11 deletions doc/dev/new_script.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The important components of the scripts are:
:class:`~pypeit.scripts.scriptbase.ScriptBase` as their base class. Note
that the class has no instantiation method.

* The :func:`~pypeit.scripts.scriptbase.ScriptBase.get_parser` function is used
to return an instance of `argparse.ArgumentParser`_ used to parse the
* The :func:`~pypeit.scripts.scriptbase.ScriptBase.get_parser` function
returns an instance of :class:`argparse.ArgumentParser` used to parse the
command-line arguments.

* The :func:`~pypeit.scripts.scriptbase.ScriptBase.main` function performs the
Expand All @@ -52,26 +52,35 @@ The base class, :class:`~pypeit.scripts.scriptbase.ScriptBase`, provides the
common entry point function
(:func:`~pypeit.scripts.scriptbase.ScriptBase.entry_point`) used during
installation. To ensure that the script is properly installed by `pip`_, you
need to add this entry point to the ``setup.cfg`` file. All of the PypeIt
scripts are listed in the ``[options.entry_points]`` group. To add your script,
you enter a new line with the following format:
need to add this entry point to the ``pypeit/pyproject.toml`` file. All of the
PypeIt scripts are listed in the ``[options.entry_points]`` group. To add your
script, you enter a new line with the following format:

.. code-block:: ini

pypeit_new_script = pypeit.scripts.new_script:NewScript.entry_point

Lastly, you should add the import of the script module to the
``pypeit/scripts/__init__.py`` file; i.e., add:
Lastly, you should add the script module name to the ``__all__`` list in
the ``pypeit/scripts/__init__.py`` file; i.e., add:

.. code-block:: python

from pypeit.scripts import new_script
__all__ = [
...
'new_script',
...
]

Preferably add the new script name in a way that maintains the alphabetical
ordering of the scripts in the list.

Note that the script files in the ``pypeit/scripts`` directory:

* Should not be executable (i.e., no xs in their permissions)
* Should not start with an env statement; i.e., ``#!/usr/bin/env python``
* Should not end with the ``if __name__ == '__main__':`` block
- Should not be executable (i.e., no ``x`` in their permissions)

- Should not start with an env statement; i.e., ``#!/usr/bin/env python``

- Should not end with the ``if __name__ == '__main__':`` block

Creating the executables from the raw script files is all handled by `pip`_
installing PypeIt. To ensure the script is installed, from the top-level
Expand Down
62 changes: 39 additions & 23 deletions doc/dev/new_spectrograph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Here are notes on how to add a new spectrograph from scratch or to add a new
mode. To do so, you should install PypeIt following the development path;
see :doc:`../installing` and :doc:`development`.

Entirely New
============
Adding an entirely new spectrograph
===================================

PypeIt defines instrument-specific behavior/parameters using a python
class hierarchy; see :class:`~pypeit.spectrographs.spectrograph.Spectrograph`
Expand All @@ -33,8 +33,8 @@ The class-hierarchy is used by PypeIt to specify certain instrument
modes, like spectrograph arm, that inherit from a common base class. For
example, :class:`~pypeit.spectrographs.keck_lris.KeckLRISSpectrograph`
implements many of the methods that are common to both arms (red and blue) of
the spectrograph. These include methods used to read raw files, used to
define header cards with required :doc:`metadata`, and used to determine the type of
the spectrograph. These include methods used to read raw files, to
define header cards with required :doc:`metadata`, and to determine the type of
frame (arc, dome, bias, etc) based on that :doc:`metadata`. The
:class:`~pypeit.spectrographs.spectrograph.Spectrograph` instance for each
LRIS arm inherits these methods common to them both by subclassing from
Expand All @@ -52,20 +52,29 @@ spectrograph has a similar set of modes, see
Having said all of that, the basic steps one needs to follow to introduce a
new spectrograph are as follows:

#. Build a new file called ``telescope_spectrograph.py`` file and put it in the
``pypeit/spectrographs/`` directory.
#. Build a new file called ``{telescope}_{spectrograph}.py`` file and put it in
the ``pypeit/spectrographs/`` directory.

#. Add the new module to the list imported by
``pypeit/spectrographs/__init__.py``.
#. Add the name of the new module to the ``__all__`` list defined in
``pypeit/spectrographs/__init__.py``. E.g.

#. Generate a new Telescope object in (if new)
``pypeit/telescopes.py``.
.. code-block:: python

#. Add telescope name to valid_telescopes in
__all__ = [
...
'keck_lris',
...
]

Please maintain the alphabetical ordering of the modules listed.

#. Generate a new Telescope object in ``pypeit/telescopes.py``, as needed.

#. Add the telescope name to the list of ``valid_telescopes`` in
``pypeit/par/pypeitpar.py``.

#. Set the algorithmic path: the class attribute, ``pypeline``, must be
``'MultiSlit'``, ``'Echelle'``, or ``'IFU'``.
``'MultiSlit'``, ``'Echelle'``, or ``'SlicerIFU'``.

#. Set the default parameters PypeIt uses during the reduction; see
:ref:`parameters`, and, e.g.,
Expand Down Expand Up @@ -95,20 +104,18 @@ new spectrograph are as follows:
compare to, e.g.,
:func:`~pypeit.spectrographs.keck_deimos.KeckDEIMOSSpectrograph.get_rawimage`.

#. For echelle spectrographs, there are numerous methods required that provide
details for the (currently fixed) format of the orders. See, e.g.,
#. For fixed-format echelle spectrographs, there are numerous methods that
provide details for the expected format of the orders. See, e.g.,
:class:`~pypeit.spectrographs.vlt_xshooter.VLTXShooterNIRSpectrograph`.

#. You may need to generate wavelength solutions for your setups. You can use the
:ref:`pypeit_identify` utility, and add this to the PypeIt archive by
#. You may need to generate wavelength solutions for your setups. You can use
the :ref:`pypeit_identify` utility, and add this to the PypeIt archive by
following the steps outlined in the :doc:`../calibrations/construct_template`
documentation. See :ref:`wave_calib`.


See this `example PR <https://github.com/pypeit/PypeIt/pull/1179>`_ for the
SOAR/Goodman spectrograph.


Near-IR
+++++++

Expand All @@ -119,14 +126,14 @@ an example.
Tests
+++++

For a spectrograph to be supported going forth, we require a minimum set
of tests. These are:
For a spectrograph to be designated as being "supported" by PypeIt, we require a
minimum set of tests. These are:

- A full run of the pipeline for each grating/mode of the spectrograph in
the `PypeIt Development Suite`_.

- A simple unit test that check an image can be loaded. This needs to be
added to the `PypeIt Development Suite`_; see `here
- A simple unit test that checks that an image can be loaded. This needs to
be added to the `PypeIt Development Suite`_; see `here
<https://github.com/pypeit/PypeIt-development-suite/blob/main/unit_tests/test_load_images.py>`__.

Docs
Expand All @@ -135,9 +142,18 @@ Docs
We request that the following docs be updated to advertise the new
spectrograph:

- Update the top-level ``CHANGES.rst``
- Include a comment noting the addition of the relevant spectrograph module in
the most recent release doc in ``doc/releases``. There is typically a section
for "Instrument-specific" changes.

- If specific advice is important/useful, add an instrument specific doc to the
``doc/spectrographs`` directory and link the doc in the
``doc/specrographs/spectrographs.rst`` doc.

- It will be helpful to users to have a tutorial to follow when using PypeIt to
reduce data from the newly supported spectrograph. Please either add a new
tutorial (see, e.g., ``doc/tutorials/lris_howto.rst``) or add a comment in
``doc/tutorials/tutorials.rst`` pointing users to a spectrograph tutorial that
is very similar (or identical) to the procedures that should be used for the
new spectrograph.

22 changes: 12 additions & 10 deletions doc/help/pypeit_show_1dspec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

$ pypeit_show_1dspec -h
usage: pypeit_show_1dspec [-h] [-v VERBOSITY] [--log_file LOG_FILE]
[--log_level LOG_LEVEL] [--list] [--exten EXTEN]
[--obj OBJ] [--extract EXTRACT] [--flux] [-m]
[--log_level LOG_LEVEL] [--list] [--exten EXTEN |
--obj OBJ] [--extract {BOX,OPT}] [--flux] [-m]
file

Show a 1D spectrum

positional arguments:
file Spectral file
file PypeIt spec1d file (this script does not work with
coadd_1dspec output spectra).

options:
-h, --help show this help message and exit
Expand All @@ -25,12 +26,13 @@
Verbosity level for the log file. If a log file is
produce and this is None, the file log will match the
console stream log. (default: None)
--list List the extensions only? (default: False)
--exten EXTEN FITS extension (default: 1)
--obj OBJ Object name in lieu of extension, e.g.
--list Instead of plotting any spectra, simply list the
extensions with spectra (default: False)
--exten EXTEN Number of the extension to plot (default: 1)
--obj OBJ Extension (object) name to plot, e.g.
SPAT0424-SLIT0000-DET01 (default: None)
--extract EXTRACT Extraction method. Default is OPT. ['BOX', 'OPT']
(default: OPT)
--flux Show fluxed spectrum? (default: False)
-m, --unmasked Only show unmasked data. (default: True)
--extract {BOX,OPT} Method used to extract the spectrum (default: OPT)
--flux Show the flux-calibrated spectrum (if available)
(default: False)
-m, --unmasked Only show the unmasked data. (default: True)

2 changes: 1 addition & 1 deletion doc/help/run_pypeit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
pypeit_file

PypeIt: The Python Spectroscopic Data Reduction Pipeline
Version 2.0.1.dev45+g1d735d64c
Version 2.0.1.dev23+g72bf91080.d20260323

Available spectrographs include:
aat_uhrf, apf_levy, bok_bc, gemini_flamingos1, gemini_flamingos2,
Expand Down
1 change: 1 addition & 0 deletions doc/include/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
.. _pdb: https://docs.python.org/3/library/pdb.html
.. _IPython.embed: https://ipython.readthedocs.io/en/stable/api/generated/IPython.terminal.embed.html#function
.. _pytest: https://docs.pytest.org/en/latest/
.. _shapely: https://shapely.readthedocs.io/en/stable/manual.html
.. _scikit-image: https://scikit-image.org/
.. _bottleneck: https://bottleneck.readthedocs.io/en/latest/
.. _specutils: https://specutils.readthedocs.io/en/stable/
Expand Down
Loading
Loading