Skip to content

Commit

Permalink
Update prject to lastest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
simontorres committed Mar 21, 2024
2 parents dd1c173 + fd897c1 commit ee7b4a5
Show file tree
Hide file tree
Showing 41 changed files with 290 additions and 306 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/python-package-conda.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -30,10 +30,10 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Compile DCR Binaries
run: |
SOURCE_DIR=${{ github.workspace }}/goodman_pipeline/data/dcr-source/dcr
SOURCE_DIR=${{ github.workspace }}/goodman_pipeline/data/dcr_source/dcr
make --directory $SOURCE_DIR
chmod +x $SOURCE_DIR/dcr
echo "${{ github.workspace }}/goodman_pipeline/data/dcr-source/dcr" >> $GITHUB_PATH
echo "${{ github.workspace }}/goodman_pipeline/data/dcr_source/dcr" >> $GITHUB_PATH
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -44,7 +44,7 @@ jobs:
run: |
pytest --cov=goodman_pipeline
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
fail_ci_if_error: true # optional (default = false)
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ __pycache__/*
.ipynb_checkpoints/*
files.txt
docs/_build/*
goodman_pipeline/data/dcr-source/dcr
goodman_pipeline/data/dcr-source/*.o
goodman_pipeline/data/dcr_source/dcr
goodman_pipeline/data/dcr_source/*.o
/dev-tools/
.cache/*
.eggs/*
.tmp/*
.tox/*
goodman_pipeline.egg-info/*
*.DS_Store
9 changes: 6 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
version: 2

build:
os: ubuntu-lts-latest
tools:
python: "mambaforge-22.9"


sphinx:
configuration: docs/conf.py

formats: all



python:
version: 3.5
install:
- method: pip
path: .
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Goodman High Throughput Spectrograph Data Reduction Pipeline

![Goodman Pipeline](https://github.com/soar-telescope/goodman_pipeline/workflows/Goodman%20Pipeline/badge.svg?branch=master)
![Goodman Pipeline](https://github.com/soar-telescope/goodman_pipeline/actions/workflows/python-package.yml/badge.svg)
[![codecov](https://codecov.io/gh/soar-telescope/goodman_pipeline/branch/main/graph/badge.svg)](https://codecov.io/gh/soar-telescope/goodman_pipeline)
[![Documentation Status](https://readthedocs.org/projects/goodman/badge/?version=latest)](http://goodman.readthedocs.io/en/latest/?badge=latest)
[![pypi](https://img.shields.io/pypi/v/goodman_pipeline.svg?style=flat)](https://pypi.org/project/goodman-pipeline/)
[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/)


![Upload to PYPI](https://github.com/soar-telescope/goodman_pipeline/workflows/Upload%20to%20PYPI/badge.svg)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/soar-telescope/goodman_pipeline.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/soar-telescope/goodman_pipeline/alerts/)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/soar-telescope/goodman_pipeline.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/soar-telescope/goodman_pipeline/context:python)


## Overview
The Goodman High Throughput Spectrograph (Goodman HTS) Data-Reduction Pipeline
Expand Down
48 changes: 48 additions & 0 deletions docs/_common_issues.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. _common_issues:

Common issues
*************

No comparison lamps were found
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The latest version may introduce changes to wavelength solutions. To
view the current list of available modes and lamps, please refer to the
`GitHub repository <https://github.com/soar-telescope/goodman_pipeline/tree/main/goodman_pipeline/data/ref_comp>`_.

If your lamp, filter, or mode is not included in the repository mentioned
above, ``redspec`` will not work as expected. This is particularly common
with custom modes of the |pipeline full name|. You may encounter the following
error after running ``redspec``:

.. code-block:: console
$ redspec
[15:02:49][W]: No comparison lamps were provided for file ecfzst_0001_science.fits
This error occurs because the |pipeline full name| relies on specific keywords to
extract spectra, such as:

.. _`table lamp key`:

.. table:: Keywords that are used to produce a wavelength solution.

========== =============================================================
Keyword Purpose
========== =============================================================
LAMP_HGA Indicates if HgAr lamp is used.
LAMP_NE Indicates if Ne lamp is used.
LAMP_AR Indicates if Ar lamp is used.
LAMP_FE Indicates if Fe lamp is used.
LAMP_CU Indicates if Cu lamp is used.
WAVMODE Slit and mode configuration.
========== =============================================================

Multiple spectra output
^^^^^^^^^^^^^^^^^^^^^^^^

When taking multiple ``ARC`` images during your observation run, they will be linked
with your science data. This means that if you capture several lamp files,
they will be processed alongside the science images, potentially resulting
in multiple outputs of the same spectrum.
10 changes: 3 additions & 7 deletions docs/_file_prefixes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,15 @@ So what does all those letter mean? Here is a table to explain it.

So, for an original file named ``file.fits``:

``o_file.fits``

Means the file have been overscan corrected while

``eczsto_file.fits``
``eczst_file.fits``

Means the spectrum has been extracted to a 1D file but the file has not been
flat fielded (``f`` missing).

Ideally after running ``redccd`` the file should be named:

``cfzsto_file.fits``
``cfzst_file.fits``

And after running ``redspec``:

``wecfzsto_file.fits``
``wecfzst_file.fits``
31 changes: 30 additions & 1 deletion docs/_file_suffixes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,33 @@ There are two scenarios where this can happen:
================ ========= ========================================


Assuming the two targets in `sci_file.fits` are extracted we'll end up with
Assuming the two targets in `sci_file.fits` are extracted and they are approximately at the position
400 and 600 (pixels in spatial axis), after extraction we'll end up with:

.. code-block:: bash
esci_file_target_1.fits
esci_file_target_2.fits
elamp_001_390-410.fits
elamp_001_590-610.fits
elamp_002_390-410.fits
elamp_002_590-610.fits
The default prefix for extraction is ``e`` and does not have an underscore to separate it from the
file name.

After wavelength calibration, since there are two suitable lamps and due to the fact that the
pipeline does not combine solutions, it will save two wavelength calibrated files with each one
solved by the respective lamp. Then:

.. code-block:: bash
wesci_file_target_1_ws_1.fits
wesci_file_target_1_ws_2.fits
wesci_file_target_2_ws_1.fits
wesci_file_target_2_ws_2.fits
welamp_001_390-410.fits
welamp_001_590-610.fits
welamp_002_390-410.fits
welamp_002_590-610.fits
4 changes: 2 additions & 2 deletions docs/_install_dcr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ of LACosmic.
The latest version of the Goodman Spectroscopic Pipeline uses a modified version
of ``dcr`` to help with the pipeline's workflow. It is included under

``<path_to_download_location>/goodman_pipeline/goodman_pipeline/data/dcr-source/dcr/``
``<path_to_download_location>/goodman_pipeline/goodman_pipeline/data/dcr_source/dcr/``

``goodman_pipeline-<version>`` is the folder that will be created once you untar or unzip the latest
release of the |pipeline name|.
Expand All @@ -38,7 +38,7 @@ Compiling DCR

Compiling ``dcr`` is actually very simple.

``cd <path_to_download_location>/goodman_pipeline/goodman_pipeline/data/dcr-source/dcr/``
``cd <path_to_download_location>/goodman_pipeline/goodman_pipeline/data/dcr_source/dcr/``

Then simply type:

Expand Down
4 changes: 4 additions & 0 deletions docs/_running_prepare_data_for_reduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ need to change the following keywords.
``SYZY_400`` becomes ``400_SYZY``.
- ``WAVMODE``: Replace whitespace with underscore and all letters are capitalized.
For instance. ``400 m1`` becomes ``400_M1``.
- ``INSTRUME``: Instead of using the classical keywords 'Goodman Spectro' and
'Goodman Imaging', the AEON standard keywords ``ghts_red`` and ``ghts_blue``
will be used for spectroscopy, and ``ghts_red_imager`` and ``ghts_blue_imager``
for imaging. This is an exception of the upper case rule.

.. note::

Expand Down
9 changes: 5 additions & 4 deletions docs/_running_redspec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ behavior for every user or science case, we have implemented a set of
is *current working directory*.
- ``--proc-path <path>`` Folder were processed data will be stored. Default
is *current working directory*.
- ``--search-pattern <pattern>`` Prefix for picking up files. Default
``cfzst``. See :ref:`file-prefixes`.
- ``--output-prefix <prefix>`` Prefix to be added to calibrated spectrum.
- ``--search-pattern <pattern>`` Prefix for picking up files. Default is
``cfzst-``. See :ref:`file-prefixes`.
- ``--output-prefix <prefix>`` Prefix to be added to calibrated spectrum. Default is
``w-``. See :ref:`file-prefixes`.
- ``--extraction <method>`` Select the :ref:`extraction-methods`. The only one
implemented at the moment is ``fractional`` .
- ``--fit-targets-with {moffat, gaussian}`` Model to fit peaks on spatial profile
while searching for spectroscopic targets.
while searching for spectroscopic targets. Default ``moffat``.
- ``--target-min-width <target min width>`` Minimum profile width for fitting the spatial axis of spectroscopic targets.
If fitting a Moffat it will be reflected as the FWHM attribute of the fitted model and if fitting a Gaussian it will
be reflected as the STDDEV attribute of the Gaussian model.
Expand Down
26 changes: 25 additions & 1 deletion docs/change_history.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
Change History
##############


.. _v1.3.8:

V1.3.8 Not Released
^^^^^^^^^^^^^^^^^^^

- Documentation update
- Fix DCR bug that was present when called from CLI.
- Fixed Bug when using relative path for selecting master flat


.. _v1.3.7:

V1.3.7 17-08-2023
^^^^^^^^^^^^^^^^^

- Updated documentation theme to allow dark mode
- Removed python 3.6 and 3.8 from testing and added 3.9 and 3.10
- Unfixed numpy version
- Removed testing with conda on github action because it only added complexity
- Added 3 seconds timeout to request to github to validate version and check if running version is latest
- Added correct exception handler in case the http request timed out.


.. _v1.3.6:

V1.3.6 25-03-2022
Expand Down Expand Up @@ -336,4 +360,4 @@ V1.0.1 xx-xx-2018
V1.0.0 29-04-2018
^^^^^^^^^^^^^^^^^

- First production ready release
- First production ready release
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'sphinxcontrib.napoleon']
'sphinx.ext.napoleon']


intersphinx_mapping = {
Expand Down Expand Up @@ -81,7 +81,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -109,7 +109,7 @@
#
# html_theme = 'bootstrap-astropy'

html_theme = 'sphinx_rtd_theme'
html_theme = 'pydata_sphinx_theme'

html_logo = '_static/soar_logo.png'

Expand Down
6 changes: 1 addition & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Welcome to the Goodman HTS Pipeline Documentation
=================================================

.. image:: https://github.com/soar-telescope/goodman_pipeline/workflows/Goodman%20Pipeline/badge.svg?branch=master
.. image:: https://github.com/soar-telescope/goodman_pipeline/actions/workflows/python-package.yml/badge.svg
:alt: Goodman Pipeline
.. image:: https://codecov.io/gh/soar-telescope/goodman_pipeline/branch/main/graph/badge.svg
:target: https://codecov.io/gh/soar-telescope/goodman_pipeline
Expand All @@ -25,10 +25,6 @@ Welcome to the Goodman HTS Pipeline Documentation
:target: http://www.astropy.org/


.. image:: https://img.shields.io/lgtm/alerts/g/soar-telescope/goodman_pipeline.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/soar-telescope/goodman_pipeline/alerts/
.. image:: https://img.shields.io/lgtm/grade/python/g/soar-telescope/goodman_pipeline.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/soar-telescope/goodman_pipeline/context:python

This is the User Manual for the *Goodman Spectroscopic Data Reduction
Pipeline*. It provides an overview of the pipeline's main features,
Expand Down
3 changes: 2 additions & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ Getting Help.

.. include:: _extraction_methods.rst


.. include:: _file_prefixes.rst

.. include:: _file_suffixes.rst

.. include:: _shortcuts.rst

.. include:: _common_issues.rst
Loading

0 comments on commit ee7b4a5

Please sign in to comment.