diff --git a/doc/api/pypeit.scripts.extract_datacube.rst b/doc/api/pypeit.scripts.extract_datacube.rst new file mode 100644 index 0000000000..49f3a9d13e --- /dev/null +++ b/doc/api/pypeit.scripts.extract_datacube.rst @@ -0,0 +1,8 @@ +pypeit.scripts.extract\_datacube module +======================================= + +.. automodule:: pypeit.scripts.extract_datacube + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/pypeit.scripts.rst b/doc/api/pypeit.scripts.rst index 38fbcf5584..9709614544 100644 --- a/doc/api/pypeit.scripts.rst +++ b/doc/api/pypeit.scripts.rst @@ -26,6 +26,7 @@ Submodules pypeit.scripts.compare_sky pypeit.scripts.compile_wvarxiv pypeit.scripts.edge_inspector + pypeit.scripts.extract_datacube pypeit.scripts.flux_calib pypeit.scripts.flux_setup pypeit.scripts.identify diff --git a/doc/api/pypeit.spectrographs.aat_uhrf.rst b/doc/api/pypeit.spectrographs.aat_uhrf.rst new file mode 100644 index 0000000000..2f4e657404 --- /dev/null +++ b/doc/api/pypeit.spectrographs.aat_uhrf.rst @@ -0,0 +1,8 @@ +pypeit.spectrographs.aat\_uhrf module +===================================== + +.. automodule:: pypeit.spectrographs.aat_uhrf + :members: + :private-members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/pypeit.spectrographs.rst b/doc/api/pypeit.spectrographs.rst index c53968bcbb..239d591126 100644 --- a/doc/api/pypeit.spectrographs.rst +++ b/doc/api/pypeit.spectrographs.rst @@ -7,6 +7,7 @@ Submodules .. toctree:: :maxdepth: 4 + pypeit.spectrographs.aat_uhrf pypeit.spectrographs.bok_bc pypeit.spectrographs.gemini_flamingos pypeit.spectrographs.gemini_gmos diff --git a/doc/coadd3d.rst b/doc/coadd3d.rst index 5651dd0ee2..4e16390484 100644 --- a/doc/coadd3d.rst +++ b/doc/coadd3d.rst @@ -155,7 +155,7 @@ There are several recommended steps of the coadd3d process that can be run separ pypeit_sensfunc spec1d_StandardStarName.fits -o sens_StandardStarName.fits - For further details, see :doc:`_sensitivity_function`. + For further details, see :ref:`sensitivity_function`. #. Step 4 - Generate a datacube of the science exposures. This is done by running the following command: @@ -164,7 +164,7 @@ There are several recommended steps of the coadd3d process that can be run separ pypeit_coadd_datacube ScienceName.coadd3d -o Note that you will need to specify the sensitivity function file using the ``sensfile`` option in the - :doc:`coadd3d_file` file. For further details, see :ref:`coadd3d_fluxing`. + :ref:`coadd3d_file` file. For further details, see :ref:`coadd3d_fluxing`. Combination options =================== @@ -239,7 +239,7 @@ If you would like to flux calibrate your datacube, you need to produce your standard star datacube first. Then extract the spectrum of the standard star using the ``pypeit_extract_datacube`` script. This will produce a ``spec1d`` file that you will need to use to generate a -sensitivity function in the usual way (see :doc:`_sensitivity_function`). +sensitivity function in the usual way (see :ref:`sensitivity_function`). Then, when generating the datacube of the science frame you must include the name of the sensitivity function in your ``coadd3d`` file as follows: @@ -289,7 +289,7 @@ then you can specify the ``skysub_frame`` in the ``spec2d`` block of the above. If you have dedicated sky frames, then it is generally recommended to reduce these frames as if they are regular science frames, but add the following keyword arguments at the top of your -:doc:`coadd3d_file`: +:ref:`coadd3d_file`: .. code-block:: ini diff --git a/doc/cookbook.rst b/doc/cookbook.rst index 915aed4865..19b397281e 100644 --- a/doc/cookbook.rst +++ b/doc/cookbook.rst @@ -70,7 +70,8 @@ what we recommend: - We will refer to that folder as ``RAWDIR`` The raw images can be gzip-compressed, although this means opening files will be -slower. +slower. See :ref:`setup-file-searching` for specific comments about the files +in your raw directory. A word on calibration data -------------------------- diff --git a/doc/help/pypeit_cache_github_data.rst b/doc/help/pypeit_cache_github_data.rst index 804e0656f2..0c3b6990b5 100644 --- a/doc/help/pypeit_cache_github_data.rst +++ b/doc/help/pypeit_cache_github_data.rst @@ -9,7 +9,7 @@ Script to download/cache PypeIt github data positional arguments: - spectrograph A valid spectrograph identifier: bok_bc, + spectrograph A valid spectrograph identifier: aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v, gemini_gmos_north_ham, gemini_gmos_north_ham_ns, gemini_gmos_south_ham, diff --git a/doc/help/pypeit_chk_for_calibs.rst b/doc/help/pypeit_chk_for_calibs.rst index 06cc2d6357..653b5d1e81 100644 --- a/doc/help/pypeit_chk_for_calibs.rst +++ b/doc/help/pypeit_chk_for_calibs.rst @@ -13,7 +13,7 @@ options: -h, --help show this help message and exit -s SPECTROGRAPH, --spectrograph SPECTROGRAPH - A valid spectrograph identifier: bok_bc, + A valid spectrograph identifier: aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v, gemini_gmos_north_ham, gemini_gmos_north_ham_ns, gemini_gmos_south_ham, @@ -35,8 +35,11 @@ vlt_xshooter_nir, vlt_xshooter_uvb, vlt_xshooter_vis, wht_isis_blue, wht_isis_red (default: None) -e EXTENSION, --extension EXTENSION - File extension; compression indicators (e.g. .gz) not - required. (default: .fits) + File extension to use. Must include the period (e.g., + ".fits") and it must be one of the allowed extensions + for this spectrograph. If None, root directory will be + searched for all files with any of the allowed + extensions. (default: None) --save_setups If not toggled, remove setup_files/ folder and its files. (default: False) \ No newline at end of file diff --git a/doc/help/pypeit_extract_datacube.rst b/doc/help/pypeit_extract_datacube.rst new file mode 100644 index 0000000000..f4b16eab69 --- /dev/null +++ b/doc/help/pypeit_extract_datacube.rst @@ -0,0 +1,29 @@ +.. code-block:: console + + $ pypeit_extract_datacube -h + usage: pypeit_extract_datacube [-h] [-e EXT_FILE] [-s SAVE] [-o] + [-b BOXCAR_RADIUS] [-v VERBOSITY] + file + + Read in a datacube, extract a spectrum of a point source,and save it as a spec1d + file. + + positional arguments: + file spec3d.fits DataCube file + + options: + -h, --help show this help message and exit + -e EXT_FILE, --ext_file EXT_FILE + Configuration file with extraction parameters (default: + None) + -s SAVE, --save SAVE Output spec1d filename (default: None) + -o, --overwrite Overwrite any existing files/directories (default: + False) + -b BOXCAR_RADIUS, --boxcar_radius BOXCAR_RADIUS + Radius of the circular boxcar (in arcseconds) to use for + the extraction. (default: None) + -v VERBOSITY, --verbosity VERBOSITY + Verbosity level between 0 [none] and 2 [all]. Default: + 1. Level 2 writes a log with filename + extract_datacube_YYYYMMDD-HHMM.log (default: 1) + \ No newline at end of file diff --git a/doc/help/pypeit_obslog.rst b/doc/help/pypeit_obslog.rst index 3b4c807e8c..5b399fcee0 100644 --- a/doc/help/pypeit_obslog.rst +++ b/doc/help/pypeit_obslog.rst @@ -10,7 +10,7 @@ using PypeItMetaData. positional arguments: - spec A valid spectrograph identifier: bok_bc, + spec A valid spectrograph identifier: aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v, gemini_gmos_north_ham, gemini_gmos_north_ham_ns, gemini_gmos_south_ham, @@ -75,8 +75,11 @@ -s SORT, --sort SORT Metadata keyword (pypeit-specific) to use to sort the output table. (default: mjd) -e EXTENSION, --extension EXTENSION - File extension; compression indicators (e.g. .gz) not - required. (default: .fits) + File extension to use. Must include the period (e.g., + ".fits") and it must be one of the allowed extensions + for this spectrograph. If None, root directory will be + searched for all files with any of the allowed + extensions. (default: None) -d OUTPUT_PATH, --output_path OUTPUT_PATH Path to top-level output directory. (default: current working directory) diff --git a/doc/help/pypeit_ql.rst b/doc/help/pypeit_ql.rst index b8991c356d..9302bc39c0 100644 --- a/doc/help/pypeit_ql.rst +++ b/doc/help/pypeit_ql.rst @@ -17,7 +17,7 @@ Script to produce quick-look PypeIt reductions positional arguments: - spectrograph A valid spectrograph identifier: bok_bc, + spectrograph A valid spectrograph identifier: aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v, gemini_gmos_north_ham, gemini_gmos_north_ham_ns, gemini_gmos_south_ham, diff --git a/doc/help/pypeit_sensfunc.rst b/doc/help/pypeit_sensfunc.rst index 3a5b008e28..8eb7d65e05 100644 --- a/doc/help/pypeit_sensfunc.rst +++ b/doc/help/pypeit_sensfunc.rst @@ -62,11 +62,13 @@ -s SENS_FILE, --sens_file SENS_FILE Configuration file with sensitivity function parameters -f FLATFILE, --flatfile FLATFILE - Use the flat file for computing the sensitivity - function. Note that it is not possible to set - --flatfile and simultaneously use a .sens file with the - --sens_file option. If you are using a .sens file, set - the flatfile there via e.g.: + Use a flat calibration file to compute the blaze + function when generating the sensitivity function. This + is helpful to account for small scale undulations in the + sensitivity function. Note that it is not possible to + set --flatfile and simultaneously use a .sens file with + the --sens_file option. If you are using a .sens file, + set the flatfile there via e.g.: [sensfunc] flatfile = Calibrations/Flat_A_0_DET01.fits diff --git a/doc/help/pypeit_setup.rst b/doc/help/pypeit_setup.rst index 32f4da9915..01e0c078dd 100644 --- a/doc/help/pypeit_setup.rst +++ b/doc/help/pypeit_setup.rst @@ -11,7 +11,7 @@ options: -h, --help show this help message and exit -s SPECTROGRAPH, --spectrograph SPECTROGRAPH - A valid spectrograph identifier: bok_bc, + A valid spectrograph identifier: aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v, gemini_gmos_north_ham, gemini_gmos_north_ham_ns, gemini_gmos_south_ham, @@ -39,8 +39,11 @@ --extension option to set the types of files to search for. (default: current working directory) -e EXTENSION, --extension EXTENSION - File extension; compression indicators (e.g. .gz) not - required. (default: .fits) + File extension to use. Must include the period (e.g., + ".fits") and it must be one of the allowed extensions + for this spectrograph. If None, root directory will be + searched for all files with any of the allowed + extensions. (default: None) -d OUTPUT_PATH, --output_path OUTPUT_PATH Path to top-level output directory. (default: current working directory) diff --git a/doc/help/pypeit_trace_edges.rst b/doc/help/pypeit_trace_edges.rst index dc265db21b..a9b5e21814 100644 --- a/doc/help/pypeit_trace_edges.rst +++ b/doc/help/pypeit_trace_edges.rst @@ -26,16 +26,16 @@ default mosaic. (default: None) -s SPECTROGRAPH, --spectrograph SPECTROGRAPH A valid spectrograph identifier, which is only used if - providing files directly: bok_bc, gemini_flamingos1, - gemini_flamingos2, gemini_gmos_north_e2v, - gemini_gmos_north_ham, gemini_gmos_north_ham_ns, - gemini_gmos_south_ham, gemini_gnirs_echelle, - gemini_gnirs_ifu, gtc_maat, gtc_osiris, gtc_osiris_plus, - jwst_nircam, jwst_nirspec, keck_deimos, keck_esi, - keck_hires, keck_kcrm, keck_kcwi, keck_lris_blue, - keck_lris_blue_orig, keck_lris_red, keck_lris_red_mark4, - keck_lris_red_orig, keck_mosfire, keck_nires, - keck_nirspec_high, keck_nirspec_high_old, + providing files directly: aat_uhrf, bok_bc, + gemini_flamingos1, gemini_flamingos2, + gemini_gmos_north_e2v, gemini_gmos_north_ham, + gemini_gmos_north_ham_ns, gemini_gmos_south_ham, + gemini_gnirs_echelle, gemini_gnirs_ifu, gtc_maat, + gtc_osiris, gtc_osiris_plus, jwst_nircam, jwst_nirspec, + keck_deimos, keck_esi, keck_hires, keck_kcrm, keck_kcwi, + keck_lris_blue, keck_lris_blue_orig, keck_lris_red, + keck_lris_red_mark4, keck_lris_red_orig, keck_mosfire, + keck_nires, keck_nirspec_high, keck_nirspec_high_old, keck_nirspec_low, lbt_luci1, lbt_luci2, lbt_mods1b, lbt_mods1r, lbt_mods2b, lbt_mods2r, ldt_deveny, magellan_fire, magellan_fire_long, magellan_mage, diff --git a/doc/help/pypeit_view_fits.rst b/doc/help/pypeit_view_fits.rst index fb6bbd14e2..4ee223de61 100644 --- a/doc/help/pypeit_view_fits.rst +++ b/doc/help/pypeit_view_fits.rst @@ -9,7 +9,7 @@ View FITS files with ginga positional arguments: - spectrograph A valid spectrograph identifier: bok_bc, + spectrograph A valid spectrograph identifier: aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v, gemini_gmos_north_ham, gemini_gmos_north_ham_ns, gemini_gmos_south_ham, diff --git a/doc/help/run_pypeit.rst b/doc/help/run_pypeit.rst index 2870d8a61a..62402415ec 100644 --- a/doc/help/run_pypeit.rst +++ b/doc/help/run_pypeit.rst @@ -7,11 +7,11 @@ ## PypeIt : The Python Spectroscopic Data Reduction Pipeline v1.16.1.dev109+g885cb1823 ## ## Available spectrographs include: - ## bok_bc, gemini_flamingos1, gemini_flamingos2, gemini_gmos_north_e2v, - ## gemini_gmos_north_ham, gemini_gmos_north_ham_ns, - ## gemini_gmos_south_ham, gemini_gnirs_echelle, gemini_gnirs_ifu, - ## gtc_maat, gtc_osiris, gtc_osiris_plus, jwst_nircam, jwst_nirspec, - ## keck_deimos, keck_esi, keck_hires, keck_kcrm, keck_kcwi, + ## aat_uhrf, bok_bc, gemini_flamingos1, gemini_flamingos2, + ## gemini_gmos_north_e2v, gemini_gmos_north_ham, + ## gemini_gmos_north_ham_ns, gemini_gmos_south_ham, gemini_gnirs_echelle, + ## gemini_gnirs_ifu, gtc_maat, gtc_osiris, gtc_osiris_plus, jwst_nircam, + ## jwst_nirspec, keck_deimos, keck_esi, keck_hires, keck_kcrm, keck_kcwi, ## keck_lris_blue, keck_lris_blue_orig, keck_lris_red, ## keck_lris_red_mark4, keck_lris_red_orig, keck_mosfire, keck_nires, ## keck_nirspec_high, keck_nirspec_high_old, keck_nirspec_low, lbt_luci1, diff --git a/doc/include/class_datamodel_pypeitimage.rst b/doc/include/class_datamodel_pypeitimage.rst index 1f21b5588b..9008ab7bc3 100644 --- a/doc/include/class_datamodel_pypeitimage.rst +++ b/doc/include/class_datamodel_pypeitimage.rst @@ -10,6 +10,7 @@ Attribute Type ``det_img`` `numpy.ndarray`_ `numpy.integer`_ If a detector mosaic, this image provides the detector that contributed to each pixel. ``detector`` :class:`~pypeit.images.detector_container.DetectorContainer`, :class:`~pypeit.images.mosaic.Mosaic` The detector (see :class:`~pypeit.images.detector_container.DetectorContainer`) or mosaic (see :class:`~pypeit.images.mosaic.Mosaic`) parameters ``exptime`` int, float Effective exposure time (s) +``filename`` str Filename for the image ``fullmask`` :class:`~pypeit.images.imagebitmask.ImageBitMaskArray` Image mask ``image`` `numpy.ndarray`_ `numpy.floating`_ Primary image data ``img_scale`` `numpy.ndarray`_ `numpy.floating`_ Image count scaling applied (e.g., 1/flat-field) diff --git a/doc/include/inst_detector_table.rst b/doc/include/inst_detector_table.rst index cbb0df365a..d30393c4f2 100644 --- a/doc/include/inst_detector_table.rst +++ b/doc/include/inst_detector_table.rst @@ -1,6 +1,7 @@ ============================ === ======== ======== ======== ======== ========================== ====================== ======== ======== ============ ========= ========== Instrument Det specaxis specflip spatflip namp gain RN darkcurr min sat nonlinear platescale ============================ === ======== ======== ======== ======== ========================== ====================== ======== ======== ============ ========= ========== +``aat_uhrf`` 1 0 False False 1 1.0 0.0 0.0 -1.0e+10 65535.0 0.7600 0.0500 ``bok_bc`` 1 1 False False 1 1.5 3.0 5.4 -1.0e+10 65535.0 1.0000 0.2000 ``gemini_flamingos1`` 1 0 False False 1 3.8 6.0 1080.0 -1.0e+10 320000.0 0.8750 0.1500 ``gemini_flamingos2`` 1 0 True False 1 4.44 5.0 1800.0 -1.0e+10 700000.0 1.0000 0.1787 diff --git a/doc/include/keck_deimos.sorted.rst b/doc/include/keck_deimos.sorted.rst index 4e41db2257..828519122f 100644 --- a/doc/include/keck_deimos.sorted.rst +++ b/doc/include/keck_deimos.sorted.rst @@ -12,17 +12,17 @@ filename | frametype | ra | dec | target | dispname | decker | binning | mjd | airmass | exptime | dispangle | amp | filter1 | lampstat01 | dateobs | utc | frameno | calib DE.20170527.06713.fits | arc,tilt | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.077631 | 1.41291034 | 1.0 | 8099.98291016 | SINGLE:B | OG550 | Kr Xe Ar Ne | 2017-05-27 | 01:51:53.87 | 30 | 0 d0527_0030.fits.gz | arc,tilt | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.077631 | 1.41291034 | 1.0 | 8099.98291016 | SINGLE:B | OG550 | Kr Xe Ar Ne | 2017-05-27 | 01:51:53.87 | 30 | 0 - DE.20170527.06790.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.07851 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:53:10.93 | 31 | 0 d0527_0031.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.07851 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:53:10.93 | 31 | 0 - d0527_0032.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.079356 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:54:24.03 | 32 | 0 + DE.20170527.06790.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.07851 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:53:10.93 | 31 | 0 DE.20170527.06864.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.079356 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:54:24.03 | 32 | 0 - DE.20170527.06936.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.080211 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:55:36.93 | 33 | 0 + d0527_0032.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.079356 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:54:24.03 | 32 | 0 d0527_0033.fits.gz | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.080211 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:55:36.93 | 33 | 0 + DE.20170527.06936.fits | pixelflat,illumflat,trace | 57.99999999999999 | 45.0 | DOME PHLAT | 830G | LongMirr | 1,1 | 57900.080211 | 1.41291034 | 4.0 | 8099.98291016 | SINGLE:B | OG550 | Qz | 2017-05-27 | 01:55:36.93 | 33 | 0 DE.20170527.37601.fits | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.435131 | 1.03078874 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:26:41.61 | 80 | 0 - DE.20170527.38872.fits | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.449842 | 1.01267696 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:47:52.92 | 81 | 0 d0527_0081.fits.gz | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.449842 | 1.01267696 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:47:52.92 | 81 | 0 - d0527_0083.fits.gz | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.483427 | 1.00093023 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:36:15.35 | 83 | 0 + DE.20170527.38872.fits | science | 261.0363749999999 | 19.028166666666667 | P261_OFF | 830G | LongMirr | 1,1 | 57900.449842 | 1.01267696 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 10:47:52.92 | 81 | 0 DE.20170527.41775.fits | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.483427 | 1.00093023 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:36:15.35 | 83 | 0 + d0527_0083.fits.gz | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.483427 | 1.00093023 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:36:15.35 | 83 | 0 DE.20170527.43045.fits | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.498135 | 1.00838805 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 11:57:25.35 | 84 | 0 DE.20170527.44316.fits | science | 261.0362916666666 | 19.028888888888886 | P261_OFF | 830G | LongMirr | 1,1 | 57900.512854 | 1.02377681 | 1200.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 12:18:36.71 | 85 | 0 DE.20170527.53184.fits | science | 349.99316666666664 | -5.16575 | Feige 110 | 830G | LongMirr | 1,1 | 57900.615484 | 1.42505162 | 45.0 | 8099.98291016 | SINGLE:B | OG550 | Off | 2017-05-27 | 14:46:24.88 | 93 | 0 diff --git a/doc/include/spectrographs_table.rst b/doc/include/spectrographs_table.rst index 1244f6e8e8..5af65a3f2b 100644 --- a/doc/include/spectrographs_table.rst +++ b/doc/include/spectrographs_table.rst @@ -1,6 +1,7 @@ ======================== ============================================================================ ========= ============ =============================================================================================================================== ========= ========= ========= =============================================================================================== ``PypeIt`` Name ``PypeIt`` Class Telescope Camera URL Pipeline Supported QL Tested Comments ======================== ============================================================================ ========= ============ =============================================================================================================================== ========= ========= ========= =============================================================================================== +aat_uhrf :class:`~pypeit.spectrographs.aat_uhrf.AATUHRFSpectrograph` AAT UHRF `Link `__ MultiSlit True False bok_bc :class:`~pypeit.spectrographs.bok_bc.BokBCSpectrograph` BOK BC `Link `__ MultiSlit True False Bok B&C spectrometer gemini_flamingos1 :class:`~pypeit.spectrographs.gemini_flamingos.GeminiFLAMINGOS1Spectrograph` GEMINI-S FLAMINGOS `Link `__ MultiSlit False False gemini_flamingos2 :class:`~pypeit.spectrographs.gemini_flamingos.GeminiFLAMINGOS2Spectrograph` GEMINI-S FLAMINGOS `Link `__ MultiSlit True False Flamingos-2 NIR spectrograph diff --git a/doc/pypeit_par.rst b/doc/pypeit_par.rst index d8a7b4a747..d8cc23ea2c 100644 --- a/doc/pypeit_par.rst +++ b/doc/pypeit_par.rst @@ -308,32 +308,33 @@ FlatFieldPar Keywords Class Instantiation: :class:`~pypeit.par.pypeitpar.FlatFieldPar` -========================== ================= ================================= =========== ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================ -Key Type Options Default Description -========================== ================= ================================= =========== ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================ -``fit_2d_det_response`` bool .. False Set this variable to True if you want to compute and account for the detector response in the flatfield image. Note that ``detector response`` refers to pixel sensitivity variations that primarily depend on (x,y) detector coordinates. In most cases, the default 2D bspline is sufficient to account for detector response (i.e. set this parameter to False). Note that this correction will _only_ be performed for the spectrographs that have a dedicated response correction implemented. Currently,this correction is only implemented for Keck+KCWI. -``illum_iter`` int .. 0 The number of rejection iterations to perform when constructing the slit-illumination profile. No rejection iterations are performed if 0. WARNING: Functionality still being tested. -``illum_rej`` int, float .. 5.0 The sigma threshold used in the rejection iterations used to refine the slit-illumination profile. Rejection iterations are only performed if ``illum_iter > 0``. -``method`` str ``bspline``, ``skip`` ``bspline`` Method used to flat field the data; use skip to skip flat-fielding. Options are: None, bspline, skip -``pixelflat_file`` str .. .. Filename of the image to use for pixel-level field flattening -``pixelflat_max_wave`` int, float .. .. All values of the normalized pixel flat are set to 1 for wavelengths above this value. -``pixelflat_min_wave`` int, float .. .. All values of the normalized pixel flat are set to 1 for wavelengths below this value. -``rej_sticky`` bool .. False Propagate the rejected pixels through the stages of the flat-field fitting (i.e, from the spectral fit, to the spatial fit, and finally to the 2D residual fit). If False, pixels rejected in each stage are included in each subsequent stage. -``saturated_slits`` str ``crash``, ``mask``, ``continue`` ``crash`` Behavior when a slit is encountered with a large fraction of saturated pixels in the flat-field. The options are: 'crash' - Raise an error and halt the data reduction; 'mask' - Mask the slit, meaning no science data will be extracted from the slit; 'continue' - ignore the flat-field correction, but continue with the reduction. -``slit_illum_finecorr`` bool .. True If True, a fine correction to the spatial illumination profile will be performed. The fine correction is a low order 2D polynomial fit to account for a gradual change to the spatial illumination profile as a function of wavelength. -``slit_illum_pad`` int, float .. 5.0 The number of pixels to pad the slit edges when constructing the slit-illumination profile. Single value applied to both edges. -``slit_illum_ref_idx`` int .. 0 The index of a reference slit (0-indexed) used for estimating the relative spectral sensitivity (or the relative blaze). This parameter is only used if ``slit_illum_relative = True``. -``slit_illum_relative`` bool .. False Generate an image of the relative spectral illumination for a multi-slit setup. If you set ``use_specillum = True`` for any of the frames that use the flatfield model, this *must* be set to True. Currently, this is only used for SlicerIFU reductions. -``slit_illum_smooth_npix`` int .. 10 The number of pixels used to determine smoothly varying relative weights is given by ``nspec/slit_illum_smooth_npix``, where nspec is the number of spectral pixels. -``slit_trim`` int, float, tuple .. 3.0 The number of pixels to trim each side of the slit when selecting pixels to use for fitting the spectral response function. Single values are used for both slit edges; a two-tuple can be used to trim the left and right sides differently. -``spat_samp`` int, float .. 5.0 Spatial sampling for slit illumination function. This is the width of the median filter in pixels used to determine the slit illumination function, and thus sets the minimum scale on which the illumination function will have features. -``spec_samp_coarse`` int, float .. 50.0 bspline break point spacing in units of pixels for 2-d bspline-polynomial fit to flat field image residuals. This should be a large number unless you are trying to fit a sky flat with lots of narrow spectral features. -``spec_samp_fine`` int, float .. 1.2 bspline break point spacing in units of pixels for spectral fit to flat field blaze function. -``tweak_slits`` bool .. True Use the illumination flat field to tweak the slit edges. This will work even if illumflatten is set to False -``tweak_slits_maxfrac`` float .. 0.1 If tweak_slit is True, this sets the maximum fractional amount (of a slits width) allowed for trimming each (i.e. left and right) slit boundary, i.e. the default is 10% which means slits would shrink or grow by at most 20% (10% on each side) -``tweak_slits_thresh`` float .. 0.93 If tweak_slits is True, this sets the illumination function threshold used to tweak the slit boundaries based on the illumination flat. It should be a number less than 1.0 -``twod_fit_npoly`` int .. .. Order of polynomial used in the 2D bspline-polynomial fit to flat-field image residuals. The code determines the order of these polynomials to each slit automatically depending on the slit width, which is why the default is None. Alter this paramter at your own risk! -========================== ================= ================================= =========== ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================ +========================== ================= ================================= ============= ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================ +Key Type Options Default Description +========================== ================= ================================= ============= ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================ +``fit_2d_det_response`` bool .. False Set this variable to True if you want to compute and account for the detector response in the flatfield image. Note that ``detector response`` refers to pixel sensitivity variations that primarily depend on (x,y) detector coordinates. In most cases, the default 2D bspline is sufficient to account for detector response (i.e. set this parameter to False). Note that this correction will _only_ be performed for the spectrographs that have a dedicated response correction implemented. Currently,this correction is only implemented for Keck+KCWI. +``illum_iter`` int .. 0 The number of rejection iterations to perform when constructing the slit-illumination profile. No rejection iterations are performed if 0. WARNING: Functionality still being tested. +``illum_rej`` int, float .. 5.0 The sigma threshold used in the rejection iterations used to refine the slit-illumination profile. Rejection iterations are only performed if ``illum_iter > 0``. +``method`` str ``bspline``, ``skip`` ``bspline`` Method used to flat field the data; use skip to skip flat-fielding. Options are: None, bspline, skip +``pixelflat_file`` str .. .. Filename of the image to use for pixel-level field flattening +``pixelflat_max_wave`` int, float .. .. All values of the normalized pixel flat are set to 1 for wavelengths above this value. +``pixelflat_min_wave`` int, float .. .. All values of the normalized pixel flat are set to 1 for wavelengths below this value. +``rej_sticky`` bool .. False Propagate the rejected pixels through the stages of the flat-field fitting (i.e, from the spectral fit, to the spatial fit, and finally to the 2D residual fit). If False, pixels rejected in each stage are included in each subsequent stage. +``saturated_slits`` str ``crash``, ``mask``, ``continue`` ``crash`` Behavior when a slit is encountered with a large fraction of saturated pixels in the flat-field. The options are: 'crash' - Raise an error and halt the data reduction; 'mask' - Mask the slit, meaning no science data will be extracted from the slit; 'continue' - ignore the flat-field correction, but continue with the reduction. +``slit_illum_finecorr`` bool .. True If True, a fine correction to the spatial illumination profile will be performed. The fine correction is a low order 2D polynomial fit to account for a gradual change to the spatial illumination profile as a function of wavelength. +``slit_illum_pad`` int, float .. 5.0 The number of pixels to pad the slit edges when constructing the slit-illumination profile. Single value applied to both edges. +``slit_illum_ref_idx`` int .. 0 The index of a reference slit (0-indexed) used for estimating the relative spectral sensitivity (or the relative blaze). This parameter is only used if ``slit_illum_relative = True``. +``slit_illum_relative`` bool .. False Generate an image of the relative spectral illumination for a multi-slit setup. If you set ``use_specillum = True`` for any of the frames that use the flatfield model, this *must* be set to True. Currently, this is only used for SlicerIFU reductions. +``slit_illum_smooth_npix`` int .. 10 The number of pixels used to determine smoothly varying relative weights is given by ``nspec/slit_illum_smooth_npix``, where nspec is the number of spectral pixels. +``slit_trim`` int, float, tuple .. 3.0 The number of pixels to trim each side of the slit when selecting pixels to use for fitting the spectral response function. Single values are used for both slit edges; a two-tuple can be used to trim the left and right sides differently. +``spat_samp`` int, float .. 5.0 Spatial sampling for slit illumination function. This is the width of the median filter in pixels used to determine the slit illumination function, and thus sets the minimum scale on which the illumination function will have features. +``spec_samp_coarse`` int, float .. 50.0 bspline break point spacing in units of pixels for 2-d bspline-polynomial fit to flat field image residuals. This should be a large number unless you are trying to fit a sky flat with lots of narrow spectral features. +``spec_samp_fine`` int, float .. 1.2 bspline break point spacing in units of pixels for spectral fit to flat field blaze function. +``tweak_method`` str ``threshold``, ``gradient`` ``threshold`` Method used to tweak the slit edges (when "tweak_slits" is set to True). Options include: threshold, gradient. The "threshold" method determines when the left and right slit edges fall below a threshold relative to the peak illumination. The "gradient" method determines where the gradient is the highest at the left and right slit edges. This method performs better when there is systematic vignetting in the spatial direction. +``tweak_slits`` bool .. True Use the illumination flat field to tweak the slit edges. This will work even if illumflatten is set to False +``tweak_slits_maxfrac`` float .. 0.1 If tweak_slit is True, this sets the maximum fractional amount (of a slits width) allowed for trimming each (i.e. left and right) slit boundary, i.e. the default is 10% which means slits would shrink or grow by at most 20% (10% on each side) +``tweak_slits_thresh`` float .. 0.93 If tweak_slits is True, this sets the illumination function threshold used to tweak the slit boundaries based on the illumination flat. It should be a number less than 1.0 +``twod_fit_npoly`` int .. .. Order of polynomial used in the 2D bspline-polynomial fit to flat-field image residuals. The code determines the order of these polynomials to each slit automatically depending on the slit width, which is why the default is None. Alter this paramter at your own risk! +========================== ================= ================================= ============= ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================ ---- @@ -582,21 +583,21 @@ Collate1DPar Keywords Class Instantiation: :class:`~pypeit.par.pypeitpar.Collate1DPar` -========================= =============== ======= =============================== ================================================================================================================================================================================================================================================================================================================================================================================================================== -Key Type Options Default Description -========================= =============== ======= =============================== ================================================================================================================================================================================================================================================================================================================================================================================================================== -``dry_run`` bool .. False If set, the script will display the matching File and Object Ids but will not flux, coadd or archive. -``exclude_serendip`` bool .. False Whether to exclude SERENDIP objects from collating. -``exclude_slit_trace_bm`` list, str .. A list of slit trace bitmask bits that should be excluded. -``flux`` bool .. False If set, the script will flux calibrate using archived sensfuncs before coadding. -``ignore_flux`` bool .. False If set, the script will only coadd non-fluxed spectra even if flux data is present. Otherwise fluxed spectra are coadded if all spec1ds have been fluxed calibrated. -``match_using`` str .. ``ra/dec`` Determines how 1D spectra are matched as being the same object. Must be either 'pixel' or 'ra/dec'. -``outdir`` str .. ``/home/dusty/work/PypeIt/doc`` The path where all coadded output files and report files will be placed. -``refframe`` str .. .. Perform reference frame correction prior to coadding. Options are: observed, heliocentric, barycentric -``spec1d_outdir`` str .. .. The path where all modified spec1d files are placed. These are only created if flux calibration or refframe correction are asked for. -``tolerance`` str, float, int .. 1.0 The tolerance used when comparing the coordinates of objects. If two objects are within this distance from each other, they are considered the same object. If match_using is 'ra/dec' (the default) this is an angular distance. The defaults units are arcseconds but other units supported by astropy.coordinates.Angle can be used (`e.g.`, '0.003d' or '0h1m30s'). If match_using is 'pixel' this is a float. -``wv_rms_thresh`` float .. .. If set, any objects with a wavelength RMS > this value are skipped, else all wavelength RMS values are accepted. -========================= =============== ======= =============================== ================================================================================================================================================================================================================================================================================================================================================================================================================== +========================= =============== ======= ============================================ ================================================================================================================================================================================================================================================================================================================================================================================================================== +Key Type Options Default Description +========================= =============== ======= ============================================ ================================================================================================================================================================================================================================================================================================================================================================================================================== +``dry_run`` bool .. False If set, the script will display the matching File and Object Ids but will not flux, coadd or archive. +``exclude_serendip`` bool .. False Whether to exclude SERENDIP objects from collating. +``exclude_slit_trace_bm`` list, str .. A list of slit trace bitmask bits that should be excluded. +``flux`` bool .. False If set, the script will flux calibrate using archived sensfuncs before coadding. +``ignore_flux`` bool .. False If set, the script will only coadd non-fluxed spectra even if flux data is present. Otherwise fluxed spectra are coadded if all spec1ds have been fluxed calibrated. +``match_using`` str .. ``ra/dec`` Determines how 1D spectra are matched as being the same object. Must be either 'pixel' or 'ra/dec'. +``outdir`` str .. ``/Users/westfall/Work/packages/pypeit/doc`` The path where all coadded output files and report files will be placed. +``refframe`` str .. .. Perform reference frame correction prior to coadding. Options are: observed, heliocentric, barycentric +``spec1d_outdir`` str .. .. The path where all modified spec1d files are placed. These are only created if flux calibration or refframe correction are asked for. +``tolerance`` str, float, int .. 1.0 The tolerance used when comparing the coordinates of objects. If two objects are within this distance from each other, they are considered the same object. If match_using is 'ra/dec' (the default) this is an angular distance. The defaults units are arcseconds but other units supported by astropy.coordinates.Angle can be used (`e.g.`, '0.003d' or '0h1m30s'). If match_using is 'pixel' this is a float. +``wv_rms_thresh`` float .. .. If set, any objects with a wavelength RMS > this value are skipped, else all wavelength RMS values are accepted. +========================= =============== ======= ============================================ ================================================================================================================================================================================================================================================================================================================================================================================================================== ---- @@ -617,7 +618,7 @@ Key Type Options ``multi_min_SN`` int, float .. 1 Minimum S/N for analyzing sky spectrum for flexure ``spec_maxshift`` int .. 20 Maximum allowed spectral flexure shift in pixels. ``spec_method`` str ``boxcar``, ``slitcen``, ``skip`` ``skip`` Method used to correct for flexure. Use skip for no correction. If slitcen is used, the flexure correction is performed before the extraction of objects (not recommended). Options are: None, boxcar, slitcen, skip -``spectrum`` str .. ``paranal_sky.fits`` Archive sky spectrum to be used for the flexure correction. +``spectrum`` str .. ``paranal_sky.fits`` Archive sky spectrum to be used for the flexure correction. See ``pypeit/data/sky_spec/`` for a list of available sky spectra. If ``model`` is used, a model sky spectrum will be generated using :func:`~pypeit.wavemodel.nearIR_modelsky` and the spectralresolution of the spectrum to be flexure corrected. =================== ========== ======================================================== ==================== ====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== @@ -649,22 +650,22 @@ ReduxPar Keywords Class Instantiation: :class:`~pypeit.par.pypeitpar.ReduxPar` -====================== ============== ======= =============================== ========================================================================================================================================================================================================================================================================================================================================================================================================== -Key Type Options Default Description -====================== ============== ======= =============================== ========================================================================================================================================================================================================================================================================================================================================================================================================== -``calwin`` int, float .. 0 The window of time in hours to search for calibration frames for a science frame -``chk_version`` bool .. True If True enforce strict PypeIt version checking to ensure that all files were created with the current version of PypeIt. If set to False, the code will attempt to read out-of-date files and keep going. Beware (!!) that this can lead to unforeseen bugs that either cause the code to crash or lead to erroneous results. I.e., you really need to know what you are doing if you set this to False! -``detnum`` int, list .. .. Restrict reduction to a list of detector indices. In case of mosaic reduction (currently only available for Gemini/GMOS and Keck/DEIMOS) ``detnum`` should be a list of tuples of the detector indices that are mosaiced together. E.g., for Gemini/GMOS ``detnum`` would be ``[(1,2,3)]`` and for Keck/DEIMOS it would be ``[(1, 5), (2, 6), (3, 7), (4, 8)]`` -``ignore_bad_headers`` bool .. False Ignore bad headers (NOT recommended unless you know it is safe). -``maskIDs`` str, int, list .. .. Restrict reduction to a set of slitmask IDs Example syntax -- ``maskIDs = 818006,818015`` This must be used with detnum (for now). -``qadir`` str .. ``QA`` Directory relative to calling directory to write quality assessment files. -``quicklook`` bool .. False Run a quick look reduction? This is usually good if you want to quickly reduce the data (usually at the telescope in real time) to get an initial estimate of the data quality. -``redux_path`` str .. ``/home/dusty/work/PypeIt/doc`` Path to folder for performing reductions. Default is the current working directory. -``scidir`` str .. ``Science`` Directory relative to calling directory to write science files. -``slitspatnum`` str, list .. .. Restrict reduction to a set of slit DET:SPAT values (closest slit is used). Example syntax -- slitspatnum = DET01:175,DET01:205 or MSC02:2234 If you are re-running the code, (i.e. modifying one slit) you *must* have the precise SPAT_ID index. -``sortroot`` str .. .. A filename given to output the details of the sorted files. If None, the default is the root name of the pypeit file. If off, no output is produced. -``spectrograph`` str .. .. Spectrograph that provided the data to be reduced. See :ref:`instruments` for valid options. -====================== ============== ======= =============================== ========================================================================================================================================================================================================================================================================================================================================================================================================== +====================== ============== ======= ============================================ ========================================================================================================================================================================================================================================================================================================================================================================================================== +Key Type Options Default Description +====================== ============== ======= ============================================ ========================================================================================================================================================================================================================================================================================================================================================================================================== +``calwin`` int, float .. 0 The window of time in hours to search for calibration frames for a science frame +``chk_version`` bool .. True If True enforce strict PypeIt version checking to ensure that all files were created with the current version of PypeIt. If set to False, the code will attempt to read out-of-date files and keep going. Beware (!!) that this can lead to unforeseen bugs that either cause the code to crash or lead to erroneous results. I.e., you really need to know what you are doing if you set this to False! +``detnum`` int, list .. .. Restrict reduction to a list of detector indices. In case of mosaic reduction (currently only available for Gemini/GMOS and Keck/DEIMOS) ``detnum`` should be a list of tuples of the detector indices that are mosaiced together. E.g., for Gemini/GMOS ``detnum`` would be ``[(1,2,3)]`` and for Keck/DEIMOS it would be ``[(1, 5), (2, 6), (3, 7), (4, 8)]`` +``ignore_bad_headers`` bool .. False Ignore bad headers (NOT recommended unless you know it is safe). +``maskIDs`` str, int, list .. .. Restrict reduction to a set of slitmask IDs Example syntax -- ``maskIDs = 818006,818015`` This must be used with detnum (for now). +``qadir`` str .. ``QA`` Directory relative to calling directory to write quality assessment files. +``quicklook`` bool .. False Run a quick look reduction? This is usually good if you want to quickly reduce the data (usually at the telescope in real time) to get an initial estimate of the data quality. +``redux_path`` str .. ``/Users/westfall/Work/packages/pypeit/doc`` Path to folder for performing reductions. Default is the current working directory. +``scidir`` str .. ``Science`` Directory relative to calling directory to write science files. +``slitspatnum`` str, list .. .. Restrict reduction to a set of slit DET:SPAT values (closest slit is used). Example syntax -- slitspatnum = DET01:175,DET01:205 or MSC02:2234 If you are re-running the code, (i.e. modifying one slit) you *must* have the precise SPAT_ID index. +``sortroot`` str .. .. A filename given to output the details of the sorted files. If None, the default is the root name of the pypeit file. If off, no output is produced. +``spectrograph`` str .. .. Spectrograph that provided the data to be reduced. See :ref:`instruments` for valid options. +====================== ============== ======= ============================================ ========================================================================================================================================================================================================================================================================================================================================================================================================== ---- @@ -706,7 +707,6 @@ Key Type Options ``correct_dar`` bool .. True If True, the data will be corrected for differential atmospheric refraction (DAR). ``dec_max`` float .. .. Maximum DEC to use when generating the WCS. If None, the default is maximum DEC based on the WCS of all spaxels. Units should be degrees. ``dec_min`` float .. .. Minimum DEC to use when generating the WCS. If None, the default is minimum DEC based on the WCS of all spaxels. Units should be degrees. -``grating_corr`` bool .. True This option performs a small correction for the relative blaze function of all input frames that have (even slightly) different grating angles, or if you are flux calibrating your science data with a standard star that was observed with a slightly different setup. ``method`` str ``subpixel``, ``ngp`` ``subpixel`` What method should be used to generate the datacube. There are currently two options: (1) "subpixel" (default) - this algorithm divides each pixel in the spec2d frames into subpixels, and assigns each subpixel to a voxel of the datacube. Flux is conserved, but voxels are correlated, and the error spectrum does not account for covariance between adjacent voxels. See also, spec_subpixel and spat_subpixel. (2) "ngp" (nearest grid point) - this algorithm is effectively a 3D histogram. Flux is conserved, voxels are not correlated, however this option suffers the same downsides as any histogram; the choice of bin sizes can change how the datacube appears. This algorithm takes each pixel on the spec2d frame and puts the flux of this pixel into one voxel in the datacube. Depending on the binning used, some voxels may be empty (zero flux) while a neighboring voxel might contain the flux from two spec2d pixels. Note that all spec2d pixels that contribute to the same voxel are inverse variance weighted (e.g. if two pixels have the same variance, the voxel would be assigned the average flux of the two pixels). ``output_filename`` str .. .. If combining multiple frames, this string sets the output filename of the combined datacube. If combine=False, the output filenames will be prefixed with ``spec3d_*`` ``ra_max`` float .. .. Maximum RA to use when generating the WCS. If None, the default is maximum RA based on the WCS of all spaxels. Units should be degrees. @@ -714,13 +714,13 @@ Key Type Options ``reference_image`` str .. .. White light image of a previously combined datacube. The white light image will be used as a reference when calculating the offsets of the input spec2d files. Ideally, the reference image should have the same shape as the data to be combined (i.e. set the ra_min, ra_max etc. params so they are identical to the reference image). ``save_whitelight`` bool .. False Save a white light image of the combined datacube. The output filename will be given by the "output_filename" variable with a suffix "_whitelight". Note that the white light image collapses the flux along the wavelength axis, so some spaxels in the 2D white light image may have different wavelength ranges. To set the wavelength range, use the "whitelight_range" parameter. If combine=False, the individual spec3d files will have a suffix "_whitelight". ``scale_corr`` str .. .. This option performs a small correction for the relative spectral illumination scale of different spec2D files. Specify the relative path+file to the spec2D file that you would like to use for the relative scaling. If you want to perform this correction, it is best to use the spec2d file with the highest S/N sky spectrum. You should choose the same frame for both the standards and science frames. +``sensfile`` str .. .. Filename of a sensitivity function to use to flux calibrate your datacube. The sensitivity function file will also be used to correct the relative scales of the slits. ``skysub_frame`` str .. ``image`` Set the sky subtraction to be implemented. The default behaviour is to subtract the sky using the model that is derived from each individual image (i.e. set this parameter to "image"). To turn off sky subtraction completely, set this parameter to "none" (all lowercase). Finally, if you want to use a different frame for the sky subtraction, specify the relative path+file to the spec2D file that you would like to use for the sky subtraction. The model fit to the sky of the specified frame will be used. Note, the sky and science frames do not need to have the same exposure time; the sky model will be scaled to the science frame based on the relative exposure time. ``slice_subpixel`` int .. 5 When method=subpixel, slice_subpixel sets the subpixellation scale of each IFU slice. The default option is to divide each slice into 5 sub-slices during datacube creation. See also, spec_subpixel and spat_subpixel. ``slit_spec`` bool .. True If the data use slits in one spatial direction, set this to True. If the data uses fibres for all spaxels, set this to False. ``spat_subpixel`` int .. 5 When method=subpixel, spat_subpixel sets the subpixellation scale of each detector pixel in the spatial direction. The total number of subpixels in each pixel is given by spec_subpixel x spat_subpixel. The default option is to divide each spec2d pixel into 25 subpixels during datacube creation. See also, spec_subpixel and slice_subpixel. ``spatial_delta`` float .. .. The spatial size of each spaxel to use when generating the WCS (in arcsec). If None, the default is set by the spectrograph file. ``spec_subpixel`` int .. 5 When method=subpixel, spec_subpixel sets the subpixellation scale of each detector pixel in the spectral direction. The total number of subpixels in each pixel is given by spec_subpixel x spat_subpixel. The default option is to divide each spec2d pixel into 25 subpixels during datacube creation. See also, spat_subpixel and slice_subpixel. -``standard_cube`` str .. .. Filename of a standard star datacube. This cube will be used to correct the relative scales of the slits, and to flux calibrate the science datacube. ``wave_delta`` float .. .. The wavelength step to use when generating the WCS (in Angstroms). If None, the default is set by the wavelength solution. ``wave_max`` float .. .. Maximum wavelength to use when generating the WCS. If None, the default is maximum wavelength based on the WCS of all spaxels. Units should be Angstroms. ``wave_min`` float .. .. Minimum wavelength to use when generating the WCS. If None, the default is minimum wavelength based on the WCS of all spaxels. Units should be Angstroms. @@ -864,43 +864,44 @@ ProcessImagesPar Keywords Class Instantiation: :class:`~pypeit.par.pypeitpar.ProcessImagesPar` -======================== ================================================ =================================================================== ============================= ============================================================================================================================================================================================================================================================================================================================================================ -Key Type Options Default Description -======================== ================================================ =================================================================== ============================= ============================================================================================================================================================================================================================================================================================================================================================ -``apply_gain`` bool .. True Convert the ADUs to electrons using the detector gain -``clip`` bool .. True Perform sigma clipping when combining. Only used with combine=mean -``comb_sigrej`` float .. .. Sigma-clipping level for when clip=True; Use None for automatic limit (recommended). -``combine`` str ``median``, ``mean`` ``mean`` Method used to combine multiple frames. Options are: median, mean -``dark_expscale`` bool .. False If designated dark frames are used and have a different exposure time than the science frames, scale the counts by the by the ratio in the exposure times to adjust the dark counts for the difference in exposure time. WARNING: You should always take dark frames that have the same exposure time as your science frames, so use this option with care! -``empirical_rn`` bool .. False If True, use the standard deviation in the overscan region to measure an empirical readnoise to use in the noise model. -``grow`` int, float .. 1.5 Factor by which to expand regions with cosmic rays detected by the LA cosmics routine. -``lamaxiter`` int .. 1 Maximum number of iterations for LA cosmics routine. -``mask_cr`` bool .. False Identify CRs and mask them -``n_lohi`` list .. 0, 0 Number of pixels to reject at the lowest and highest ends of the distribution; i.e., n_lohi = low, high. Use None for no limit. -``noise_floor`` float .. 0.0 Impose a noise floor by adding the provided fraction of the bias- and dark-subtracted electron counts to the error budget. E.g., a value of 0.01 means that the S/N of the counts in the image will never be greater than 100. -``objlim`` int, float .. 3.0 Object detection limit in LA cosmics routine -``orient`` bool .. True Orient the raw image into the PypeIt frame -``overscan_method`` str ``chebyshev``, ``polynomial``, ``savgol``, ``median``, ``odd_even`` ``savgol`` Method used to fit the overscan. Options are: chebyshev, polynomial, savgol, median, odd_even Note: Method "polynomial" is identical to "chebyshev"; the former is deprecated and will be removed. -``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 -``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 -``sigfrac`` int, float .. 0.3 Fraction for the lower clipping threshold in LA cosmics routine. -``spat_flexure_correct`` bool .. False Correct slits, illumination flat, etc. for flexure -``spat_flexure_maxlag`` int .. 20 Maximum of possible spatial flexure correction, in pixels -``subtract_continuum`` bool .. False Subtract off the continuum level from an image. This parameter should only be set to True to combine arcs with multiple different lamps. For all other cases, this parameter should probably be False. -``subtract_scattlight`` bool .. False Subtract off the scattered light from an image. This parameter should only be set to True for spectrographs that have dedicated methods to subtract scattered light. For all other cases, this parameter should be False. -``trim`` bool .. True Trim the image to the detector supplied region -``use_biasimage`` bool .. True Use a bias image. If True, one or more must be supplied in the PypeIt file. -``use_darkimage`` bool .. False Subtract off a dark image. If True, one or more darks must be provided. -``use_illumflat`` bool .. True Use the illumination flat to correct for the illumination profile of each slit. -``use_overscan`` bool .. True Subtract off the overscan. Detector *must* have one or code will crash. -``use_pattern`` bool .. False Subtract off a detector pattern. This pattern is assumed to be sinusoidal along one direction, with a frequency that is constant across the detector. -``use_pixelflat`` bool .. True Use the pixel flat to make pixel-level corrections. A pixelflat image must be provied. -``use_specillum`` bool .. False Use the relative spectral illumination profiles to correct the spectral illumination profile of each slit. This is primarily used for slicer IFUs. To use this, you must set ``slit_illum_relative=True`` in the ``flatfield`` parameter set! -======================== ================================================ =================================================================== ============================= ============================================================================================================================================================================================================================================================================================================================================================ +======================== ================================================ =================================================================== ============================= ======================================================================================================================================================================================================================================================================================================================================================================================== +Key Type Options Default Description +======================== ================================================ =================================================================== ============================= ======================================================================================================================================================================================================================================================================================================================================================================================== +``apply_gain`` bool .. True Convert the ADUs to electrons using the detector gain +``clip`` bool .. True Perform sigma clipping when combining. Only used with combine=mean +``comb_sigrej`` float .. .. Sigma-clipping level for when clip=True; Use None for automatic limit (recommended). +``combine`` str ``median``, ``mean`` ``mean`` Method used to combine multiple frames. Options are: median, mean +``correct_nonlinear`` list .. .. Correct for non-linear response of the detector. If None, no correction is performed. If a list, then the list should be the non-linear correction parameter (alpha), where the functional form is given by Ct = Cm (1 + alpha x Cm), with Ct and Cm the true and measured counts. This parameter is usually hard-coded for a given spectrograph, and should otherwise be left as None. +``dark_expscale`` bool .. False If designated dark frames are used and have a different exposure time than the science frames, scale the counts by the by the ratio in the exposure times to adjust the dark counts for the difference in exposure time. WARNING: You should always take dark frames that have the same exposure time as your science frames, so use this option with care! +``empirical_rn`` bool .. False If True, use the standard deviation in the overscan region to measure an empirical readnoise to use in the noise model. +``grow`` int, float .. 1.5 Factor by which to expand regions with cosmic rays detected by the LA cosmics routine. +``lamaxiter`` int .. 1 Maximum number of iterations for LA cosmics routine. +``mask_cr`` bool .. False Identify CRs and mask them +``n_lohi`` list .. 0, 0 Number of pixels to reject at the lowest and highest ends of the distribution; i.e., n_lohi = low, high. Use None for no limit. +``noise_floor`` float .. 0.0 Impose a noise floor by adding the provided fraction of the bias- and dark-subtracted electron counts to the error budget. E.g., a value of 0.01 means that the S/N of the counts in the image will never be greater than 100. +``objlim`` int, float .. 3.0 Object detection limit in LA cosmics routine +``orient`` bool .. True Orient the raw image into the PypeIt frame +``overscan_method`` str ``chebyshev``, ``polynomial``, ``savgol``, ``median``, ``odd_even`` ``savgol`` Method used to fit the overscan. Options are: chebyshev, polynomial, savgol, median, odd_even Note: Method "polynomial" is identical to "chebyshev"; the former is deprecated and will be removed. +``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 +``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 +``sigfrac`` int, float .. 0.3 Fraction for the lower clipping threshold in LA cosmics routine. +``spat_flexure_correct`` bool .. False Correct slits, illumination flat, etc. for flexure +``spat_flexure_maxlag`` int .. 20 Maximum of possible spatial flexure correction, in pixels +``subtract_continuum`` bool .. False Subtract off the continuum level from an image. This parameter should only be set to True to combine arcs with multiple different lamps. For all other cases, this parameter should probably be False. +``subtract_scattlight`` bool .. False Subtract off the scattered light from an image. This parameter should only be set to True for spectrographs that have dedicated methods to subtract scattered light. For all other cases, this parameter should be False. +``trim`` bool .. True Trim the image to the detector supplied region +``use_biasimage`` bool .. True Use a bias image. If True, one or more must be supplied in the PypeIt file. +``use_darkimage`` bool .. False Subtract off a dark image. If True, one or more darks must be provided. +``use_illumflat`` bool .. True Use the illumination flat to correct for the illumination profile of each slit. +``use_overscan`` bool .. True Subtract off the overscan. Detector *must* have one or code will crash. +``use_pattern`` bool .. False Subtract off a detector pattern. This pattern is assumed to be sinusoidal along one direction, with a frequency that is constant across the detector. +``use_pixelflat`` bool .. True Use the pixel flat to make pixel-level corrections. A pixelflat image must be provied. +``use_specillum`` bool .. False Use the relative spectral illumination profiles to correct the spectral illumination profile of each slit. This is primarily used for slicer IFUs. To use this, you must set ``slit_illum_relative=True`` in the ``flatfield`` parameter set! +======================== ================================================ =================================================================== ============================= ======================================================================================================================================================================================================================================================================================================================================================================================== ---- @@ -1047,6 +1048,98 @@ these in the PypeIt file, you would be reproducing the effect of the `default_pypeit_par` method specific to each derived :class:`~pypeit.spectrographs.spectrograph.Spectrograph` class. +.. _instr_par-aat_uhrf: + +AAT UHRF (``aat_uhrf``) +----------------------- +Alterations to the default parameters are: + +.. code-block:: ini + + [rdx] + spectrograph = aat_uhrf + [calibrations] + [[biasframe]] + [[[process]]] + combine = median + use_biasimage = False + shot_noise = False + use_pixelflat = False + use_illumflat = False + [[darkframe]] + [[[process]]] + mask_cr = True + use_pixelflat = False + use_illumflat = False + [[arcframe]] + exprng = None, 60.0, + [[[process]]] + use_pixelflat = False + use_illumflat = False + [[tiltframe]] + exprng = None, 60.0, + [[[process]]] + use_pixelflat = False + use_illumflat = False + [[pixelflatframe]] + [[[process]]] + satpix = nothing + use_pixelflat = False + use_illumflat = False + [[alignframe]] + [[[process]]] + satpix = nothing + use_pixelflat = False + use_illumflat = False + [[traceframe]] + exprng = None, 60.0, + [[[process]]] + use_pixelflat = False + use_illumflat = False + [[illumflatframe]] + [[[process]]] + satpix = nothing + use_pixelflat = False + use_illumflat = False + [[lampoffflatsframe]] + [[[process]]] + satpix = nothing + use_pixelflat = False + use_illumflat = False + [[scattlightframe]] + [[[process]]] + satpix = nothing + use_pixelflat = False + use_illumflat = False + [[skyframe]] + [[[process]]] + mask_cr = True + noise_floor = 0.01 + [[standardframe]] + [[[process]]] + mask_cr = True + noise_floor = 0.01 + [[wavelengths]] + lamps = ThAr, + n_final = 3 + [[slitedges]] + sync_predict = nearest + bound_detector = True + [[tilts]] + spat_order = 4 + spec_order = 1 + [scienceframe] + exprng = 61, None, + [[process]] + mask_cr = True + sigclip = 10.0 + noise_floor = 0.01 + [reduce] + [[skysub]] + bspline_spacing = 3.0 + no_poly = True + user_regions = :10,75: + .. _instr_par-bok_bc: BOK BC (``bok_bc``) @@ -2031,12 +2124,11 @@ Alterations to the default parameters are: noise_floor = 0.01 use_illumflat = False [[flatfield]] + tweak_method = gradient tweak_slits_thresh = 0.0 tweak_slits_maxfrac = 0.0 slit_trim = 2 slit_illum_finecorr = False - [[slitedges]] - pad = 2 [[tilts]] spat_order = 1 spec_order = 1 @@ -2061,8 +2153,6 @@ Alterations to the default parameters are: [[extraction]] model_full_slit = True skip_extraction = True - [[cube]] - grating_corr = False [flexure] spec_maxshift = 0 [sensfunc] @@ -2152,6 +2242,9 @@ Alterations to the default parameters are: mask_cr = True noise_floor = 0.01 [[flatfield]] + tweak_method = gradient + tweak_slits_thresh = 0.0 + tweak_slits_maxfrac = 0.0 slit_illum_finecorr = False [[wavelengths]] method = full_template @@ -3023,18 +3116,16 @@ Alterations to the default parameters are: noise_floor = 0.01 [[flatfield]] spec_samp_coarse = 20.0 + tweak_method = gradient tweak_slits_thresh = 0.0 tweak_slits_maxfrac = 0.0 slit_illum_relative = True slit_illum_ref_idx = 14 - slit_illum_smooth_npix = 5 - fit_2d_det_response = True [[wavelengths]] fwhm_spat_order = 2 [[slitedges]] edge_thresh = 5 fit_order = 4 - pad = 2 [scienceframe] [[process]] mask_cr = True @@ -3085,16 +3176,18 @@ Alterations to the default parameters are: use_pattern = True [[arcframe]] [[[process]]] + correct_nonlinear = -1.4e-07, -1.4e-07, -1.2e-07, -1.8e-07, use_pixelflat = False use_illumflat = False [[tiltframe]] [[[process]]] + correct_nonlinear = -1.4e-07, -1.4e-07, -1.2e-07, -1.8e-07, use_pixelflat = False use_illumflat = False [[pixelflatframe]] [[[process]]] - combine = median satpix = nothing + correct_nonlinear = -1.4e-07, -1.4e-07, -1.2e-07, -1.8e-07, use_pixelflat = False use_illumflat = False subtract_scattlight = True @@ -3112,6 +3205,7 @@ Alterations to the default parameters are: [[illumflatframe]] [[[process]]] satpix = nothing + correct_nonlinear = -1.4e-07, -1.4e-07, -1.2e-07, -1.8e-07, use_illumflat = False use_pattern = True subtract_scattlight = True @@ -3132,32 +3226,32 @@ Alterations to the default parameters are: [[standardframe]] [[[process]]] mask_cr = True + correct_nonlinear = -1.4e-07, -1.4e-07, -1.2e-07, -1.8e-07, noise_floor = 0.01 use_pattern = True [[flatfield]] spec_samp_coarse = 20.0 spat_samp = 1.0 + tweak_method = gradient tweak_slits_thresh = 0.0 tweak_slits_maxfrac = 0.0 slit_illum_relative = True slit_illum_ref_idx = 14 - slit_illum_smooth_npix = 5 fit_2d_det_response = True [[wavelengths]] fwhm_spat_order = 2 [[slitedges]] edge_thresh = 5 fit_order = 4 - pad = 2 [scienceframe] [[process]] mask_cr = True sigclip = 4.0 objlim = 1.5 + correct_nonlinear = -1.4e-07, -1.4e-07, -1.2e-07, -1.8e-07, noise_floor = 0.01 use_specillum = True use_pattern = True - subtract_scattlight = True [[[scattlight]]] finecorr_method = median [reduce] diff --git a/doc/releases/1.16.1dev.rst b/doc/releases/1.16.1dev.rst index 14cc6ab060..ed857afacb 100644 --- a/doc/releases/1.16.1dev.rst +++ b/doc/releases/1.16.1dev.rst @@ -46,6 +46,8 @@ Script Changes - Added the ``--extr`` parameter in the ``pypeit_sensfunc`` script (also as a SensFuncPar) to allow the user to specify the extraction method to use when computing the sensitivity function (before only optimal extraction was used). +- Treatment of file names is now more formal. Compression signatures are now + considered, and filename matching is now more strict. Datamodel Changes ----------------- diff --git a/doc/setup.rst b/doc/setup.rst index 2a046b17e5..523ed2290d 100644 --- a/doc/setup.rst +++ b/doc/setup.rst @@ -22,6 +22,27 @@ preparatory script, :ref:`pypeit_obslog`, which provides a simple listing of the available data files; however, use of this script is optional in terms of setup for reducing your data. +.. _setup-file-searching: + +Raw File Searches +================= + +PypeIt scripts that search for raw files in a given directory base the search on +a list of file extensions. These are generally ``.fits`` and ``.fits.gz``, but +some spectrographs specify a different set. + +Some scripts allow you to specify the extension to use for the search, which +*must* be one of the allowed extensions for that spectrograph. E.g., +for a spectrograph that allows ``.fits`` and ``.fits.gz`` extension, you can +specify to only look for the ``.fits`` files, but you *cannot* have it look for +``.fits.bz2`` files. If your raw files have extensions that are currently not +allowed by the code, please `Submit an issue`_. + +If you have both compressed and uncompressed files in your directory, the search +function will generally find both. You are strongly encouraged to only include +one version (compressed or uncompressed) of each file in the directory with your +raw data. + .. _setup-metadata: Use of Metadata to Identify Instrument Configurations @@ -168,7 +189,9 @@ to be the same directory that holds the raw data. 1. First Execution ------------------ -We recommend you first execute ``pypeit_setup`` like this:: +We recommend you first execute ``pypeit_setup`` like this: + +.. code-block:: bash pypeit_setup -r path_to_your_raw_data/LB -s keck_lris_blue @@ -187,7 +210,9 @@ This execution of ``pypeit_setup`` searches for all `*.fits` and `*.fits.gz` files with the provided root directory. Generally, the provided path should **not** contain a wild-card and it is best if you provide the *full* path; however, you can search through multiple -directories as follows:: +directories as follows: + +.. code-block:: bash pypeit_setup -r "/Users/xavier/Keck/LRIS/data/2016apr06/Raw/*/LB" -s keck_lris_blue diff --git a/presentations/py/users.py b/presentations/py/users.py index 9f3affcddd..73902997e4 100644 --- a/presentations/py/users.py +++ b/presentations/py/users.py @@ -21,9 +21,9 @@ def set_fontsize(ax, fsz): ax.get_xticklabels() + ax.get_yticklabels()): item.set_fontsize(fsz) -user_dates = ["2021-03-11", "2022-04-29", "2022-11-07", "2022-12-06", "2023-06-08", "2023-06-29", "2023-07-11", "2023-09-03", "2023-10-13", "2023-12-01", "2023-12-15", "2024-02-22", "2024-03-21", "2024-04-09", "2024-05-02", "2024-05-19", "2024-06-06", "2024-06-10"] +user_dates = ["2021-03-11", "2022-04-29", "2022-11-07", "2022-12-06", "2023-06-08", "2023-06-29", "2023-07-11", "2023-09-03", "2023-10-13", "2023-12-01", "2023-12-15", "2024-02-22", "2024-03-21", "2024-04-09", "2024-05-02", "2024-05-19", "2024-06-06", "2024-06-10", "2024-08-20"] user_dates = numpy.array([numpy.datetime64(date) for date in user_dates]) -user_number = numpy.array([125, 293, 390, 394, 477, 487, 506, 518, 531, 544, 551, 568, 579, 588, 596, 603, 616, 620]) +user_number = numpy.array([125, 293, 390, 394, 477, 487, 506, 518, 531, 544, 551, 568, 579, 588, 596, 603, 616, 620, 643]) user_pred_dates = numpy.array([numpy.datetime64(date) for date in ["2024-06-10", "2024-12-31", "2025-12-31", "2026-12-31", diff --git a/pypeit/core/datacube.py b/pypeit/core/datacube.py index 9288e06695..aea12a2a5e 100644 --- a/pypeit/core/datacube.py +++ b/pypeit/core/datacube.py @@ -223,7 +223,7 @@ def extract_point_source(wave, flxcube, ivarcube, bpmcube, wcscube, exptime, Returns ------- - sobjs : `pypeit.specobjs.SpecObjs`_ + sobjs : :class:`pypeit.specobjs.SpecObjs` SpecObjs object containing the extracted spectrum """ if whitelight_range is None: diff --git a/pypeit/flatfield.py b/pypeit/flatfield.py index dd45ad026a..dc83d693a6 100644 --- a/pypeit/flatfield.py +++ b/pypeit/flatfield.py @@ -1584,8 +1584,9 @@ def spectral_illumination(self, gpm=None, debug=False): smooth_npix=self.flatpar['slit_illum_smooth_npix'], debug=debug) - def tweak_slit_edges(self, left, right, spat_coo, norm_flat, method='threshold', thresh=0.93, maxfrac=0.1, debug=False): - """ + def tweak_slit_edges(self, left, right, spat_coo, norm_flat, method='threshold', thresh=0.93, + maxfrac=0.1, debug=False): + r""" Tweak the slit edges based on the normalized slit illumination profile. Args: @@ -1606,12 +1607,15 @@ def tweak_slit_edges(self, left, right, spat_coo, norm_flat, method='threshold', profile. Shape is :math:`(N_{\rm flat},)`. method (:obj:`str`, optional): Method to use for tweaking the slit edges. Options are: - - 'threshold': Use the threshold to set the slit edge - and then shift it to the left or right based on the - illumination profile. - - 'gradient': Use the gradient of the illumination - profile to set the slit edge and then shift it to - the left or right based on the illumination profile. + + - ``'threshold'``: Use the threshold to set the slit edge + and then shift it to the left or right based on the + illumination profile. + + - ``'gradient'``: Use the gradient of the illumination + profile to set the slit edge and then shift it to the left + or right based on the illumination profile. + thresh (:obj:`float`, optional): Threshold of the normalized flat profile at which to place the two slit edges. @@ -1630,13 +1634,14 @@ def tweak_slit_edges(self, left, right, spat_coo, norm_flat, method='threshold', tuple: Returns six objects: - The threshold used to set the left edge - - The fraction of the slit that the left edge is shifted to - the right + - The fraction of the slit that the left edge is shifted to the + right - The adjusted left edge - The threshold used to set the right edge - - The fraction of the slit that the right edge is shifted to - the left + - The fraction of the slit that the right edge is shifted to the + left - The adjusted right edge + """ # TODO :: Since this is just a wrapper, and not really "core", maybe it should be moved to pypeit.flatfield? # Tweak the edges via the specified method diff --git a/pypeit/images/combineimage.py b/pypeit/images/combineimage.py index 635cb4905d..1e20c37710 100644 --- a/pypeit/images/combineimage.py +++ b/pypeit/images/combineimage.py @@ -22,9 +22,10 @@ class CombineImage: Process and combine detector images. Args: - rawImages (:obj:`list`, :class:`~pypeit.images.pypeitimage.PypeItImage): - Either a single :class:`~pypeit.images.pypeitimage.PypeItImage` object or a list of one or more - of these objects to be combined into a an image. + rawImages (:obj:`list`, :class:`~pypeit.images.pypeitimage.PypeItImage`): + Either a single :class:`~pypeit.images.pypeitimage.PypeItImage` + object or a list of one or more of these objects to be combined into + an image. par (:class:`~pypeit.par.pypeitpar.ProcessImagesPar`): Parameters that dictate the processing of the images. diff --git a/pypeit/inputfiles.py b/pypeit/inputfiles.py index 952f40142b..52a41f7c11 100644 --- a/pypeit/inputfiles.py +++ b/pypeit/inputfiles.py @@ -1149,6 +1149,5 @@ def grab_rawfiles(file_of_files:str=None, list_of_files:list=None, raw_paths:lis return [str(p / f) for p in _raw_paths for f in list_of_files if (p / f).exists()] # Find all files that have the correct extension - return np.concatenate([files_from_extension(str(p), extension=extension) - for p in _raw_paths]).tolist() + return files_from_extension(_raw_paths, extension=extension) diff --git a/pypeit/io.py b/pypeit/io.py index 2e0c13b992..1d230ca5eb 100644 --- a/pypeit/io.py +++ b/pypeit/io.py @@ -851,40 +851,48 @@ def create_symlink(filename, symlink_dir, relative_symlink=False, overwrite=Fals os.symlink(olink_src, olink_dest) -def files_from_extension(raw_path, - extension:str='fits'): +def files_from_extension(raw_path, extension='.fits'): """ - Grab the list of files with a given extension + Find files from one or more paths with one or more extensions. - Args: - raw_path (str or list): - Path(s) to raw files, which may or may not include the prefix of the - files to search for. - - For a string input, for example, this can be the directory - ``'/path/to/files/'`` or the directory plus the file prefix - ``'/path/to/files/prefix'``, which yeilds the search strings - ``'/path/to/files/*fits'`` or ``'/path/to/files/prefix*fits'``, - respectively. - - For a list input, this can use wildcards for multiple directories. + This is a recursive function. If ``raw_path`` is a list, the function is + called for every item in the list and the results are concatenated. - extension (str, optional): - File extension to search on. + Args: + raw_path (:obj:`str`, `Path`_, :obj:`list`): + One or more paths to search for files, which may or may not include + the prefix of the files to search for. For string input, this can + be the directory ``'/path/to/files/'`` or the directory plus the + file prefix ``'/path/to/files/prefix'``, which yeilds the search + strings ``'/path/to/files/*fits'`` or + ``'/path/to/files/prefix*fits'``, respectively. For a list input, + this can use wildcards for multiple directories. + + extension (:obj:`str`, :obj:`list`, optional): + One or more file extensions to search on. Returns: - list: List of raw data filenames (sorted) with full path - """ - if isinstance(raw_path, str): - # Grab the list of files - dfname = os.path.join(raw_path, f'*{extension}*') \ - if os.path.isdir(raw_path) else f'{raw_path}*{extension}*' - return sorted(glob.glob(dfname)) + :obj:`list`: List of `Path`_ objects with the full path to the set of + unique raw data filenames that match the provided criteria search + strings. + """ + if isinstance(raw_path, (str, Path)): + _raw_path = Path(raw_path).absolute() + if _raw_path.is_dir(): + prefix = '' + else: + _raw_path, prefix = _raw_path.parent, _raw_path.name + if not _raw_path.is_dir(): + msgs.error(f'{_raw_path} does not exist!') + ext = [extension] if isinstance(extension, str) else extension + files = numpy.concatenate([sorted(_raw_path.glob(f'{prefix}*{e}')) for e in ext]) + return numpy.unique(files).tolist() if isinstance(raw_path, list): - return numpy.concatenate([files_from_extension(p, extension=extension) for p in raw_path]).tolist() + files = numpy.concatenate([files_from_extension(p, extension=extension) for p in raw_path]) + return numpy.unique(files).tolist() - msgs.error(f"Incorrect type {type(raw_path)} for raw_path (must be str or list)") + msgs.error(f"Incorrect type {type(raw_path)} for raw_path; must be str, Path, or list.") diff --git a/pypeit/pypeitsetup.py b/pypeit/pypeitsetup.py index badfd1e6d4..20b95b8c03 100644 --- a/pypeit/pypeitsetup.py +++ b/pypeit/pypeitsetup.py @@ -163,43 +163,40 @@ def from_pypeit_file(cls, filename): cfg_lines=pypeItFile.cfg_lines, pypeit_file=filename) - # TODO: Make the default here match the default used by - # io.files_from_extension? @classmethod - def from_file_root(cls, root, spectrograph, extension='.fits'): + def from_file_root(cls, root, spectrograph, extension=None): """ Instantiate the :class:`~pypeit.pypeitsetup.PypeItSetup` object by providing a file root. Args: - root (:obj:`str`): - String used to find the raw files; see + root (:obj:`str`, `Path`_, :obj:`list`): + One or more paths within which to search for files; see :func:`~pypeit.io.files_from_extension`. - spectrograph (:obj:`str`): + spectrograph (:obj:`str`, :class:`~pypeit.spectrographs.spectrograph.Spectrograph`): The PypeIt name of the spectrograph used to take the observations. This should be one of the available options in :attr:`~pypeit.spectrographs.available_spectrographs`. - extension (:obj:`str`, optional): + extension (:obj:`str`, :obj:`list`, optional): The extension common to all the fits files to reduce; see - :func:`~pypeit.io.files_from_extension`. - + :func:`~pypeit.io.files_from_extension`. If None, uses the + ``allowed_extensions`` of the spectrograph class. Otherwise, + this *must* be a subset of the allowed extensions for the + selected spectrograph. + Returns: :class:`PypeitSetup`: The instance of the class. """ - spec = load_spectrograph(spectrograph) - allext = [extension] - filelist = io.files_from_extension(root, extension=extension) - # Check all allowed extensions as well - if spec.allowed_extensions is not None: - for ext in spec.allowed_extensions: - if ext not in allext: - filelist += io.files_from_extension(root, extension=ext) - allext += [ext] - # Only keep unique files - filelist = list(set(filelist)) - msgs.info("Found {0} files with extensions: {1}".format(len(filelist), ", ".join(allext))) - # Check for files - return cls.from_rawfiles(filelist, spectrograph) + # NOTE: This works if `spectrograph` is either a string or a + # Spectrograph object + spec = load_spectrograph(spectrograph).__class__ + files = spec.find_raw_files(root, extension=extension) + nfiles = len(files) + if nfiles == 0: + msgs.error(f'Unable to find any raw files for {spec.name} in {root}!') + else: + msgs.info(f'Found {nfiles} {spec.name} raw files.') + return cls.from_rawfiles(files, spectrograph) @classmethod def from_rawfiles(cls, data_files:list, spectrograph:str, frametype=None): diff --git a/pypeit/scripts/chk_for_calibs.py b/pypeit/scripts/chk_for_calibs.py index ed3000d992..9269529fa7 100644 --- a/pypeit/scripts/chk_for_calibs.py +++ b/pypeit/scripts/chk_for_calibs.py @@ -21,8 +21,11 @@ def get_parser(cls, width=None): parser.add_argument('-s', '--spectrograph', default=None, type=str, help='A valid spectrograph identifier: {0}'.format( ', '.join(available_spectrographs))) - parser.add_argument('-e', '--extension', default='.fits', - help='File extension; compression indicators (e.g. .gz) not required.') + parser.add_argument('-e', '--extension', default=None, + help='File extension to use. Must include the period (e.g., ".fits") ' + 'and it must be one of the allowed extensions for this ' + 'spectrograph. If None, root directory will be searched for ' + 'all files with any of the allowed extensions.') parser.add_argument('--save_setups', default=False, action='store_true', help='If not toggled, remove setup_files/ folder and its files.') return parser diff --git a/pypeit/scripts/coadd_1dspec.py b/pypeit/scripts/coadd_1dspec.py index 7763f9b905..98306e1126 100644 --- a/pypeit/scripts/coadd_1dspec.py +++ b/pypeit/scripts/coadd_1dspec.py @@ -22,69 +22,6 @@ from pypeit.spectrographs.util import load_spectrograph -## TODO: This is basically the exact same code as read_fluxfile in the fluxing -## script. Consolidate them? Make this a standard method in parse or io. -#def read_coaddfile(ifile): -# """ -# Read a ``PypeIt`` coadd1d file, akin to a standard PypeIt file. -# -# The top is a config block that sets ParSet parameters. The name of the -# spectrograph is required. -# -# Args: -# ifile (:obj:`str`): -# Name of the coadd file -# -# Returns: -# :obj:`tuple`: Three objects are returned: a :obj:`list` with the -# configuration entries used to modify the relevant -# :class:`~pypeit.par.parset.ParSet` parameters, a :obj:`list` the names -# of spec1d files to be coadded, and a :obj:`list` with the object IDs -# aligned with each of the spec1d files. -# """ -# # Read in the pypeit reduction file -# msgs.info('Loading the coadd1d file') -# lines = inputfiles.read_pypeit_file_lines(ifile) -# is_config = np.ones(len(lines), dtype=bool) -# -# -# # Parse the fluxing block -# spec1dfiles = [] -# objids_in = [] -# s, e = inputfiles.InputFile.find_block(lines, 'coadd1d') -# if s >= 0 and e < 0: -# msgs.error("Missing 'coadd1d end' in {0}".format(ifile)) -# elif (s < 0) or (s==e): -# msgs.error("Missing coadd1d read or [coadd1d] block in in {0}. Check the input format for the .coadd1d file".format(ifile)) -# else: -# for ctr, line in enumerate(lines[s:e]): -# prs = line.split(' ') -# spec1dfiles.append(prs[0]) -# if ctr == 0 and len(prs) != 2: -# msgs.error('Invalid format for .coadd1d file.' + msgs.newline() + -# 'You must have specify a spec1dfile and objid on the first line of the coadd1d block') -# if len(prs) > 1: -# objids_in.append(prs[1]) -# is_config[s-1:e+1] = False -# -# # Chck the sizes of the inputs -# nspec = len(spec1dfiles) -# if len(objids_in) == 1: -# objids = nspec*objids_in -# elif len(objids_in) == nspec: -# objids = objids_in -# else: -# msgs.error('Invalid format for .flux file.' + msgs.newline() + -# 'You must specify a single objid on the first line of the coadd1d block,' + msgs.newline() + -# 'or specify am objid for every spec1dfile in the coadd1d block.' + msgs.newline() + -# 'Run pypeit_coadd_1dspec --help for information on the format') -# # Construct config to get spectrograph -# cfg_lines = list(lines[is_config]) -# -# # Return -# return cfg_lines, spec1dfiles, objids - - def build_coadd_file_name(spec1dfiles, spectrograph): """Build the output file name for coadding. The filename convention is coadd1d___.fits or @@ -116,6 +53,7 @@ def build_coadd_file_name(spec1dfiles, spectrograph): path = os.path.dirname(os.path.abspath(spec1dfiles[0])) return os.path.join(path, f'coadd1d_{target}_{instrument_name}_{date_portion}.fits') + class CoAdd1DSpec(scriptbase.ScriptBase): @classmethod diff --git a/pypeit/scripts/multislit_flexure.py b/pypeit/scripts/multislit_flexure.py index 98e836196b..1691361687 100644 --- a/pypeit/scripts/multislit_flexure.py +++ b/pypeit/scripts/multislit_flexure.py @@ -18,55 +18,6 @@ from pypeit.scripts import scriptbase -#def read_flexfile(ifile): -# """ -# Read a ``PypeIt`` flexure file, akin to a standard ``PypeIt`` file. -# -# The top is a config block that sets ParSet parameters. -# -# Args: -# ifile (:obj:`str`): -# Name of the flexure file -# -# Returns: -# :obj:`tuple`: Two objects are returned: a :obj:`list` with the -# configuration entries used to modify the relevant -# :class:`~pypeit.par.parset.ParSet` parameters and a :obj:`list` with the -# names of spec1d files to be flexure corrected. -# """ -# # Read in the pypeit reduction file -# msgs.info('Loading the flexure file') -# lines = inputfiles.read_pypeit_file_lines(ifile) -# is_config = np.ones(len(lines), dtype=bool) -# -# # Parse the fluxing block -# spec1dfiles = [] -# objids_in = [] -# s, e = inputfiles.InputFile.find_block(lines, 'flexure') -# if s >= 0 and e < 0: -# msgs.error("Missing 'flexure end' in {0}".format(ifile)) -# elif (s < 0) or (s == e): -# msgs.error( -# "Missing flexure read block in {0}. Check the input format for the .flex file".format(ifile)) -# else: -# for ctr, line in enumerate(lines[s:e]): -# prs = line.split(' ') -# spec1dfiles.append(prs[0]) -# if len(prs) > 1: -# msgs.error('Invalid format for .flex file.' + msgs.newline() + -# 'You must specify only spec1dfiles in the block ') -# is_config[s-1:e+1] = False -# -# # Chck the sizes of the inputs -# nspec = len(spec1dfiles) -# -# # Construct config to get spectrograph -# cfg_lines = list(lines[is_config]) -# -# # Return -# return cfg_lines, spec1dfiles - - # TODO: Maybe not a good idea to name this script the same as the # flexure.MultiSlitFlexure class, but it is technically okay... class MultiSlitFlexure(scriptbase.ScriptBase): diff --git a/pypeit/scripts/obslog.py b/pypeit/scripts/obslog.py index 693b670a0c..6e1e7a7657 100644 --- a/pypeit/scripts/obslog.py +++ b/pypeit/scripts/obslog.py @@ -65,8 +65,11 @@ def get_parser(cls, width=None): parser.add_argument('-s', '--sort', default='mjd', type=str, help='Metadata keyword (pypeit-specific) to use to sort the output ' 'table.') - parser.add_argument('-e', '--extension', default='.fits', - help='File extension; compression indicators (e.g. .gz) not required.') + parser.add_argument('-e', '--extension', default=None, + help='File extension to use. Must include the period (e.g., ".fits") ' + 'and it must be one of the allowed extensions for this ' + 'spectrograph. If None, root directory will be searched for ' + 'all files with any of the allowed extensions.') parser.add_argument('-d', '--output_path', default='current working directory', help='Path to top-level output directory.') parser.add_argument('-o', '--overwrite', default=False, action='store_true', @@ -115,8 +118,7 @@ def main(args): f'argument.') # Generate the metadata table - ps = PypeItSetup.from_file_root(args.root, args.spec, - extension=args.extension) + ps = PypeItSetup.from_file_root(args.root, args.spec, extension=args.extension) ps.run(setup_only=True, # This allows for bad headers groupings=args.groupings, clean_config=args.bad_frames) diff --git a/pypeit/scripts/setup.py b/pypeit/scripts/setup.py index 9de645baa3..f417caf172 100644 --- a/pypeit/scripts/setup.py +++ b/pypeit/scripts/setup.py @@ -28,8 +28,11 @@ def get_parser(cls, width=None): 'directory (e.g., /data/Kast) or the search string up through ' 'the wildcard (.e.g, /data/Kast/b). Use the --extension option ' 'to set the types of files to search for.') - parser.add_argument('-e', '--extension', default='.fits', - help='File extension; compression indicators (e.g. .gz) not required.') + parser.add_argument('-e', '--extension', default=None, + help='File extension to use. Must include the period (e.g., ".fits") ' + 'and it must be one of the allowed extensions for this ' + 'spectrograph. If None, root directory will be searched for ' + 'all files with any of the allowed extensions.') parser.add_argument('-d', '--output_path', default='current working directory', help='Path to top-level output directory.') parser.add_argument('-o', '--overwrite', default=False, action='store_true', diff --git a/pypeit/scripts/setup_gui.py b/pypeit/scripts/setup_gui.py index d864eb0372..b8925be7e6 100644 --- a/pypeit/scripts/setup_gui.py +++ b/pypeit/scripts/setup_gui.py @@ -27,8 +27,11 @@ def get_parser(cls, width=None): 'the wildcard (.e.g, /data/Kast/b). Use the --extension option ' 'to set the types of files to search for. Default is the ' 'current working directory.') - parser.add_argument('-e', '--extension', default='.fits', - help='File extension; compression indicators (e.g. .gz) not required.') + parser.add_argument('-e', '--extension', default=None, + help='File extension to use. Must include the period (e.g., ".fits") ' + 'and it must be one of the allowed extensions for this ' + 'spectrograph. If None, root directory will be searched for ' + 'all files with any of the allowed extensions.') parser.add_argument('-l', '--logfile', type=str, default=None, help="Write the PypeIt logs to the given file. If the file exists it will be renamed.") parser.add_argument('-v', '--verbosity', type=int, default=2, diff --git a/pypeit/spectrographs/aat_uhrf.py b/pypeit/spectrographs/aat_uhrf.py index 52d0a00d67..ea71c1ed10 100644 --- a/pypeit/spectrographs/aat_uhrf.py +++ b/pypeit/spectrographs/aat_uhrf.py @@ -49,7 +49,7 @@ def get_detector_par(self, det, hdu=None): Object with the detector metadata. """ # Retrieve the binning - binning = self.compound_meta(self.get_headarr(hdu), "binning") + binning = '1,1' if hdu is None else self.compound_meta(self.get_headarr(hdu), "binning") dsec = 1 + 1024//int(binning.split(',')[0]) # Detector 1 detector_dict = dict( diff --git a/pypeit/spectrographs/gemini_gmos.py b/pypeit/spectrographs/gemini_gmos.py index e00506920e..37616553c7 100644 --- a/pypeit/spectrographs/gemini_gmos.py +++ b/pypeit/spectrographs/gemini_gmos.py @@ -108,6 +108,7 @@ class GeminiGMOSSpectrograph(spectrograph.Spectrograph): """ ndet = 3 url = 'http://www.gemini.edu/instrumentation/gmos' + allowed_extensions = ['.fits', '.fits.bz2', '.fits.gz'] def __init__(self): super().__init__() @@ -1045,6 +1046,7 @@ class GeminiGMOSNSpectrograph(GeminiGMOSSpectrograph): telescope = telescopes.GeminiNTelescopePar() camera = 'GMOS-N' header_name = 'GMOS-N' + allowed_extensions = ['.fits', '.fits.bz2', '.fits.gz'] class GeminiGMOSNHamSpectrograph(GeminiGMOSNSpectrograph): diff --git a/pypeit/spectrographs/gemini_gnirs.py b/pypeit/spectrographs/gemini_gnirs.py index 5a88298847..52e346661b 100644 --- a/pypeit/spectrographs/gemini_gnirs.py +++ b/pypeit/spectrographs/gemini_gnirs.py @@ -24,6 +24,7 @@ class GeminiGNIRSSpectrograph(spectrograph.Spectrograph): url = 'https://www.gemini.edu/instrumentation/gnirs' header_name = 'GNIRS' telescope = telescopes.GeminiNTelescopePar() + allowed_extensions = ['.fits', '.fits.bz2'] def __init__(self): super().__init__() diff --git a/pypeit/spectrographs/keck_kcwi.py b/pypeit/spectrographs/keck_kcwi.py index cdf4a20b10..abb0bd1179 100644 --- a/pypeit/spectrographs/keck_kcwi.py +++ b/pypeit/spectrographs/keck_kcwi.py @@ -860,7 +860,7 @@ def get_detector_par(self, det, hdu=None): # Some properties of the image binning = self.compound_meta(self.get_headarr(hdu), "binning") numamps = hdu[0].header['NVIDINP'] - specflip = True if hdu[0].header['AMPID1'] == 2 else False + specflip = False if hdu[0].header['AMPMODE'] == 'ALL' else True gainmul, gainarr = hdu[0].header['GAINMUL'], np.zeros(numamps) ronarr = np.zeros(numamps) # Set this to zero (determine the readout noise from the overscan regions) # dsecarr = np.array(['']*numamps) diff --git a/pypeit/spectrographs/mdm_modspec.py b/pypeit/spectrographs/mdm_modspec.py index 68b1dbe2c6..25f0f78077 100644 --- a/pypeit/spectrographs/mdm_modspec.py +++ b/pypeit/spectrographs/mdm_modspec.py @@ -31,6 +31,8 @@ class MDMModspecEchelleSpectrograph(spectrograph.Spectrograph): supported = True comment = 'MDM Modspec spectrometer; Only 1200l/mm disperser (so far)' + allowed_extensions = ['.fit'] + def get_detector_par(self, det, hdu=None): """ Return metadata for the selected detector. diff --git a/pypeit/spectrographs/spectrograph.py b/pypeit/spectrographs/spectrograph.py index 4c8de5d4a9..24d38b22c9 100644 --- a/pypeit/spectrographs/spectrograph.py +++ b/pypeit/spectrographs/spectrograph.py @@ -145,7 +145,7 @@ class Spectrograph: Metadata model that is generic to all spectrographs. """ - allowed_extensions = None + allowed_extensions = ['.fits', '.fits.gz'] """ Defines the allowed extensions for the input fits files. """ @@ -269,6 +269,44 @@ def ql_par(): ) ) ) + + @classmethod + def find_raw_files(cls, root, extension=None): + """ + Find raw observations for this spectrograph in the provided directory. + + This is a wrapper for :func:`~pypeit.io.files_from_extension` that + handles the restrictions of the file extensions specific to this + spectrograph. + + Args: + root (:obj:`str`, `Path`_, :obj:`list`): + One or more paths to search for files, which may or may not include + the prefix of the files to search for. For string input, this can + be the directory ``'/path/to/files/'`` or the directory plus the + file prefix ``'/path/to/files/prefix'``, which yeilds the search + strings ``'/path/to/files/*fits'`` or + ``'/path/to/files/prefix*fits'``, respectively. For a list input, + this can use wildcards for multiple directories. + extension (:obj:`str`, :obj:`list`, optional): + One or more file extensions to search on. If None, uses + :attr:`allowed_extensions`. Otherwise, this *must* be a subset + of the allowed extensions for the selected spectrograph. + + Returns: + :obj:`list`: List of `Path`_ objects with the full path to the set of + unique raw data filenames that match the provided criteria search + strings. + """ + if extension is None: + _ext = cls.allowed_extensions + else: + _ext = [extension] if isinstance(extension, str) else extension + _ext = [e for e in _ext if e in cls.allowed_extensions] + if len(_ext) == 0: + msgs.error(f'{extension} is not or does not include allowed extensions for ' + f'{cls.name}; choose from {cls.allowed_extensions}.') + return io.files_from_extension(root, extension=_ext) def _check_extensions(self, filename): """ @@ -280,9 +318,9 @@ def _check_extensions(self, filename): """ if self.allowed_extensions is not None: _filename = Path(filename).absolute() - if _filename.suffix not in self.allowed_extensions: + if not any([_filename.name.endswith(ext) for ext in self.allowed_extensions]): msgs.error(f'The input file ({_filename.name}) does not have a recognized ' - f'extension ({_filename.suffix}). The allowed extensions for ' + f'extension. The allowed extensions for ' f'{self.name} include {",".join(self.allowed_extensions)}.') def _check_telescope(self): diff --git a/pypeit/spectrographs/wht_isis.py b/pypeit/spectrographs/wht_isis.py index e107264ac3..7464e459b8 100644 --- a/pypeit/spectrographs/wht_isis.py +++ b/pypeit/spectrographs/wht_isis.py @@ -125,6 +125,7 @@ class WHTISISBlueSpectrograph(WHTISISSpectrograph): name = 'wht_isis_blue' camera = 'ISISb' comment = 'Blue camera' + allowed_extensions = ['.fit', '.fit.gz'] def get_detector_par(self, det, hdu=None): """ diff --git a/pypeit/tests/test_calibrations.py b/pypeit/tests/test_calibrations.py index 3705674b59..52ac1958ac 100644 --- a/pypeit/tests/test_calibrations.py +++ b/pypeit/tests/test_calibrations.py @@ -1,13 +1,10 @@ -""" -Module to run tests on FlatField class -Requires files in Development suite and an Environmental variable -""" from pathlib import Path -import os import yaml import pytest import shutil +from IPython import embed + import numpy as np from pypeit import dataPaths @@ -16,9 +13,8 @@ from pypeit.images import buildimage from pypeit.par import pypeitpar from pypeit.spectrographs.util import load_spectrograph -from IPython import embed -from pypeit.tests.tstutils import dummy_fitstbl, data_output_path +from pypeit.tests.tstutils import data_output_path @pytest.fixture def fitstbl(): diff --git a/pypeit/tests/test_io.py b/pypeit/tests/test_io.py index 95d03abb14..2a6f226297 100644 --- a/pypeit/tests/test_io.py +++ b/pypeit/tests/test_io.py @@ -48,5 +48,5 @@ def test_grab_rawfiles(): _raw_files = inputfiles.grab_rawfiles(raw_paths=[str(root)], extension='.fits.gz') assert len(_raw_files) == 9, 'Found the wrong number of files' - assert all([str(root / f) in _raw_files for f in tbl['filename']]), 'Missing expected files' + assert all([root / f in _raw_files for f in tbl['filename']]), 'Missing expected files' diff --git a/pypeit/tests/test_metadata.py b/pypeit/tests/test_metadata.py index 048191cc3f..467daa44bf 100644 --- a/pypeit/tests/test_metadata.py +++ b/pypeit/tests/test_metadata.py @@ -30,7 +30,7 @@ def test_read_combid(): # Generate the pypeit file with the comb_id droot = tstutils.data_output_path('b') pargs = Setup.parse_args(['-r', droot, '-s', 'shane_kast_blue', '-c', 'all', '-b', - '--extension', 'fits.gz', '--output_path', f'{config_dir.parent}']) + '--output_path', f'{config_dir.parent}']) Setup.main(pargs) pypeit_file = config_dir / 'shane_kast_blue_A.pypeit' diff --git a/pypeit/tests/test_setups.py b/pypeit/tests/test_setups.py index e4356968e1..5759072024 100644 --- a/pypeit/tests/test_setups.py +++ b/pypeit/tests/test_setups.py @@ -63,12 +63,12 @@ def test_run_setup(): droot = tstutils.data_output_path('b') odir = Path(tstutils.data_output_path('')).absolute() / 'shane_kast_blue_A' pargs = Setup.parse_args(['-r', droot, '-s', 'shane_kast_blue', '-c', 'all', - '--extension', 'fits.gz', '--output_path', f'{odir.parent}']) + '--output_path', f'{odir.parent}']) Setup.main(pargs) # Fails because name of spectrograph is wrong pargs2 = Setup.parse_args(['-r', droot, '-s', 'shane_kast_blu', '-c', 'all', - '--extension', 'fits.gz', '--output_path', f'{odir.parent}']) + '--output_path', f'{odir.parent}']) with pytest.raises(ValueError): Setup.main(pargs2)