diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 530acb47ad..f57c373739 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ['3.10', '3.11', '3.12'] + python: ['3.11', '3.12'] toxenv: [test-alldeps, test-numpydev, test-linetoolsdev, test-gingadev, test-astropydev] steps: - name: Check out repository diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 9c2f37ec7d..0a9d9a0a1b 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -17,8 +17,8 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ['3.10', '3.11', '3.12'] - toxenv: [test, test-alldeps-cov, test-linetoolsdev, test-gingadev, test-astropydev] + python: ['3.11', '3.12'] + toxenv: [test, test-alldeps-cov, test-numpydev, test-linetoolsdev, test-gingadev, test-astropydev] steps: - name: Check out repository uses: actions/checkout@v3 @@ -48,7 +48,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, macos-latest] - python: ['3.10', '3.11', '3.12'] + python: ['3.11', '3.12'] toxenv: [test-alldeps] steps: - name: Check out repository @@ -71,7 +71,7 @@ jobs: - name: Conda environment check uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' - name: Install base dependencies run: | python -m pip install --upgrade pip tox @@ -86,7 +86,7 @@ jobs: - name: Python codestyle check uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' - name: Install base dependencies run: | python -m pip install --upgrade pip diff --git a/doc/api/pypeit.scripts.chk_flexure.rst b/doc/api/pypeit.scripts.chk_flexure.rst new file mode 100644 index 0000000000..90d71dfdb8 --- /dev/null +++ b/doc/api/pypeit.scripts.chk_flexure.rst @@ -0,0 +1,8 @@ +pypeit.scripts.chk\_flexure module +================================== + +.. automodule:: pypeit.scripts.chk_flexure + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/pypeit.scripts.rst b/doc/api/pypeit.scripts.rst index 9709614544..e9d732cc80 100644 --- a/doc/api/pypeit.scripts.rst +++ b/doc/api/pypeit.scripts.rst @@ -12,6 +12,7 @@ Submodules pypeit.scripts.chk_alignments pypeit.scripts.chk_edges pypeit.scripts.chk_flats + pypeit.scripts.chk_flexure pypeit.scripts.chk_for_calibs pypeit.scripts.chk_noise_1dspec pypeit.scripts.chk_noise_2dspec @@ -51,6 +52,7 @@ Submodules pypeit.scripts.show_1dspec pypeit.scripts.show_2dspec pypeit.scripts.show_arxiv + pypeit.scripts.show_pixflat pypeit.scripts.show_wvcalib pypeit.scripts.skysub_regions pypeit.scripts.tellfit diff --git a/doc/api/pypeit.scripts.show_pixflat.rst b/doc/api/pypeit.scripts.show_pixflat.rst new file mode 100644 index 0000000000..b66038acae --- /dev/null +++ b/doc/api/pypeit.scripts.show_pixflat.rst @@ -0,0 +1,8 @@ +pypeit.scripts.show\_pixflat module +=================================== + +.. automodule:: pypeit.scripts.show_pixflat + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/dev/hiresconfig.rst b/doc/dev/hiresconfig.rst index 52ad731b4b..38d07f705c 100644 --- a/doc/dev/hiresconfig.rst +++ b/doc/dev/hiresconfig.rst @@ -28,7 +28,7 @@ by the :ref:`pypeit_setup` script, which sorts the frames and writes a HIRES configuration identification ---------------------------------- +---------------------------------- The HIRES instrument configurations are determined by the function :func:`pypeit.metadata.PypeItMetaData.unique_configurations`, @@ -62,7 +62,7 @@ to the relevant unique configuration ("setup"), by assigning a setup identifier values of the specific unique configuration. HIRES calibration groups ------------------------ +------------------------ PypeIt uses the concept of a "calibration group" to define a complete set of calibration frames (e.g., arcs, flats) and the science frames to which these calibration diff --git a/doc/dev/hiresframes.rst b/doc/dev/hiresframes.rst index 0d0dad6f41..d303081a9a 100644 --- a/doc/dev/hiresframes.rst +++ b/doc/dev/hiresframes.rst @@ -24,7 +24,7 @@ The general procedure used to assign frames a given type is described here: :ref:`frame_types`. HIRES frame typing ------------------ +------------------ The primary typing of HIRES frames is performed by :func:`pypeit.spectrographs.keck_hires.KECKHIRESSpectrograph.check_frame_type`. diff --git a/doc/help/pypeit_cache_github_data.rst b/doc/help/pypeit_cache_github_data.rst index 0c3b6990b5..3ab386e7fd 100644 --- a/doc/help/pypeit_cache_github_data.rst +++ b/doc/help/pypeit_cache_github_data.rst @@ -36,14 +36,15 @@ --exclude EXCLUDE [EXCLUDE ...] A subset of the directories to *exclude* from the list of files to download. Options are: tests, reid_arxiv, - nist, standards, skisim, sensfunc. This option is - mutually exclusive with --include. (default: ['tests']) + nist, standards, skisim, sensfunc, pixelflat. This + option is mutually exclusive with --include. (default: + ['tests']) --include INCLUDE [INCLUDE ...] The directories to *include* in the list of files to download. Use "--include all" to include all directories. Options are: all, tests, reid_arxiv, nist, - standards, skisim, sensfunc. This option is mutually - exclusive with --exclude. (default: None) + standards, skisim, sensfunc, pixelflat. This option is + mutually exclusive with --exclude. (default: None) --spec_dependent_only Only include files that are specific to the provided list of spectrographs. By default, the script also diff --git a/doc/help/pypeit_chk_flexure.rst b/doc/help/pypeit_chk_flexure.rst new file mode 100644 index 0000000000..d7110d32d4 --- /dev/null +++ b/doc/help/pypeit_chk_flexure.rst @@ -0,0 +1,18 @@ +.. code-block:: console + + $ pypeit_chk_flexure -h + usage: pypeit_chk_flexure [-h] (--spec | --spat) [--try_old] + input_file [input_file ...] + + Print QA on flexure to the screen + + positional arguments: + input_file One or more PypeIt spec2d or spec1d file + + options: + -h, --help show this help message and exit + --spec Check the spectral flexure (default: False) + --spat Check the spatial flexure (default: False) + --try_old Attempt to load old datamodel versions. A crash may ensue.. + (default: False) + \ No newline at end of file diff --git a/doc/help/pypeit_show_pixflat.rst b/doc/help/pypeit_show_pixflat.rst new file mode 100644 index 0000000000..d7394e32e3 --- /dev/null +++ b/doc/help/pypeit_show_pixflat.rst @@ -0,0 +1,17 @@ +.. code-block:: console + + $ pypeit_show_pixflat -h + usage: pypeit_show_pixflat [-h] [--det DET [DET ...]] file + + Show an archived Pixel Flat image in a ginga window. + + positional arguments: + file Pixel Flat filename, e.g. + pixelflat_keck_lris_blue.fits.gz + + options: + -h, --help show this help message and exit + --det DET [DET ...] Detector(s) to show. If more than one, list the detectors + as, e.g. --det 1 2 to show detectors 1 and 2. If not + provided, all detectors will be shown. (default: None) + \ No newline at end of file diff --git a/doc/help/run_pypeit.rst b/doc/help/run_pypeit.rst index 62402415ec..77d8e84bbc 100644 --- a/doc/help/run_pypeit.rst +++ b/doc/help/run_pypeit.rst @@ -4,7 +4,7 @@ usage: run_pypeit [-h] [-v VERBOSITY] [-r REDUX_PATH] [-m] [-s] [-o] [-c] pypeit_file - ## PypeIt : The Python Spectroscopic Data Reduction Pipeline v1.16.1.dev109+g885cb1823 + ## PypeIt : The Python Spectroscopic Data Reduction Pipeline v1.16.1.dev468+g832ee84e4 ## ## Available spectrographs include: ## aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, diff --git a/doc/include/class_datamodel_mosaic.rst b/doc/include/class_datamodel_mosaic.rst index ddc075089c..80c523ddef 100644 --- a/doc/include/class_datamodel_mosaic.rst +++ b/doc/include/class_datamodel_mosaic.rst @@ -1,5 +1,5 @@ -**Version**: 1.0.0 +**Version**: 1.0.1 ============== ================ ============================================================ =================================================================================== Attribute Type Array Type Description @@ -7,7 +7,7 @@ Attribute Type Array Type ``binning`` str On-chip binning ``detectors`` `numpy.ndarray`_ :class:`~pypeit.images.detector_container.DetectorContainer` List of objects with detector parameters. ``id`` int Mosaic ID number -``msc_order`` int Order of the interpolation used to construct the mosaic. +``msc_ord`` int Order of the interpolation used to construct the mosaic. ``platescale`` float Detector platescale in arcsec/pixel ``rot`` `numpy.ndarray`_ float Raw, hard-coded rotations (counter-clockwise in degrees) for each unbinned detector ``shape`` tuple Shape of each processed detector image diff --git a/doc/include/data_dir.rst b/doc/include/data_dir.rst index adda09f16a..1c8e42c4d8 100644 --- a/doc/include/data_dir.rst +++ b/doc/include/data_dir.rst @@ -7,6 +7,7 @@ extinction extinction ... filters filters ... linelist arc_lines/lists ... nist arc_lines/NIST github +pixelflat pixelflats github reid_arxiv arc_lines/reid_arxiv github sensfunc sensfuncs github skisim skisim github diff --git a/doc/include/dependencies_table.rst b/doc/include/dependencies_table.rst index bfa5485e86..5156b259ec 100644 --- a/doc/include/dependencies_table.rst +++ b/doc/include/dependencies_table.rst @@ -1,5 +1,5 @@ -======================= ======================================================================================================================================================================================================================================================================================================================================================================= -Python Version ``>=3.10,<3.13`` -Required for users ``IPython>=7.10.0``, ``PyERFA>=2.0.0``, ``PyYAML>=5.1``, ``astropy>=6.0``, ``bottleneck``, ``configobj>=5.0.6``, ``extension-helpers>=0.1``, ``fast-histogram>=0.11``, ``ginga>=5.1.0``, ``linetools>=0.3.1``, ``matplotlib>=3.7``, ``numpy>=1.23,<2.0.0``, ``packaging>=0.19``, ``pygithub``, ``pyqt6<=6.7.0``, ``qtpy>=2.0.1``, ``scikit-learn>=1.0``, ``scipy>=1.7`` -Required for developers ``coverage``, ``docutils<0.21``, ``psutil``, ``pygit2``, ``pytest-astropy``, ``pytest-cov``, ``pytest-qt``, ``pytest>=6.0.0``, ``scikit-image``, ``specutils>=1.13``, ``sphinx-automodapi``, ``sphinx>=1.6,<8``, ``sphinx_rtd_theme==2.0.0``, ``tox`` -======================= ======================================================================================================================================================================================================================================================================================================================================================================= +======================= ======================================================================================================================================================================================================================================================================================================================================================== +Python Version ``>=3.11,<3.13`` +Required for users ``IPython>=8.0.0``, ``PyERFA>=2.0.0``, ``PyYAML>=6.0``, ``astropy>=6.0``, ``bottleneck``, ``configobj>=5.0.6``, ``extension-helpers>=1.0``, ``fast-histogram>=0.11``, ``ginga>=5.1.0``, ``linetools>=0.3.2``, ``matplotlib>=3.7``, ``numpy>=1.24``, ``packaging>=22.0``, ``pygithub``, ``pyqt6``, ``qtpy>=2.2.0``, ``scikit-learn>=1.2``, ``scipy>=1.9`` +Required for developers ``coverage``, ``docutils<0.21``, ``psutil``, ``pygit2``, ``pytest-astropy``, ``pytest-cov``, ``pytest-qt``, ``pytest>=7.0.0``, ``scikit-image>=0.23``, ``specutils>=1.13``, ``sphinx-automodapi``, ``sphinx>=1.6,<8``, ``sphinx_rtd_theme==2.0.0``, ``tox`` +======================= ======================================================================================================================================================================================================================================================================================================================================================== diff --git a/doc/include/inst_detector_table.rst b/doc/include/inst_detector_table.rst index d30393c4f2..41c4c8b132 100644 --- a/doc/include/inst_detector_table.rst +++ b/doc/include/inst_detector_table.rst @@ -86,9 +86,9 @@ Instrument Det specaxis specflip spatflip namp gain ``vlt_fors2`` 1 1 False False 1 0.7 2.9 2.1 -1.0e+10 200000.0 0.8000 0.1260 ... 2 1 False False 1 0.7 3.15 1.4 -1.0e+10 200000.0 0.8000 0.1260 ``vlt_sinfoni`` 1 0 True False 1 2.42 7.0 540.0 -1.0e+10 1000000000.0 1.0000 0.0125 -``vlt_xshooter_nir`` 1 1 False False 1 2.12 8.0 0.0 -1.0e+10 200000.0 0.8600 0.1970 -``vlt_xshooter_uvb`` 1 0 True True 1 1.61 2.6 0.0 -1.0e+10 65000.0 0.8600 0.1610 -``vlt_xshooter_vis`` 1 0 False False 1 0.595 3.1 0.0 -1.0e+10 65535.0 0.8600 0.1600 +``vlt_xshooter_nir`` 1 1 False False 1 2.29 8.0 72.0 -1.0e+10 200000.0 0.8600 0.2450 +``vlt_xshooter_uvb`` 1 0 True True 1 ``None`` ``None`` 0.0 -1.0e+10 65000.0 0.8600 0.1640 +``vlt_xshooter_vis`` 1 0 False False 1 ``None`` ``None`` 0.0 -1.0e+10 65535.0 0.8600 0.1540 ``wht_isis_blue`` 1 0 False False 1 1.2 5.0 0.0 -1.0e+10 65535.0 0.7600 0.2000 ``wht_isis_red`` 1 0 False False 1 0.98 4.0 0.0 -1.0e+10 65535.0 0.7600 0.2200 ============================ === ======== ======== ======== ======== ========================== ====================== ======== ======== ============ ========= ========== diff --git a/doc/include/links.rst b/doc/include/links.rst index e4e1f1b84f..f1c47e7444 100644 --- a/doc/include/links.rst +++ b/doc/include/links.rst @@ -128,7 +128,7 @@ .. _pip: https://pip.pypa.io/en/stable/ .. _anaconda: https://www.anaconda.com/products/individual .. _conda: https://docs.conda.io/projects/conda/en/latest/index.html -.. _virtualenv: https://virtualenv.pypa.io/en/latest/ +.. _venv: https://docs.python.org/3/library/venv.html .. _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/ diff --git a/doc/include/spectrographs_table.rst b/doc/include/spectrographs_table.rst index 485e3c269c..99bef11a21 100644 --- a/doc/include/spectrographs_table.rst +++ b/doc/include/spectrographs_table.rst @@ -18,7 +18,7 @@ jwst_nircam :class:`~pypeit.spectrographs.jwst_nircam.JWSTNIRCamSp jwst_nirspec :class:`~pypeit.spectrographs.jwst_nirspec.JWSTNIRSpecSpectrograph` JWST NIRSPEC `Link `__ MultiSlit True False keck_deimos :class:`~pypeit.spectrographs.keck_deimos.KeckDEIMOSSpectrograph` KECK DEIMOS `Link `__ MultiSlit True True Supported gratings: 600ZD, 830G, 900ZD, 1200B, 1200G; see :doc:`deimos` keck_esi :class:`~pypeit.spectrographs.keck_esi.KeckESISpectrograph` KECK ESI Echelle True False -keck_hires :class:`~pypeit.spectrographs.keck_hires.KECKHIRESSpectrograph` KECK HIRES `Link `__ Echelle False False +keck_hires :class:`~pypeit.spectrographs.keck_hires.KECKHIRESSpectrograph` KECK HIRES `Link `__ Echelle False False Post detector upgrade (~ August 2004). See :doc:`keck_hires` keck_kcrm :class:`~pypeit.spectrographs.keck_kcwi.KeckKCRMSpectrograph` KECK KCRM `Link `__ SlicerIFU True False Supported setups: RL, RM1, RM2, RH3; see :doc:`keck_kcwi` keck_kcwi :class:`~pypeit.spectrographs.keck_kcwi.KeckKCWISpectrograph` KECK KCWI `Link `__ SlicerIFU True False Supported setups: BL, BM, BH2, BH3; see :doc:`keck_kcwi` keck_lris_blue :class:`~pypeit.spectrographs.keck_lris.KeckLRISBSpectrograph` KECK LRISb `Link `__ MultiSlit True False Blue camera; Current FITS file format; used from May 2009, see :doc:`lris` diff --git a/doc/installing.rst b/doc/installing.rst index 1772a7b8f7..bf190ca83e 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -36,7 +36,7 @@ Setup a clean python environment PypeIt is available from the `Python Package Index `_ (PyPI) and is installed via ``pip``. This process also installs and/or upgrades -PypeIt's :ref:`dependencies`, and for this reason, we highly (!!) recommend you +PypeIt's :ref:`dependencies`, and for this reason you should always first set up a clean python environment in which to install PypeIt. This mitigates any possible dependency conflicts with other packages you use. @@ -47,20 +47,18 @@ You can set up a new python environment using either `conda`_: conda create -n pypeit python=3.11 conda activate pypeit -or `virtualenv`_: +or `venv`_: .. code-block:: console - virtualenv pypeit + python -m venv pypeit source pypeit/bin/activate See the `Managing Environments with Conda -`_ -and/or `Virtualenv documentation `_ -for more details. See also `virtualenvwrapper -`_ as an option for more -easily managing `virtualenv`_ environments. The `conda`_ installation method described below -creates an environment for you. +`__ +and/or the `venv documentation `__ for +more details. The `conda`_ installation method described below creates an +environment for you. .. _installing-pip: @@ -222,29 +220,40 @@ for x86-64: Solutions/Recommendations/Feedback for these installation options are welcome; please `Submit an issue`_. +.. _install_windows: + User Installation on Windows --------------------------------------------- #. Download `Python for Windows `_. #. Run the installer. - - * Make sure "Add python.exe to Path" or "Add Python to environment variables" is selected before installing. - * If you have Admin privileges click "Disable path length limit" after the installation succeeds. + + * Make sure "Add python.exe to Path" or "Add Python to environment + variables" is selected before installing. -#. Downloand and run the `Visual Studio build tools `_ installer. + * If you have Admin privileges click "Disable path length limit" after the + installation succeeds. + +#. Download and run the `Visual Studio build tools + `_ installer. * Only "Desktop Development with C++" needs to be checked. + * Click install -#. Create a virtual environment as in `Setup a clean python environment `__ and install PypeIt as described above. +#. Create a virtual environment as in `Setup a clean python environment + `__ and install PypeIt as described above. -If running ``python`` on Windows brings up a window for the Microsoft Store you may want to change the application alias. -This is under ``Settings -> Apps -> App execution aliases`` on Windows 10 and ``Settings -> Apps -> Advanced app settings -> App execution aliases`` -on Windows 11. Disable the ``App Installer`` options for the ``python.exe`` and ``python3.exe`` executables. +If running ``python`` on Windows brings up a window for the Microsoft Store you +may want to change the application alias. This is under ``Settings -> Apps -> +App execution aliases`` on Windows 10 and ``Settings -> Apps -> Advanced app +settings -> App execution aliases`` on Windows 11. Disable the ``App Installer`` +options for the ``python.exe`` and ``python3.exe`` executables. -An alternative for running under Windows is to install the `Windows Subsystem for Linux (WSL) `_. -This in effect allows you to run PypeIt under Linux under Windows. +An alternative for running under Windows is to install the `Windows Subsystem +for Linux (WSL) `_. This +in effect allows you to run PypeIt under Linux under Windows. ---- @@ -751,4 +760,85 @@ In either case, over 100 tests should pass, nearly 100 will be skipped and none should fail. The skipped tests only run if the PypeIt development is installed and configured; see :ref:`dev-suite`. +---- + +.. _install_troubleshoot: + +Troubleshooting +=============== + +If you have trouble installing pypeit, you're encouraged to `join +`__ +our `PypeIt Users Slack `__ and post your issue +to the #installing channel. Here is an incomplete list of issues that users +have reported in the past. In addition to posting to the Users Slack if your +issue isn't among those listed below, *please let us know if these suggestions +do not work for you.* +**I am trying to install pypeit for the first time and it fails!**: The root +problem of this can be system dependent: + + - First, *always* make sure you install the code into a fresh environment. + + - If you're on Windows, make sure you follow the :ref:`install_windows` + instructions. If you're still having trouble, it may be because PypeIt + includes some C code to accelerate some computations. If the issue is + because the C compiler is not properly linking, you can try typing ``set + CC=help`` at the command prompt before running the ``pip install`` command. + + - Occasionally, the installation may fail because of incompatible dependencies. + This may be because of recent releases of one of PypeIt's dependencies; i.e., + updates to packages since the most recent PypeIt release. Please let us know + if this happens, and we will try to issue a new release asap that corrects + the incompatibility. In the short-term, we may ask you to install old + versions of packages that we know work. + +**I am trying to upgrade pypeit and it fails!**: First try uninstalling your +current pypeit version: + +.. code-block:: bash + + pip uninstall pypeit + +Then reinstall it. If that also fails, try creating a fresh environment and +reinstalling pypeit in that new environment. + +**The installation process succeeded, but the code is faulting!**: This could +be for a few reasons: + + - Recall that pypeit isn't necessarily backwards compatible. If you've + upgraded pypeit and tried to use it with data that was reduced by a previous + version, the fault may because of changes between versions. You will either + need to revert to your previous version or reprocess the data. + + - This may be because of dependency changes. A tell-tale signature of this is + if you get errors associate with missing or unknown keywords or arguments. + This is may be because of recent releases of one of PypeIt's dependencies; i.e., + updates to packages since the most recent PypeIt release. Please let us know + if this happens, and we will try to issue a new release asap that corrects + the incompatibility. In the short-term, we may ask you to install old + versions of packages that we know work. + +**The installation process succeeded and the code completes without faulting, +but the output looks wrong!**: This could happen for any number of reasons. +*We always welcome reports of failures!* Either `submit an issue +`__ or report it on the PypeIt Users +Slack. However, here are a few things to note and/or try: + + - Make sure you have checked your calibrations; see :ref:`calibrations`. The + issue may be related to a parameter that you can change. + + - If you don't see any ``spec1d`` files in your ``Science`` folder, this is + likely because the code didn't find any objects; see :ref:`object_finding`. + + - If you've recently upgraded the code, this may be related to changes in + dependencies that the developers didn't catch. PypeIt performs *a lot* of + testing before issuing a new release, but does not have complete test + coverage and performance validation. This means silent failures are the most + difficult to catch. + + - And, of course, the code will have bugs. If you find one, the more + information you provide the developers, the easier it will be for us to track + down the issue. Valuable information includes your OS, OS version, python + version, and pypeit version, as well as QA plots and ``ginga`` screen grabs + that illustrate the issue. diff --git a/doc/pypeit_par.rst b/doc/pypeit_par.rst index 2f87cf025a..ee49c46478 100644 --- a/doc/pypeit_par.rst +++ b/doc/pypeit_par.rst @@ -185,6 +185,9 @@ Current PypeItPar Parameter Hierarchy | ``[[lampoffflatsframe]]``: :ref:`framegrouppar` | ``[[[process]]]``: :ref:`processimagespar` | ``[[[[scattlight]]]]``: :ref:`scatteredlightpar` +| ``[[slitless_pixflatframe]]``: :ref:`framegrouppar` +| ``[[[process]]]``: :ref:`processimagespar` +| ``[[[[scattlight]]]]``: :ref:`scatteredlightpar` | ``[[scattlightframe]]``: :ref:`framegrouppar` | ``[[[process]]]``: :ref:`processimagespar` | ``[[[[scattlight]]]]``: :ref:`scatteredlightpar` @@ -252,32 +255,33 @@ CalibrationsPar Keywords Class Instantiation: :class:`~pypeit.par.pypeitpar.CalibrationsPar` -===================== ==================================================== ======= ================================= ================================================================================================================================================================================================================================================= -Key Type Options Default Description -===================== ==================================================== ======= ================================= ================================================================================================================================================================================================================================================= -``alignframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the align frames -``alignment`` :class:`~pypeit.par.pypeitpar.AlignPar` .. `AlignPar Keywords`_ Define the procedure for the alignment of traces -``arcframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the wavelength calibration -``biasframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the bias correction -``bpm_usebias`` bool .. False Make a bad pixel mask from bias frames? Bias frames must be provided. -``calib_dir`` str .. ``Calibrations`` The name of the directory for the processed calibration frames. The host path for the directory is set by the redux_path (see :class:`~pypeit.par.pypeitpar.ReduxPar`). Beware that success when changing the default value is not well tested! -``darkframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the dark-current correction -``flatfield`` :class:`~pypeit.par.pypeitpar.FlatFieldPar` .. `FlatFieldPar Keywords`_ Parameters used to set the flat-field procedure -``illumflatframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the illumination flat -``lampoffflatsframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the lamp off flats -``pinholeframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the pinholes -``pixelflatframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the pixel flat -``raise_chk_error`` bool .. True Raise an error if the calibration check fails -``scattlight_pad`` int .. 5 Number of unbinned pixels to extend the slit edges by when masking the slits. -``scattlightframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the scattered light frames -``skyframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the sky background observations -``slitedges`` :class:`~pypeit.par.pypeitpar.EdgeTracePar` .. `EdgeTracePar Keywords`_ Slit-edge tracing parameters -``standardframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the spectrophotometric standard observations -``tiltframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the wavelength tilts -``tilts`` :class:`~pypeit.par.pypeitpar.WaveTiltsPar` .. `WaveTiltsPar Keywords`_ Define how to trace the slit tilts using the trace frames -``traceframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for images used for slit tracing -``wavelengths`` :class:`~pypeit.par.pypeitpar.WavelengthSolutionPar` .. `WavelengthSolutionPar Keywords`_ Parameters used to derive the wavelength solution -===================== ==================================================== ======= ================================= ================================================================================================================================================================================================================================================= +========================= ==================================================== ======= ================================= ================================================================================================================================================================================================================================================= +Key Type Options Default Description +========================= ==================================================== ======= ================================= ================================================================================================================================================================================================================================================= +``alignframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the align frames +``alignment`` :class:`~pypeit.par.pypeitpar.AlignPar` .. `AlignPar Keywords`_ Define the procedure for the alignment of traces +``arcframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the wavelength calibration +``biasframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the bias correction +``bpm_usebias`` bool .. False Make a bad pixel mask from bias frames? Bias frames must be provided. +``calib_dir`` str .. ``Calibrations`` The name of the directory for the processed calibration frames. The host path for the directory is set by the redux_path (see :class:`~pypeit.par.pypeitpar.ReduxPar`). Beware that success when changing the default value is not well tested! +``darkframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the dark-current correction +``flatfield`` :class:`~pypeit.par.pypeitpar.FlatFieldPar` .. `FlatFieldPar Keywords`_ Parameters used to set the flat-field procedure +``illumflatframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the illumination flat +``lampoffflatsframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the lamp off flats +``pinholeframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the pinholes +``pixelflatframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the pixel flat +``raise_chk_error`` bool .. True Raise an error if the calibration check fails +``scattlight_pad`` int .. 5 Number of unbinned pixels to extend the slit edges by when masking the slits. +``scattlightframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the scattered light frames +``skyframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the sky background observations +``slitedges`` :class:`~pypeit.par.pypeitpar.EdgeTracePar` .. `EdgeTracePar Keywords`_ Slit-edge tracing parameters +``slitless_pixflatframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the slitless pixel flat +``standardframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the spectrophotometric standard observations +``tiltframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for the wavelength tilts +``tilts`` :class:`~pypeit.par.pypeitpar.WaveTiltsPar` .. `WaveTiltsPar Keywords`_ Define how to trace the slit tilts using the trace frames +``traceframe`` :class:`~pypeit.par.pypeitpar.FrameGroupPar` .. `FrameGroupPar Keywords`_ The frames and combination rules for images used for slit tracing +``wavelengths`` :class:`~pypeit.par.pypeitpar.WavelengthSolutionPar` .. `WavelengthSolutionPar Keywords`_ Parameters used to derive the wavelength solution +========================= ==================================================== ======= ================================= ================================================================================================================================================================================================================================================= ---- @@ -846,14 +850,14 @@ FrameGroupPar Keywords Class Instantiation: :class:`~pypeit.par.pypeitpar.FrameGroupPar` -============= =============================================== ============================================================================================================================================================================ ============================ =============================================================================================================================================================================================================================================================== -Key Type Options Default Description -============= =============================================== ============================================================================================================================================================================ ============================ =============================================================================================================================================================================================================================================================== -``exprng`` list .. None, None Used in identifying frames of this type. This sets the minimum and maximum allowed exposure times. There must be two items in the list. Use None to indicate no limit; i.e., to select exposures with any time greater than 30 sec, use exprng = [30, None]. -``frametype`` str ``align``, ``arc``, ``bias``, ``dark``, ``pinhole``, ``pixelflat``, ``illumflat``, ``lampoffflats``, ``scattlight``, ``science``, ``standard``, ``trace``, ``tilt``, ``sky`` ``science`` Frame type. Options are: align, arc, bias, dark, pinhole, pixelflat, illumflat, lampoffflats, scattlight, science, standard, trace, tilt, sky -``process`` :class:`~pypeit.par.pypeitpar.ProcessImagesPar` .. `ProcessImagesPar Keywords`_ Low level parameters used for basic image processing -``useframe`` str .. .. A calibrations file to use if it exists. -============= =============================================== ============================================================================================================================================================================ ============================ =============================================================================================================================================================================================================================================================== +============= =============================================== ================================================================================================================================================================================================== ============================ =============================================================================================================================================================================================================================================================== +Key Type Options Default Description +============= =============================================== ================================================================================================================================================================================================== ============================ =============================================================================================================================================================================================================================================================== +``exprng`` list .. None, None Used in identifying frames of this type. This sets the minimum and maximum allowed exposure times. There must be two items in the list. Use None to indicate no limit; i.e., to select exposures with any time greater than 30 sec, use exprng = [30, None]. +``frametype`` str ``align``, ``arc``, ``bias``, ``dark``, ``pinhole``, ``pixelflat``, ``illumflat``, ``lampoffflats``, ``slitless_pixflat``, ``scattlight``, ``science``, ``standard``, ``trace``, ``tilt``, ``sky`` ``science`` Frame type. Options are: align, arc, bias, dark, pinhole, pixelflat, illumflat, lampoffflats, slitless_pixflat, scattlight, science, standard, trace, tilt, sky +``process`` :class:`~pypeit.par.pypeitpar.ProcessImagesPar` .. `ProcessImagesPar Keywords`_ Low level parameters used for basic image processing +``useframe`` str .. .. A calibrations file to use if it exists. +============= =============================================== ================================================================================================================================================================================================== ============================ =============================================================================================================================================================================================================================================================== ---- @@ -886,6 +890,7 @@ Key Type Opti ``overscan_par`` int, list .. 5, 65 Parameters for the overscan subtraction. For 'chebyshev' or 'polynomial', set overcan_par = order; for 'savgol', set overscan_par = order, window size ; for 'median', set overscan_par = None or omit the keyword. ``rmcompact`` bool .. True Remove compact detections in LA cosmics routine ``satpix`` str ``reject``, ``force``, ``nothing`` ``reject`` Handling of saturated pixels. Options are: reject, force, nothing +``scale_to_mean`` bool .. False If True, scale the input images to have the same mean before combining. ``scattlight`` :class:`~pypeit.par.pypeitpar.ScatteredLightPar` .. `ScatteredLightPar Keywords`_ Scattered light subtraction parameters. ``shot_noise`` bool .. True Use the bias- and dark-subtracted image to calculate and include electron count shot noise in the image processing error budget ``sigclip`` int, float .. 4.5 Sigma level for rejection in LA cosmics routine @@ -1108,6 +1113,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1224,6 +1235,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1352,6 +1371,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1480,6 +1507,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1592,6 +1627,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1681,6 +1722,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1770,6 +1817,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1859,6 +1912,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -1975,6 +2034,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2104,6 +2171,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2229,6 +2304,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2346,6 +2427,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2445,6 +2532,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2535,6 +2628,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2626,6 +2725,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2734,6 +2839,13 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2834,6 +2946,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -2967,6 +3085,15 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = median + combine = median + satpix = nothing + scale_to_mean = True + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = median @@ -3105,6 +3232,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -3218,6 +3351,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -3281,7 +3420,7 @@ Alterations to the default parameters are: spectrograph = keck_lris_blue [calibrations] [[biasframe]] - exprng = None, 0.001, + exprng = None, 1, [[[process]]] combine = median use_biasimage = False @@ -3331,6 +3470,14 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + exprng = 0, 60, + [[[process]]] + combine = median + satpix = nothing + scale_to_mean = True + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -3341,11 +3488,13 @@ Alterations to the default parameters are: mask_cr = True noise_floor = 0.01 [[standardframe]] - exprng = 1, 61, + exprng = 1, 901, [[[process]]] mask_cr = True noise_floor = 0.01 spat_flexure_correct = True + [[flatfield]] + slit_illum_finecorr = False [[wavelengths]] sigdetect = 10.0 rms_thresh_frac_fwhm = 0.06 @@ -3383,7 +3532,7 @@ Alterations to the default parameters are: spectrograph = keck_lris_blue_orig [calibrations] [[biasframe]] - exprng = None, 0.001, + exprng = None, 1, [[[process]]] combine = median use_biasimage = False @@ -3433,6 +3582,14 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + exprng = 0, 60, + [[[process]]] + combine = median + satpix = nothing + scale_to_mean = True + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -3443,11 +3600,13 @@ Alterations to the default parameters are: mask_cr = True noise_floor = 0.01 [[standardframe]] - exprng = 1, 61, + exprng = 1, 901, [[[process]]] mask_cr = True noise_floor = 0.01 spat_flexure_correct = True + [[flatfield]] + slit_illum_finecorr = False [[wavelengths]] sigdetect = 10.0 rms_thresh_frac_fwhm = 0.06 @@ -3485,7 +3644,7 @@ Alterations to the default parameters are: spectrograph = keck_lris_red [calibrations] [[biasframe]] - exprng = None, 0.001, + exprng = None, 1, [[[process]]] combine = median use_biasimage = False @@ -3507,7 +3666,7 @@ Alterations to the default parameters are: use_pixelflat = False use_illumflat = False [[pixelflatframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] satpix = nothing use_pixelflat = False @@ -3520,12 +3679,12 @@ Alterations to the default parameters are: use_pixelflat = False use_illumflat = False [[traceframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] use_pixelflat = False use_illumflat = False [[illumflatframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] satpix = nothing use_pixelflat = False @@ -3535,6 +3694,14 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + exprng = 0, 60, + [[[process]]] + combine = median + satpix = nothing + scale_to_mean = True + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -3550,6 +3717,8 @@ Alterations to the default parameters are: mask_cr = True noise_floor = 0.01 spat_flexure_correct = True + [[flatfield]] + slit_illum_finecorr = False [[wavelengths]] sigdetect = 10.0 rms_thresh_frac_fwhm = 0.05 @@ -3598,7 +3767,7 @@ Alterations to the default parameters are: spectrograph = keck_lris_red_mark4 [calibrations] [[biasframe]] - exprng = None, 0.001, + exprng = None, 1, [[[process]]] combine = median use_biasimage = False @@ -3620,7 +3789,7 @@ Alterations to the default parameters are: use_pixelflat = False use_illumflat = False [[pixelflatframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] satpix = nothing use_pixelflat = False @@ -3633,12 +3802,12 @@ Alterations to the default parameters are: use_pixelflat = False use_illumflat = False [[traceframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] use_pixelflat = False use_illumflat = False [[illumflatframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] satpix = nothing use_pixelflat = False @@ -3648,6 +3817,14 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + exprng = 0, 60, + [[[process]]] + combine = median + satpix = nothing + scale_to_mean = True + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -3663,6 +3840,8 @@ Alterations to the default parameters are: mask_cr = True noise_floor = 0.01 spat_flexure_correct = True + [[flatfield]] + slit_illum_finecorr = False [[wavelengths]] sigdetect = 10.0 rms_thresh_frac_fwhm = 0.05 @@ -3711,7 +3890,7 @@ Alterations to the default parameters are: spectrograph = keck_lris_red_orig [calibrations] [[biasframe]] - exprng = None, 0.001, + exprng = None, 1, [[[process]]] combine = median use_biasimage = False @@ -3733,7 +3912,7 @@ Alterations to the default parameters are: use_pixelflat = False use_illumflat = False [[pixelflatframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] satpix = nothing use_pixelflat = False @@ -3746,12 +3925,12 @@ Alterations to the default parameters are: use_pixelflat = False use_illumflat = False [[traceframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] use_pixelflat = False use_illumflat = False [[illumflatframe]] - exprng = None, 60, + exprng = 0, 60, [[[process]]] satpix = nothing use_pixelflat = False @@ -3761,6 +3940,14 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + exprng = 0, 60, + [[[process]]] + combine = median + satpix = nothing + scale_to_mean = True + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -3776,6 +3963,8 @@ Alterations to the default parameters are: mask_cr = True noise_floor = 0.01 spat_flexure_correct = True + [[flatfield]] + slit_illum_finecorr = False [[wavelengths]] sigdetect = 10.0 rms_thresh_frac_fwhm = 0.05 @@ -3890,6 +4079,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -4018,6 +4215,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -4163,6 +4368,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -4308,6 +4521,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -4452,6 +4673,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -4582,6 +4811,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -4702,6 +4939,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -4831,6 +5076,14 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = odd_even + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = odd_even @@ -4956,6 +5209,14 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = odd_even + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = odd_even @@ -5087,6 +5348,14 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = odd_even + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = odd_even @@ -5212,6 +5481,14 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = odd_even + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = odd_even @@ -5341,6 +5618,14 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = chebyshev + overscan_par = 1 + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = chebyshev @@ -5489,6 +5774,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -5633,6 +5926,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -5744,6 +6045,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -5858,6 +6165,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -5947,6 +6260,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6054,6 +6373,14 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = odd_even + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = odd_even @@ -6158,6 +6485,13 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6276,6 +6610,13 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6396,6 +6737,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6528,6 +6877,13 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6636,6 +6992,13 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6724,6 +7087,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6823,6 +7192,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -6916,6 +7291,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7030,6 +7411,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7158,6 +7547,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7259,6 +7654,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7351,6 +7752,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7450,6 +7857,13 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7553,6 +7967,13 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7654,6 +8075,12 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7742,6 +8169,13 @@ Alterations to the default parameters are: satpix = nothing use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = median + combine = median + satpix = nothing + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = median @@ -7863,6 +8297,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -7999,6 +8441,14 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_biasimage = False + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -8029,6 +8479,7 @@ Alterations to the default parameters are: ech_sigrej = 3.0 lamps = OH_XSHOOTER, sigdetect = 10.0 + fwhm_fromlines = False reid_arxiv = vlt_xshooter_nir.fits cc_thresh = 0.5 cc_local_thresh = 0.5 @@ -8057,7 +8508,7 @@ Alterations to the default parameters are: use_illumflat = False [reduce] [[findobj]] - trace_npoly = 8 + trace_npoly = 10 maxnumber_sci = 2 maxnumber_std = 1 [[skysub]] @@ -8155,6 +8606,14 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = median + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = median @@ -8300,6 +8759,14 @@ Alterations to the default parameters are: use_biasimage = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + overscan_method = median + combine = median + satpix = nothing + use_biasimage = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] overscan_method = median @@ -8443,6 +8910,13 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing @@ -8548,6 +9022,13 @@ Alterations to the default parameters are: use_overscan = False use_pixelflat = False use_illumflat = False + [[slitless_pixflatframe]] + [[[process]]] + combine = median + satpix = nothing + use_overscan = False + use_pixelflat = False + use_illumflat = False [[scattlightframe]] [[[process]]] satpix = nothing diff --git a/doc/releases/1.16.1dev.rst b/doc/releases/1.16.1dev.rst index cc82174157..521da0b378 100644 --- a/doc/releases/1.16.1dev.rst +++ b/doc/releases/1.16.1dev.rst @@ -14,6 +14,9 @@ Dependency Changes ------------------ - Support added for numpy>=2.0.0; numpy<=2.0.0 should still be supported +- Deprecated support for python 3.10 +- General update to dependencies to be roughly consistent with release of python + 3.11 Functionality/Performance Improvements and Additions ---------------------------------------------------- @@ -46,17 +49,23 @@ Instrument-specific Updates - Updated X-Shooter detector gain and read noise to come from header, and updated plate scales to the most recent values from the manual. Detailed changes are: + - NIR arm: + - Platescale updated from 0.197 to 0.245 arcsec/pixel - Dark current updated from 0. to 72. e-/pixel/hr - Gain updated from 2.12 to 2.29 e-/DN + - VIS arm: + - Platescale updated from an order-dependent value, to being 0.154 arcsec/pixel for all orders + - UVB arm: + - Platescale updated from an order-dependent value, to being 0.164 arcsec/pixel for all orders - +- Add new P200/DBSP reid_arxiv template for 1200/7100 with D55 dichroic Script Changes -------------- @@ -87,7 +96,7 @@ Datamodel Changes ----------------- - Spatial flexure is now stored as a 2D numpy array. -- Added support for data coaddition with the UVES_popler GUI tool. +- Adjusted spec1d datamodel to enable use with UVES_popler GUI tool Under-the-hood Improvements --------------------------- @@ -95,6 +104,9 @@ Under-the-hood Improvements - Introduced :class:`~pypeit.pypeitdata.PypeItDataPaths` to handle all interactions with the ``pypeit/data`` directory, which provides a unified interface for accessing on-disk and cached files. +- Updated general raw image reader so that it correctly accounts for + spectrographs that read the data and overscan sections directly from the file + headers. Bug Fixes --------- @@ -110,6 +122,9 @@ Bug Fixes - Fix error "ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions..." occurring when unpacking the SpecObj spectrum but having an attribute of the SpecObj object that is None. +- Fixed an hidden bug that was causing the spatial flexure to fail. The bug was in the + `SlitTraceBitMask` class, where the function `exclude_for_flexure()` was not returning + the 'BOXSLIT' flag. diff --git a/doc/spectrographs/keck_hires.rst b/doc/spectrographs/keck_hires.rst index 34ff1dd6fd..f1628da181 100644 --- a/doc/spectrographs/keck_hires.rst +++ b/doc/spectrographs/keck_hires.rst @@ -7,10 +7,10 @@ Overview This file summarizes several instrument specific settings that are related to the Keck/HIRES spectrograph. Currently, PypeIt only supports the reduction of the post detector upgrade HIRES data (around August 2004). -Information on the frame typing and instrument configuration can be found in ref:`hiresframes` and :ref:`hiresconfig`. +Information on the frame typing and instrument configuration can be found in ref:`hiresframes` and :ref:`hires_config`. Default Settings -++++++++++++++++ +---------------- See :ref:`instr_par-keck_hires` for a list of modifications to the default settings. *You do not have to add these changes to your PypeIt reduction file!* This is just a list of diff --git a/environment.yml b/environment.yml index b52aa30b6e..c020c2fd15 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: pypeit channels: - defaults dependencies: - - python>=3.10,<3.13 + - python>=3.11,<3.13 - pip - pip: - pypeit diff --git a/pypeit/core/flexure.py b/pypeit/core/flexure.py index 9b1151d2c5..600577de39 100644 --- a/pypeit/core/flexure.py +++ b/pypeit/core/flexure.py @@ -1410,23 +1410,26 @@ def sky_em_residuals(wave:np.ndarray, flux:np.ndarray, def flexure_diagnostic(file, file_type='spec2d', flexure_type='spec', chk_version=False): """ Print the spectral or spatial flexure of a spec2d or spec1d file + Args: file (:obj:`str`, `Path`_): Filename of the spec2d or spec1d file to check file_type (:obj:`str`, optional): - Type of the file to check. Options are 'spec2d' or 'spec1d'. Default is 'spec2d'. + Type of the file to check. Options are 'spec2d' or 'spec1d'. Default + is 'spec2d'. flexure_type (:obj:`str`, optional): - Type of flexure to check. Options are 'spec' or 'spat'. Default is 'spec'. + Type of flexure to check. Options are 'spec' or 'spat'. Default is + 'spec'. chk_version (:obj:`bool`, optional): - If True, raise an error if the datamodel version or type check failed. - If False, throw a warning only. Default is False. + If True, raise an error if the datamodel version or type check + failed. If False, throw a warning only. Default is False. Returns: - :obj:`astropy.table.Table` or :obj:`float` or None: - - If file_type is 'spec2d' and flexure_type is 'spec', return a table with the spectral flexure - - If file_type is 'spec2d' and flexure_type is 'spat', return the spatial flexure - - If file_type is 'spec1d', return a table with the spectral flexure - + :obj:`astropy.table.Table`, :obj:`float`, None: If file_type is 'spec2d' and + flexure_type is 'spec', return a table with the spectral flexure. If + file_type is 'spec2d' and flexure_type is 'spat', return the spatial + flexure. If file_type is 'spec1d', return a table with the spectral + flexure. """ # value to return diff --git a/pypeit/core/telluric.py b/pypeit/core/telluric.py index 82eec1a626..de0e3c8e34 100644 --- a/pypeit/core/telluric.py +++ b/pypeit/core/telluric.py @@ -189,8 +189,6 @@ def read_telluric_pca(filename, wave_min=None, wave_max=None, pad_frac=0.10): dwave, dloglam, resln_guess, pix_per_sigma = wvutils.get_sampling(wave_grid) tell_pad_pix = int(np.ceil(10.0 * pix_per_sigma)) - if dloglam == 0.0: - msgs.error('The telluric PCA method has zero spacing in log wavelength. This is not supported.') return dict(wave_grid=wave_grid, dloglam=dloglam, tell_pad_pix=tell_pad_pix, ncomp_tell_pca=ncomp, @@ -253,8 +251,6 @@ def read_telluric_grid(filename, wave_min=None, wave_max=None, pad_frac=0.10): dwave, dloglam, resln_guess, pix_per_sigma = wvutils.get_sampling(wave_grid) tell_pad_pix = int(np.ceil(10.0 * pix_per_sigma)) - if dloglam == 0.0: - msgs.error('The telluric grid has zero spacing in log wavelength. This is not supported.') return dict(wave_grid=wave_grid, dloglam=dloglam, tell_pad_pix=tell_pad_pix, pressure_grid=pg, temp_grid=tg, h2o_grid=hg, airmass_grid=ag, diff --git a/pypeit/core/wavecal/spectrographs/templ_p200_dbsp.py b/pypeit/core/wavecal/spectrographs/templ_p200_dbsp.py index 21902aee15..90b842f216 100644 --- a/pypeit/core/wavecal/spectrographs/templ_p200_dbsp.py +++ b/pypeit/core/wavecal/spectrographs/templ_p200_dbsp.py @@ -41,6 +41,22 @@ def p200_dbsp_red_1200_9400_d55(overwrite=False): # DBSPr 1200/9400 D55 templates.build_template([wfile0], slits, lcut, binspec, outroot, lowredux=False, ifiles=ifiles, normalize=True, overwrite=overwrite) +# ############################## +def p200_dbsp_red_1200_7100_d55(overwrite=False): # DBSPr 1200/7100 D55 + + binspec = 1 + outroot = 'p200_dbsp_red_1200_7100_d55_6680.fits' + # + ifiles = [0] + slits = [55] # Be careful with the order.. + lcut = None + wfile0 = os.path.join(templates.template_path, 'P200_DBSP', + 'R1200_7100_D55', 'wvcalib_6680.fits') + + # + templates.build_template([wfile0], slits, lcut, binspec, outroot, + lowredux=False, ifiles=ifiles, normalize=True, overwrite=overwrite) + # ############################## def p200_dbsp_red_600_10000_d55(overwrite=False): # DBSPr 600/10000 D55 @@ -144,4 +160,5 @@ def p200_dbsp_blue_1200_5000_d68(overwrite=False): # DBSPb 1200/5000 D68 if __name__ == '__main__': # p200_dbsp_red_316_7500_d55(overwrite=True) # p200_dbsp_red_600_10000_d55(overwrite=True) - p200_dbsp_red_1200_7100_d68(overwrite=True) + # p200_dbsp_red_1200_7100_d68(overwrite=True) + p200_dbsp_red_1200_7100_d55(overwrite=True) diff --git a/pypeit/core/wavecal/wvutils.py b/pypeit/core/wavecal/wvutils.py index 89c992700c..8ede0b92c4 100644 --- a/pypeit/core/wavecal/wvutils.py +++ b/pypeit/core/wavecal/wvutils.py @@ -136,9 +136,13 @@ def get_sampling(waves, pix_per_R=3.0): wave_diff_flat += np.diff(wave_good).tolist() dloglam_flat += np.diff(np.log10(wave_good)).tolist() - + # Compute the median wavelength spacing dwave = np.median(wave_diff_flat) dloglam = np.median(dloglam_flat) + # Check that this won't introduce a divide by zero + if dloglam == 0.0: + msgs.error('The wavelength sampling has zero spacing in log wavelength. This is not supported.') + # Compute a guess of the resolution resln_guess = 1.0 / (pix_per_R* dloglam * np.log(10.0)) pix_per_sigma = 1.0 / resln_guess / (dloglam * np.log(10.0)) / (2.0 * np.sqrt(2.0 * np.log(2))) return dwave, dloglam, resln_guess, pix_per_sigma diff --git a/pypeit/data/arc_lines/reid_arxiv/p200_dbsp_red_1200_7100_d55_6680.fits b/pypeit/data/arc_lines/reid_arxiv/p200_dbsp_red_1200_7100_d55_6680.fits new file mode 100644 index 0000000000..475918859a Binary files /dev/null and b/pypeit/data/arc_lines/reid_arxiv/p200_dbsp_red_1200_7100_d55_6680.fits differ diff --git a/pypeit/flatfield.py b/pypeit/flatfield.py index 5b41d2222d..709f1a1cb1 100644 --- a/pypeit/flatfield.py +++ b/pypeit/flatfield.py @@ -1324,30 +1324,28 @@ def fit(self, spat_illum_only=False, doqa=True, debug=False): * np.fmax(self.msillumflat[onslit_tweak], 0.05) \ * np.fmax(spec_model[onslit_tweak], 1.0) - # Construct the pixel flat - #trimmed_slitid_img_anew = self.slits.slit_img(pad=-trim, slitidx=slit_idx) - #onslit_trimmed_anew = trimmed_slitid_img_anew == slit_spat - self.mspixelflat[onslit_tweak] = rawflat[onslit_tweak] * utils.inverse(self.flat_model[onslit_tweak]) - # TODO: Add some code here to treat the edges and places where fits - # go bad? - - # Check for infinities and NaNs + # Check for infinities and NaNs in the flat-field model winfnan = np.where(np.logical_not(np.isfinite(self.flat_model[onslit_tweak]))) if winfnan[0].size != 0: msgs.warn('There are {0:d} pixels with non-finite values in the flat-field model ' 'for slit {1:d}!'.format(winfnan[0].size, slit_spat) + msgs.newline() + 'These model pixel values will be set to the raw pixel value.') self.flat_model[np.where(onslit_tweak)[0][winfnan]] = rawflat[np.where(onslit_tweak)[0][winfnan]] - self.mspixelflat[np.where(onslit_tweak)[0][winfnan]] = 1.0 # Check for unrealistically high or low values of the model whilo = np.where((self.flat_model[onslit_tweak] >= nonlinear_counts) | (self.flat_model[onslit_tweak] <= 0.0)) if whilo[0].size != 0: - msgs.warn('There are {0:d} pixels with non-finite values in the flat-field model ' + msgs.warn('There are {0:d} pixels with unrealistically high or low values in the flat-field model ' 'for slit {1:d}!'.format(whilo[0].size, slit_spat) + msgs.newline() + 'These model pixel values will be set to the raw pixel value.') self.flat_model[np.where(onslit_tweak)[0][whilo]] = rawflat[np.where(onslit_tweak)[0][whilo]] - self.mspixelflat[np.where(onslit_tweak)[0][whilo]] = 1.0 + + # Construct the pixel flat + #trimmed_slitid_img_anew = self.slits.slit_img(pad=-trim, slitidx=slit_idx) + #onslit_trimmed_anew = trimmed_slitid_img_anew == slit_spat + self.mspixelflat[onslit_tweak] = rawflat[onslit_tweak] * utils.inverse(self.flat_model[onslit_tweak]) + # TODO: Add some code here to treat the edges and places where fits + # go bad? # Minimum wavelength? if self.flatpar['pixelflat_min_wave'] is not None and self.waveimg is not None: @@ -1534,9 +1532,8 @@ def spatial_fit_finecorr(self, normed, onslit_tweak, slit_idx, slit_spat, gpm, msgs.warn(f"Fine correction to the spatial illumination failed for {slit_txt} {slit_ordid}") return illumflat_finecorr - # If corrections are above the tolerance, then clip them to the level of the tolerance - illumflat_finecorr[np.where(illumflat_finecorr < 1-tolerance)] = 1-tolerance - illumflat_finecorr[np.where(illumflat_finecorr > 1+tolerance)] = 1+tolerance + # If corrections exceed the tolerance, then clip them to the level of the tolerance + illumflat_finecorr = np.clip(illumflat_finecorr, 1-tolerance, 1+tolerance) # Prepare QA if doqa: diff --git a/pypeit/par/pypeitpar.py b/pypeit/par/pypeitpar.py index b06b5bc18b..d41e24c932 100644 --- a/pypeit/par/pypeitpar.py +++ b/pypeit/par/pypeitpar.py @@ -1962,7 +1962,7 @@ class SensFuncPar(ParSet): For a table with the current keywords, defaults, and descriptions, see :ref:`parameters`. """ - def __init__(self, use_blaze=None, extrap_blu=None, extrap_red=None, samp_fact=None, multi_spec_det=None, algorithm=None, UVIS=None, + def __init__(self, use_flat=None, extrap_blu=None, extrap_red=None, samp_fact=None, multi_spec_det=None, algorithm=None, UVIS=None, IR=None, polyorder=None, star_type=None, star_mag=None, star_ra=None, extr=None, star_dec=None, mask_hydrogen_lines=None, mask_helium_lines=None, hydrogen_mask_wid=None): # Grab the parameter names and values from the function arguments @@ -1975,9 +1975,9 @@ def __init__(self, use_blaze=None, extrap_blu=None, extrap_red=None, samp_fact=N dtypes = OrderedDict.fromkeys(pars.keys()) descr = OrderedDict.fromkeys(pars.keys()) - defaults['use_blaze'] = False - dtypes['use_blaze'] = bool - descr['use_blaze'] = 'If True, the blaze will be used when computing the sensitivity function.' + defaults['use_flat'] = False + dtypes['use_flat'] = bool + descr['use_flat'] = 'If True, the flatfield spectrum will be used when computing the sensitivity function.' defaults['extr'] = 'OPT' dtypes['extr'] = str @@ -2080,7 +2080,7 @@ def from_dict(cls, cfg): k = np.array([*cfg.keys()]) # Single element parameters - parkeys = ['use_blaze', 'extrap_blu', 'extrap_red', 'samp_fact', 'multi_spec_det', 'algorithm', + parkeys = ['use_flat', 'extrap_blu', 'extrap_red', 'samp_fact', 'multi_spec_det', 'algorithm', 'polyorder', 'star_type', 'star_mag', 'star_ra', 'star_dec', 'extr', 'mask_hydrogen_lines', 'mask_helium_lines', 'hydrogen_mask_wid'] diff --git a/pypeit/pypeit.py b/pypeit/pypeit.py index 6b833e87ac..b8edbe7a17 100644 --- a/pypeit/pypeit.py +++ b/pypeit/pypeit.py @@ -1046,11 +1046,9 @@ def extract_one(self, frames, det, sciImg, bkg_redux_sciimg, objFind, initial_sk if not self.par['reduce']['extraction']['skip_extraction']: msgs.info(f"Extraction begins for {self.basename} on det={det}") # set the flatimg, if it exists - try: - flatimg = self.caliBrate.flatimages.pixelflat_model - except AttributeError: - msgs.warn("No flat image was found. The blaze will not be extracted!") - flatimg = None + flatimg = None if self.caliBrate.flatimages is None else self.caliBrate.flatimages.pixelflat_model + if flatimg is None: + msgs.warn("No flat image was found. A spectrum of the flatfield will not be extracted!") # Instantiate Reduce object # Required for pipeline specific object # At instantiation, the fullmask in self.sciImg is modified diff --git a/pypeit/scripts/cache_github_data.py b/pypeit/scripts/cache_github_data.py index 6e49169949..b7ec524722 100644 --- a/pypeit/scripts/cache_github_data.py +++ b/pypeit/scripts/cache_github_data.py @@ -130,7 +130,7 @@ def main(args): files = np.array(contents[path])[to_download[path]] if len(files) == 0: continue - data_path = PypeItDataPath(path) + data_path = PypeItDataPath(path, remote_host="github") # NOTE: I'm using POSIX path here because I'm unsure what will # happen on Windows if the file is in a subdirectory. root = pathlib.PurePosixPath(f'pypeit/data/{path}') diff --git a/pypeit/scripts/sensfunc.py b/pypeit/scripts/sensfunc.py index d2e8ace9d5..6a8a1d58ae 100644 --- a/pypeit/scripts/sensfunc.py +++ b/pypeit/scripts/sensfunc.py @@ -66,6 +66,16 @@ def get_parser(cls, width=None): 'provided but with .fits trimmed off if it is in the filename.') parser.add_argument("-s", "--sens_file", type=str, help='Configuration file with sensitivity function parameters') + parser.add_argument("-f", "--use_flat", default=False, action="store_true", + help="R|Use the extracted spectrum of the flatfield calibration to estimate the blaze " + "function when generating the sensitivity function. This is helpful to account for " + "small scale undulations in the sensitivity function. The spec1dfile must contain the " + "extracted flatfield response in order to use this option. This spectrum is extracted " + "by default, unless you did not compute a pixelflat frame. Note that it is not " + "possible to set --use_flat and simultaneously use a .sens file with the --sens_file " + "option. If you are using a .sens file, set the use_flat flag with the argument:\n\n" + "F| [sensfunc]\n" + "F| use_flat = True") parser.add_argument("--debug", default=False, action="store_true", help="show debug plots?") parser.add_argument("--par_outfile", default='sensfunc.par', @@ -101,6 +111,15 @@ def main(args): " algorithm = IR\n" "\n") + if args.use_flat and args.sens_file is not None: + msgs.error("It is not possible to set --use_flat and simultaneously use a .sens " + "file via the --sens_file option. If you are using a .sens file set the " + "use_flat flag in your .sens file using the argument:\n" + "\n" + " [sensfunc]\n" + " use_flat = True\n" + "\n") + if args.multi is not None and args.sens_file is not None: msgs.error("It is not possible to set --multi and simultaneously use a .sens file via " "the --sens_file option. If you are using a .sens file set the detectors " @@ -153,6 +172,11 @@ def main(args): if args.algorithm is not None: par['sensfunc']['algorithm'] = args.algorithm + # If use_flat was flagged in the input, set use_flat to True. Note this does undo .sens + # file since they cannot both be passed + if args.use_flat: + par['sensfunc']['use_flat'] = True + # If multi was set override defaults. Note this does undo .sens file # since they cannot both be passed if args.multi is not None: diff --git a/pypeit/sensfunc.py b/pypeit/sensfunc.py index 3278efc3af..85d540e77b 100644 --- a/pypeit/sensfunc.py +++ b/pypeit/sensfunc.py @@ -255,7 +255,7 @@ def __init__(self, spec1dfile, sensfile, par, par_fluxcalib=None, debug=False, # Unpack standard wave, counts, counts_ivar, counts_mask, log10_blaze_function, self.meta_spec, header \ - = self.sobjs_std.unpack_object(ret_flam=False, log10blaze=True, extract_blaze=par['use_blaze'], + = self.sobjs_std.unpack_object(ret_flam=False, log10blaze=True, extract_blaze=par['use_flat'], extract_type=self.extr, remove_missing=True) # Perform any instrument tweaks diff --git a/pypeit/slittrace.py b/pypeit/slittrace.py index 19d1062e7a..d36d38444e 100644 --- a/pypeit/slittrace.py +++ b/pypeit/slittrace.py @@ -68,7 +68,7 @@ def exclude_for_reducing(self): def exclude_for_flexure(self): # Ignore these flags when performing a flexure calculation # Currently they are *all* of the flags.. - return ['SHORTSLIT', 'USERIGNORE', 'BADWVCALIB', 'BADTILTCALIB', 'BADALIGNCALIB', + return ['SHORTSLIT', 'BOXSLIT', 'USERIGNORE', 'BADWVCALIB', 'BADTILTCALIB', 'BADALIGNCALIB', 'SKIPFLATCALIB', 'BADFLATCALIB', 'BADSKYSUB', 'BADEXTRACT'] diff --git a/pypeit/specobj.py b/pypeit/specobj.py index 94a62af78a..eb28627b06 100644 --- a/pypeit/specobj.py +++ b/pypeit/specobj.py @@ -255,11 +255,20 @@ def __init__(self, PYPELINE, DET, OBJTYPE='unknown', @classmethod def from_arrays(cls, PYPELINE:str, wave:np.ndarray, counts:np.ndarray, ivar:np.ndarray, - flat:np.ndarray, mode='OPT', DET='DET01', SLITID=0, **kwargs): + flat=None, mode='OPT', DET='DET01', SLITID=0, **kwargs): # Instantiate slf = cls(PYPELINE, DET, SLITID=SLITID) + # Check the type of the flat field if it's not None + if flat is not None: + if not isinstance(flat, np.ndarray): + msgs.error('Flat must be a numpy array') + if flat.shape != counts.shape: + msgs.error('Flat and counts must have the same shape') # Add in arrays for item, attr in zip([wave, counts, ivar, flat], ['_WAVE', '_COUNTS', '_COUNTS_IVAR', '_FLAT']): + # Check if any of the arrays are None. If so, skip + if item is None: + continue setattr(slf, mode+attr, item.astype(float)) # Mask. Watch out for places where ivar is infinite due to a divide by 0 slf[mode+'_MASK'] = (slf[mode+'_COUNTS_IVAR'] > 0.) & np.isfinite(slf[mode+'_COUNTS_IVAR']) diff --git a/pypeit/spectrographs/ldt_deveny.py b/pypeit/spectrographs/ldt_deveny.py index 6405862874..dae7d1d0ed 100644 --- a/pypeit/spectrographs/ldt_deveny.py +++ b/pypeit/spectrographs/ldt_deveny.py @@ -566,79 +566,17 @@ def config_specific_par(self, scifile, inp_par=None): def get_rawimage(self, raw_file, det): """ - Read raw images and generate a few other bits and pieces - that are key for image processing. + Read raw spectrograph image files and return data and relevant metadata + needed for image processing. For LDT/DeVeny, the LOIS control system automatically adjusts the - ``DATASEC`` and ``OSCANSEC`` regions if the CCD is used in a binning other - than 1x1. The :meth:`~pypeit.spectrographs.spectrograph.Spectrograph.get_rawimage` - method in the base class assumes these sections are fixed and adjusts - them based on the binning -- an incorrect assumption for this instrument. - - This method is a stripped-down version of the base class method and - additionally does *NOT* send the binning to :func:`~pypeit.core.parse.sec2slice`. - - Parameters - ---------- - raw_file : :obj:`str` - File to read - det : :obj:`int` - 1-indexed detector to read - - Returns - ------- - detector_par : :class:`~pypeit.images.detector_container.DetectorContainer` - Detector metadata parameters. - raw_img : `numpy.ndarray`_ - Raw image for this detector. - hdu : `astropy.io.fits.HDUList`_ - Opened fits file - exptime : :obj:`float` - Exposure time *in seconds*. - rawdatasec_img : `numpy.ndarray`_ - Data (Science) section of the detector as provided by setting the - (1-indexed) number of the amplifier used to read each detector - pixel. Pixels unassociated with any amplifier are set to 0. - oscansec_img : `numpy.ndarray`_ - Overscan section of the detector as provided by setting the - (1-indexed) number of the amplifier used to read each detector - pixel. Pixels unassociated with any amplifier are set to 0. + ``DATASEC`` and ``OSCANSEC`` regions if the CCD is used in a binning + other than 1x1. This is a simple wrapper for + :func:`pypeit.spectrographs.spectrograph.Spectrograph.get_rawimage` that + sets ``sec_includes_binning`` to True. See the base-class function for + the detailed descriptions of the input parameters and returned objects. """ - # Open - hdu = io.fits_open(raw_file) - - # Grab the DetectorContainer and extract the raw image - detector = self.get_detector_par(det, hdu=hdu) - raw_img = hdu[detector['dataext']].data.astype(float) - - # Exposure time (used by RawImage) from the header - headarr = self.get_headarr(hdu) - exptime = self.get_meta_value(headarr, 'exptime') - - for section in ['datasec', 'oscansec']: - # Get the data section from Detector - image_sections = detector[section] - - # Initialize the image (0 means no amplifier) - pix_img = np.zeros(raw_img.shape, dtype=int) - for i in range(detector['numamplifiers']): - - if image_sections is not None: - # Convert the (FITS) data section from a string to a slice - # DO NOT send the binning (default: None) - datasec = parse.sec2slice(image_sections[i], one_indexed=True, - include_end=True, require_dim=2) - # Assign the amplifier - pix_img[datasec] = i+1 - - # Finish - if section == 'datasec': - rawdatasec_img = pix_img.copy() - else: - oscansec_img = pix_img.copy() - - # Return - return detector, raw_img, hdu, exptime, rawdatasec_img, oscansec_img + return super().get_rawimage(raw_file, det, sec_includes_binning=True) def calc_pattern_freq(self, frame, rawdatasec_img, oscansec_img, hdu): """ diff --git a/pypeit/spectrographs/p200_dbsp.py b/pypeit/spectrographs/p200_dbsp.py index 0ea3032236..19cd3b8e3f 100644 --- a/pypeit/spectrographs/p200_dbsp.py +++ b/pypeit/spectrographs/p200_dbsp.py @@ -169,6 +169,20 @@ def check_frame_type(self, ftype, fitstbl, exprng=None): msgs.warn('Cannot determine if frames are of type {0}.'.format(ftype)) return np.zeros(len(fitstbl), dtype=bool) + def get_rawimage(self, raw_file, det): + """ + Read raw spectrograph image files and return data and relevant metadata + needed for image processing. + + For P200/DBSP, the ``DATASEC`` and ``OSCANSEC`` regions are read + directly from the file header and are automatically adjusted to account + for the on-chip binning. This is a simple wrapper for + :func:`pypeit.spectrographs.spectrograph.Spectrograph.get_rawimage` that + sets ``sec_includes_binning`` to True. See the base-class function for + the detailed descriptions of the input parameters and returned objects. + """ + return super().get_rawimage(raw_file, det, sec_includes_binning=True) + class P200DBSPBlueSpectrograph(P200DBSPSpectrograph): """ @@ -575,6 +589,9 @@ def config_specific_par(self, scifile, inp_par=None): 'D68': { 7600: 'p200_dbsp_red_1200_7100_d68.fits', 8200: 'p200_dbsp_red_1200_7100_d68.fits' + }, + 'D55': { + 6680: 'p200_dbsp_red_1200_7100_d55_6680.fits' } }, '1200/9400': { diff --git a/pypeit/spectrographs/spectrograph.py b/pypeit/spectrographs/spectrograph.py index 81bf5843fd..bb0bd0b4ff 100644 --- a/pypeit/spectrographs/spectrograph.py +++ b/pypeit/spectrographs/spectrograph.py @@ -1163,10 +1163,10 @@ def validate_det(self, det): msgs.error(f'Provided det must have type tuple or integer, not {type(det)}.') return 1, (det,) - def get_rawimage(self, raw_file, det): + def get_rawimage(self, raw_file, det, sec_includes_binning=False): """ - Read raw images and generate a few other bits and pieces that are key - for image processing. + Read raw spectrograph image files and return data and relevant metadata + needed for image processing. .. warning:: @@ -1181,6 +1181,14 @@ def get_rawimage(self, raw_file, det): 1-indexed detector(s) to read. An image mosaic is selected using a :obj:`tuple` with the detectors in the mosaic, which must be one of the allowed mosaics returned by :func:`allowed_mosaics`. + sec_includes_binning : :obj:`bool`, optional + Some instruments use hard-coded image-section strings to define the + data and overscan regions, which are then automatically adjusted by + the on-chip binning read from the header. Others read the data and + overscan sections directly from the header. If these sections + *include* the on-chip binning automatically when the image is + written, this flag should be set to true so that this reader returns + the correct image sections. Returns ------- @@ -1207,7 +1215,8 @@ def get_rawimage(self, raw_file, det): """ # Check extension and then open self._check_extensions(raw_file) - hdu = io.fits_open(raw_file, ignore_missing_end=True, output_verify = 'ignore', ignore_blank=True) + hdu = io.fits_open(raw_file, ignore_missing_end=True, output_verify='ignore', + ignore_blank=True) # Validate the entered (list of) detector(s) nimg, _det = self.validate_det(det) @@ -1225,15 +1234,26 @@ def get_rawimage(self, raw_file, det): # NOTE: This *must* be (converted to) seconds. exptime = self.get_meta_value(headarr, 'exptime') - # Rawdatasec, oscansec images - binning = self.get_meta_value(headarr, 'binning') - # NOTE: This means that `specaxis` must be the same for all detectors in - # a mosaic - if detectors[0]['specaxis'] == 1: - binning_raw = (',').join(binning.split(',')[::-1]) + # Binning + if sec_includes_binning: + # The section in the header includes the binning, so set it to None + # here. + binning_raw = None else: - binning_raw = binning + binning = self.get_meta_value(headarr, 'binning') + # NOTE: This means that `specaxis` must be the same for all detectors in + # a mosaic + if detectors[0]['specaxis'] == 1: + binning_raw = (',').join(binning.split(',')[::-1]) + else: + binning_raw = binning + + # Always assume normal FITS header formatting + one_indexed = True + include_last = True + require_dim = 2 + # Read the image(s) raw_img = [None]*nimg rawdatasec_img = [None]*nimg oscansec_img = [None]*nimg @@ -1254,28 +1274,18 @@ def get_rawimage(self, raw_file, det): for section in ['datasec', 'oscansec']: - # Get the data section - # Try using the image sections as header keywords - # TODO -- Deal with user windowing of the CCD (e.g. Kast red) - # Code like the following maybe useful - #hdr = hdu[detector[det - 1]['dataext']].header - #image_sections = [hdr[key] for key in detector[det - 1][section]] - # Grab from Detector + # Get the data sections from the detector object (see get_detector_par above) + # TODO: Add ability to incude user windowing (e.g., Kast Red) image_sections = detectors[i][section] - #if not isinstance(image_sections, list): - # image_sections = [image_sections] - # Always assume normal FITS header formatting - one_indexed = True - include_last = True # Initialize the image (0 means no amplifier) pix_img = np.zeros(raw_img[i].shape, dtype=int) for j in range(detectors[i]['numamplifiers']): if image_sections is not None: # and image_sections[i] is not None: - # Convert the data section from a string to a slice + # Convert the (FITS) data section from a string to a slice datasec = parse.sec2slice(image_sections[j], one_indexed=one_indexed, - include_end=include_last, require_dim=2, + include_end=include_last, require_dim=require_dim, binning=binning_raw) # Assign the amplifier pix_img[datasec] = j+1 diff --git a/pypeit/spectrographs/vlt_xshooter.py b/pypeit/spectrographs/vlt_xshooter.py index 98b5cf6895..9160f834e3 100644 --- a/pypeit/spectrographs/vlt_xshooter.py +++ b/pypeit/spectrographs/vlt_xshooter.py @@ -574,8 +574,8 @@ def get_detector_par(self, det, hdu=None): # Grab the gain and read noise from the header. # If hdu not present, use typical defaults - gain = None if hdu is None else hdu[0].header['HIERARCH ESO DET OUT1 CONAD'] - ronoise = None if hdu is None else hdu[0].header['HIERARCH ESO DET OUT1 RON'] + gain = None if hdu is None else np.atleast_1d(hdu[0].header['HIERARCH ESO DET OUT1 CONAD']) + ronoise = None if hdu is None else np.atleast_1d(hdu[0].header['HIERARCH ESO DET OUT1 RON']) # Detector 1 detector_dict = dict( @@ -591,8 +591,8 @@ def get_detector_par(self, det, hdu=None): nonlinear = 0.86, mincounts = -1e10, numamplifiers = 1, - gain = np.atleast_1d(gain), - ronoise = np.atleast_1d(ronoise), + gain = gain, + ronoise = ronoise, datasec=np.atleast_1d('[:,11:2058]'), # FITS format is flipped: PrimaryHDU (2106, 4000) w/respect to Python oscansec=np.atleast_1d('[:,2059:2106]'), # raw unbinned images are (4000,2106) (spec, spat) ) # pre and oscan are in the spatial direction @@ -866,8 +866,8 @@ def get_detector_par(self, det, hdu=None): binning = '1,1' if hdu is None else self.get_meta_value(self.get_headarr(hdu), 'binning') # Grab the gain and read noise from the header. - gain = None if hdu is None else hdu[0].header['HIERARCH ESO DET OUT1 CONAD'] - ronoise = None if hdu is None else hdu[0].header['HIERARCH ESO DET OUT1 RON'] + gain = None if hdu is None else np.atleast_1d(hdu[0].header['HIERARCH ESO DET OUT1 CONAD']) + ronoise = None if hdu is None else np.atleast_1d(hdu[0].header['HIERARCH ESO DET OUT1 RON']) # Detector 1 detector_dict = dict( @@ -883,8 +883,8 @@ def get_detector_par(self, det, hdu=None): nonlinear = 0.86, mincounts = -1e10, numamplifiers = 1, - gain = np.atleast_1d(gain), - ronoise = np.atleast_1d(ronoise), + gain = gain, + ronoise = ronoise, datasec = np.atleast_1d('[:,49:2096]'), # '[49:2000,1:2999]', oscansec = np.atleast_1d('[:,1:48]'), # '[1:48, 1:2999]', ) diff --git a/setup.cfg b/setup.cfg index c910a2c648..294a1e1615 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,6 @@ classifiers = Natural Language :: English Operating System :: OS Independent Programming Language :: Python - Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 Topic :: Documentation :: Sphinx @@ -29,28 +28,28 @@ classifiers = zip_safe = False use_2to3=False packages = find: -python_requires = >=3.10,<3.13 +python_requires = >=3.11,<3.13 setup_requires = setuptools_scm include_package_data = True install_requires = - numpy>=1.23,<2.0.0 + numpy>=1.24 astropy>=6.0 - extension-helpers>=0.1 - packaging>=0.19 - scipy>=1.7 + extension-helpers>=1.0 + packaging>=22.0 + scipy>=1.9 matplotlib>=3.7 - PyYAML>=5.1 + PyYAML>=6.0 PyERFA>=2.0.0 fast-histogram>=0.11 configobj>=5.0.6 - scikit-learn>=1.0 - IPython>=7.10.0 + scikit-learn>=1.2 + IPython>=8.0.0 ginga>=5.1.0 - linetools>=0.3.1 - qtpy>=2.0.1 + linetools>=0.3.2 + qtpy>=2.2.0 pygithub bottleneck - pyqt6<=6.7.0 + pyqt6 scripts = bin/pypeit_c_enabled bin/pypeit_chk_plugins @@ -69,7 +68,7 @@ specutils = specutils>=1.13 test = pygit2 - pytest>=6.0.0 + pytest>=7.0.0 pytest-astropy tox pytest-cov @@ -84,12 +83,12 @@ devsuite = pytest-qt dev = # scikit-image - scikit-image + scikit-image>=0.23 # specutils specutils>=1.13 # test pygit2 - pytest>=6.0.0 + pytest>=7.0.0 pytest-astropy tox pytest-cov diff --git a/tox.ini b/tox.ini index 55bbe46e07..c8b7d51210 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,12 @@ [tox] envlist = - {3.10,3.11,3.12}-test{,-alldeps,-shapely,-specutils}{,-cov} - {3.10,3.11,3.12}-test-numpy{123,124,125,126} - {3.10,3.11,3.12}-test-{numpy,astropy,linetools,ginga}dev + {3.11,3.12}-test{,-alldeps,-shapely,-specutils}{,-cov} + {3.11,3.12}-test-numpy{124,125,126,200,201} + {3.11,3.12}-test-{numpy,astropy,linetools,ginga}dev codestyle requires = - setuptools >= 30.3.0 - pip >= 19.3.1 + setuptools >= 65.0 + pip >= 22.0 isolated_build = true [testenv] @@ -36,19 +36,21 @@ description = devdeps: with the latest developer version of key dependencies oldestdeps: with the oldest supported version of key dependencies cov: and test coverage - numpy123: with numpy 1.23.* numpy124: with numpy 1.24.* numpy125: with numpy 1.25.* numpy126: with numpy 1.26.* + numpy200: with numpy 2.0.* + numpy201: with numpy 2.1.* # The following provides some specific pinnings for key packages deps = cov: coverage - numpy123: numpy==1.23.* numpy124: numpy==1.24.* numpy125: numpy==1.25.* numpy126: numpy==1.26.* + numpy200: numpy==2.0.* + numpy201: numpy==2.1.* numpydev: numpy>=0.0.dev0 astropydev: git+https://github.com/astropy/astropy.git#egg=astropy