From fc56467cfb252ae986186007f9d083b4db1ac334 Mon Sep 17 00:00:00 2001 From: Simon Torres Date: Thu, 5 Oct 2023 16:37:05 -0300 Subject: [PATCH 1/6] renamed paths with dash to use a underscore --- .gitignore | 4 ++-- .../data/{dcr-source => dcr_source}/README.md | 0 .../data/{dcr-source => dcr_source}/dcr/dcr.c | 0 .../data/{dcr-source => dcr_source}/dcr/dcr.h | 0 .../data/{dcr-source => dcr_source}/dcr/dcr.par | 0 .../data/{dcr-source => dcr_source}/dcr/makefile | 0 .../data/{dcr-source => dcr_source}/dcr/pfitshead.c | 0 .../data/{dcr-source => dcr_source}/dcr/pfitshead.h | 0 .../data/{dcr-source => dcr_source}/dcr/pfitsin.c | 0 .../data/{dcr-source => dcr_source}/dcr/pfitsin.h | 0 .../data/{dcr-source => dcr_source}/dcr/pfitsio.c | 0 .../data/{dcr-source => dcr_source}/dcr/pfitsio.h | 0 .../data/{dcr-source => dcr_source}/dcr/swap.c | 0 .../data/{dcr-source => dcr_source}/dcr/swap.h | 0 install_dcr.sh | 2 +- setup.cfg | 12 ++++++------ setup.py | 4 ++-- 17 files changed, 11 insertions(+), 11 deletions(-) rename goodman_pipeline/data/{dcr-source => dcr_source}/README.md (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/dcr.c (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/dcr.h (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/dcr.par (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/makefile (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/pfitshead.c (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/pfitshead.h (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/pfitsin.c (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/pfitsin.h (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/pfitsio.c (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/pfitsio.h (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/swap.c (100%) rename goodman_pipeline/data/{dcr-source => dcr_source}/dcr/swap.h (100%) diff --git a/.gitignore b/.gitignore index 3bc9f118..c1e95b49 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ __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/* diff --git a/goodman_pipeline/data/dcr-source/README.md b/goodman_pipeline/data/dcr_source/README.md similarity index 100% rename from goodman_pipeline/data/dcr-source/README.md rename to goodman_pipeline/data/dcr_source/README.md diff --git a/goodman_pipeline/data/dcr-source/dcr/dcr.c b/goodman_pipeline/data/dcr_source/dcr/dcr.c similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/dcr.c rename to goodman_pipeline/data/dcr_source/dcr/dcr.c diff --git a/goodman_pipeline/data/dcr-source/dcr/dcr.h b/goodman_pipeline/data/dcr_source/dcr/dcr.h similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/dcr.h rename to goodman_pipeline/data/dcr_source/dcr/dcr.h diff --git a/goodman_pipeline/data/dcr-source/dcr/dcr.par b/goodman_pipeline/data/dcr_source/dcr/dcr.par similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/dcr.par rename to goodman_pipeline/data/dcr_source/dcr/dcr.par diff --git a/goodman_pipeline/data/dcr-source/dcr/makefile b/goodman_pipeline/data/dcr_source/dcr/makefile similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/makefile rename to goodman_pipeline/data/dcr_source/dcr/makefile diff --git a/goodman_pipeline/data/dcr-source/dcr/pfitshead.c b/goodman_pipeline/data/dcr_source/dcr/pfitshead.c similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/pfitshead.c rename to goodman_pipeline/data/dcr_source/dcr/pfitshead.c diff --git a/goodman_pipeline/data/dcr-source/dcr/pfitshead.h b/goodman_pipeline/data/dcr_source/dcr/pfitshead.h similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/pfitshead.h rename to goodman_pipeline/data/dcr_source/dcr/pfitshead.h diff --git a/goodman_pipeline/data/dcr-source/dcr/pfitsin.c b/goodman_pipeline/data/dcr_source/dcr/pfitsin.c similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/pfitsin.c rename to goodman_pipeline/data/dcr_source/dcr/pfitsin.c diff --git a/goodman_pipeline/data/dcr-source/dcr/pfitsin.h b/goodman_pipeline/data/dcr_source/dcr/pfitsin.h similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/pfitsin.h rename to goodman_pipeline/data/dcr_source/dcr/pfitsin.h diff --git a/goodman_pipeline/data/dcr-source/dcr/pfitsio.c b/goodman_pipeline/data/dcr_source/dcr/pfitsio.c similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/pfitsio.c rename to goodman_pipeline/data/dcr_source/dcr/pfitsio.c diff --git a/goodman_pipeline/data/dcr-source/dcr/pfitsio.h b/goodman_pipeline/data/dcr_source/dcr/pfitsio.h similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/pfitsio.h rename to goodman_pipeline/data/dcr_source/dcr/pfitsio.h diff --git a/goodman_pipeline/data/dcr-source/dcr/swap.c b/goodman_pipeline/data/dcr_source/dcr/swap.c similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/swap.c rename to goodman_pipeline/data/dcr_source/dcr/swap.c diff --git a/goodman_pipeline/data/dcr-source/dcr/swap.h b/goodman_pipeline/data/dcr_source/dcr/swap.h similarity index 100% rename from goodman_pipeline/data/dcr-source/dcr/swap.h rename to goodman_pipeline/data/dcr_source/dcr/swap.h diff --git a/install_dcr.sh b/install_dcr.sh index 1b0b2ae5..66ec0c2f 100755 --- a/install_dcr.sh +++ b/install_dcr.sh @@ -1,6 +1,6 @@ #!/bin/bash -SOURCE_DIR=$(pwd)/goodman_pipeline/data/dcr-source/dcr +SOURCE_DIR=$(pwd)/goodman_pipeline/data/dcr_source/dcr diff --git a/setup.cfg b/setup.cfg index ad69c0f6..ddfd28de 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,16 +1,16 @@ [build_docs] -source-dir = docs -build-dir = docs/_build +source_dir = docs +build_dir = docs/_build all_files = 1 [build_sphinx] project = 'Goodman Pipeline' -source-dir = docs -build-dir = docs/_build +source_dir = docs +build_dir = docs/_build [upload_docs] -upload-dir = docs/_build/html -show-response = 1 +upload_dir = docs/_build/html +show_response = 1 [metadata] package_name = goodman_pipeline diff --git a/setup.py b/setup.py index c49fa10f..caa5c8ed 100644 --- a/setup.py +++ b/setup.py @@ -145,8 +145,8 @@ def create_version_py(packagename, version, source_dir='.'): package_data={'goodman_pipeline': ['data/params/dcr.par', 'data/params/*.json_output', 'data/ref_comp/*fits', - 'data/dcr-source/README.md', - 'data/dcr-source/dcr/*', + 'data/dcr_source/README.md', + 'data/dcr_source/dcr/*', 'data/test_data/master_flat/*', 'data/test_data/wcs_data/*']}, From 5ba8f7bd7c77defb6c7e4bf9f3f722c8b80263c9 Mon Sep 17 00:00:00 2001 From: Simon Torres Date: Thu, 5 Oct 2023 17:24:06 -0300 Subject: [PATCH 2/6] moved astropy to pip section because of outdated version on conda, updated install_dcr.sh script --- environment.yml | 16 ++++++++-------- goodman_pipeline/version.py | 2 +- install_dcr.sh | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/environment.yml b/environment.yml index bed43dbe..091a4347 100644 --- a/environment.yml +++ b/environment.yml @@ -6,13 +6,13 @@ dependencies: - matplotlib - scipy - cython - - astropy - pip - pip: - - ccdproc - - coveralls - - pydata-sphinx-theme - - astroplan - - mock - - sphinx - - sphinxcontrib.napoleon + - astropy>=5.3 + - ccdproc + - coveralls + - pydata-sphinx-theme + - astroplan + - mock + - sphinx + - sphinxcontrib.napoleon diff --git a/goodman_pipeline/version.py b/goodman_pipeline/version.py index cb14e6bd..c3bb1098 100644 --- a/goodman_pipeline/version.py +++ b/goodman_pipeline/version.py @@ -1,2 +1,2 @@ # This is an automatic generated file please do not edit -__version__ = '1.3.6' \ No newline at end of file +__version__ = '1.3.7' \ No newline at end of file diff --git a/install_dcr.sh b/install_dcr.sh index 66ec0c2f..ffc29144 100755 --- a/install_dcr.sh +++ b/install_dcr.sh @@ -10,8 +10,8 @@ then echo 'You do not have any virtual environment activated' else - ENV_NAME=$(conda info | grep 'active environment' | sed 's/\//g' | sed "s/[: ]//g") - ENV_PATH=$(conda info | grep 'active env location' | sed 's/\//g' | sed "s/[: ]//g") + ENV_NAME=$(conda info | grep 'active environment' | sed 's/active environment//g' | sed "s/[: ]//g") + ENV_PATH=$(conda info | grep 'active env location' | sed 's/active env location//g' | sed "s/[: ]//g") echo "Using Virtual Environment: " $ENV_NAME echo "Environment path information: " $ENV_PATH if [ -d $SOURCE_DIR ] From 979842a519ffd58cc0ff7f7d06a09072454c990e Mon Sep 17 00:00:00 2001 From: Simon Torres Date: Thu, 5 Oct 2023 17:38:41 -0300 Subject: [PATCH 3/6] updated dcr_source path --- .github/workflows/python-package.yml | 4 ++-- docs/_install_dcr.rst | 4 ++-- travis_install_dcr.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 44d48d9c..d9706767 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 diff --git a/docs/_install_dcr.rst b/docs/_install_dcr.rst index c29d1e80..0648e0d0 100644 --- a/docs/_install_dcr.rst +++ b/docs/_install_dcr.rst @@ -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 - ``/goodman_pipeline/goodman_pipeline/data/dcr-source/dcr/`` + ``/goodman_pipeline/goodman_pipeline/data/dcr_source/dcr/`` ``goodman_pipeline-`` is the folder that will be created once you untar or unzip the latest release of the |pipeline name|. @@ -38,7 +38,7 @@ Compiling DCR Compiling ``dcr`` is actually very simple. - ``cd /goodman_pipeline/goodman_pipeline/data/dcr-source/dcr/`` + ``cd /goodman_pipeline/goodman_pipeline/data/dcr_source/dcr/`` Then simply type: diff --git a/travis_install_dcr.sh b/travis_install_dcr.sh index f1909505..4bb9f90b 100755 --- a/travis_install_dcr.sh +++ b/travis_install_dcr.sh @@ -1,6 +1,6 @@ #!/bin/bash -SOURCE_DIR=$(pwd)/goodman_pipeline/data/dcr-source/dcr +SOURCE_DIR=$(pwd)/goodman_pipeline/data/dcr_source/dcr BINARY_FOLDER=$VIRTUAL_ENV/bin From f1a92158cc427bf39912621c30733f0886102f13 Mon Sep 17 00:00:00 2001 From: Simon Torres Date: Fri, 6 Oct 2023 10:39:48 -0300 Subject: [PATCH 4/6] updated action version --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d9706767..698cb50c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -18,9 +18,9 @@ jobs: 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 From 785903d1382018f194a4f49a47262bba961344c8 Mon Sep 17 00:00:00 2001 From: Simon Torres Date: Fri, 6 Oct 2023 10:44:29 -0300 Subject: [PATCH 5/6] updated action version for codecov --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 698cb50c..9c8d6090 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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) From 1dc85cb380808004b26c0365a3d2fed2e335b351 Mon Sep 17 00:00:00 2001 From: Simon Torres Date: Fri, 6 Oct 2023 11:26:08 -0300 Subject: [PATCH 6/6] updated documentation --- docs/_file_suffixes.rst | 31 ++++++++++++++++++++++++++++++- docs/conf.py | 4 ++-- goodman_pipeline/core/core.py | 2 +- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/_file_suffixes.rst b/docs/_file_suffixes.rst index f06421b4..f3fac557 100644 --- a/docs/_file_suffixes.rst +++ b/docs/_file_suffixes.rst @@ -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 \ No newline at end of file +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 diff --git a/docs/conf.py b/docs/conf.py index a53eb39a..0bbc8496 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -39,7 +39,7 @@ 'sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx', - 'sphinxcontrib.napoleon'] + 'sphinx.ext.napoleon'] intersphinx_mapping = { @@ -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. diff --git a/goodman_pipeline/core/core.py b/goodman_pipeline/core/core.py index 61c8ae35..d6caf652 100644 --- a/goodman_pipeline/core/core.py +++ b/goodman_pipeline/core/core.py @@ -1149,7 +1149,7 @@ def extraction(ccd, def extract_fractional_pixel(ccd, target_trace, target_fwhm, extraction_width, background_spacing=3): - """Performs an spectrum extraction using fractional pixels. + """Performs a spectrum extraction using fractional pixels. Args: ccd (CCDData) Instance of :class:`~astropy.nddata.CCDData` that