diff --git a/doc/calibrations/calibrations.rst b/doc/calibrations/calibrations.rst index aeb6cb39d6..d27c68f43c 100644 --- a/doc/calibrations/calibrations.rst +++ b/doc/calibrations/calibrations.rst @@ -1,4 +1,6 @@ +.. include:: ../include/links.rst + .. _calibrations: ============ diff --git a/doc/calibrations/wave_calib.rst b/doc/calibrations/wave_calib.rst index cd8e62e96e..2fd979f7c2 100644 --- a/doc/calibrations/wave_calib.rst +++ b/doc/calibrations/wave_calib.rst @@ -270,13 +270,19 @@ grating equation. In general, the approach is: - 1. Identify the arc lines in each order - 2. Fit the arc lines in each order to a polynomial, individually - 3. Fit a 2D solution to the lines using the order number as a basis - 4. Reject orders where the RMS of the fit (measured in binned pixels) exceeds ``rms_threshold`` - 5. Attempt to recover the missing orders using the 2D fit and - a higher RMS threshold - 6. Refit the 2D solution + #. Identify the arc lines in each order + + #. Fit the arc lines in each order to a polynomial, individually + + #. Fit a 2D solution to the lines using the order number as a basis + + #. Reject orders where the RMS of the fit (measured in binned pixels) + exceeds ``rms_threshold`` + + #. Attempt to recover the missing orders using the 2D fit and a higher RMS + threshold + + #. Refit the 2D solution One should always inspect the outputs, especially the 2D solution (global and orders). One may then need to modify the ``rms_threshold`` diff --git a/doc/include/gemini_gnirs_echelle_A_corrected.pypeit.rst b/doc/include/gemini_gnirs_echelle_A_corrected.pypeit.rst index aa7c8f103e..54821e864c 100644 --- a/doc/include/gemini_gnirs_echelle_A_corrected.pypeit.rst +++ b/doc/include/gemini_gnirs_echelle_A_corrected.pypeit.rst @@ -6,10 +6,10 @@ # User-defined execution parameters [rdx] spectrograph = gemini_gnirs_echelle - [calibrations] - [[wavelengths]] - rms_threshold = 0.8, 0.4, 0.8, 0.8, 0.5, 0.9 - sigdetect = 5.,5.,6.,6.,5.,7. + #[calibrations] + # [[wavelengths]] + # rms_threshold = 0.8, 0.4, 0.8, 0.8, 0.5, 0.9 + # sigdetect = 5.,5.,6.,6.,5.,7. # Setup setup read diff --git a/doc/pypeit_par.rst b/doc/pypeit_par.rst index 8f674cb179..c893aa0ff8 100644 --- a/doc/pypeit_par.rst +++ b/doc/pypeit_par.rst @@ -459,11 +459,11 @@ Key Type Options ``nsnippet`` int .. 2 Number of spectra to chop the arc spectrum into when ``method`` is 'full_template' ``numsearch`` int .. 20 Number of brightest arc lines to search for in preliminary identification ``qa_log`` bool .. True Governs whether the wavelength solution arc line QA plots will have log or linear scalingIf True, the scaling will be log, if False linear -``redo_slit`` int .. .. Redo the input slit (multslit) or order (echelle) +``redo_slits`` int, list .. .. Redo the input slit(s) [multislit] or order(s) [echelle] ``reference`` str ``arc``, ``sky``, ``pixel`` ``arc`` Perform wavelength calibration with an arc, sky frame. Use 'pixel' for no wavelength solution. ``refframe`` str ``observed``, ``heliocentric``, ``barycentric`` ``heliocentric`` Frame of reference for the wavelength calibration. Options are: observed, heliocentric, barycentric ``reid_arxiv`` str .. .. Name of the archival wavelength solution file that will be used for the wavelength reidentification. Only used if ``method`` is 'reidentify' or 'full_template'. -``rms_threshold`` float, list, ndarray .. 0.15 Minimum RMS for keeping a slit/order solution. This can be a single number or a list/array providing the value for each slit. Only used if ``method`` is either 'holy-grail' or 'reidentify' +``rms_threshold`` float .. 0.15 Maximum RMS (in binned pixels) for keeping a slit/order solution. Used for echelle spectrographs, the 'reidentify' method, and when re-analyzing a slit with the redo_slits parameter.In a future PR, we will refactor the code to always scale this threshold off the measured FWHM of the arc lines. ``sigdetect`` int, float, list, ndarray .. 5.0 Sigma threshold above fluctuations for arc-line detection. Arcs are continuum subtracted and the fluctuations are computed after continuum subtraction. This can be a single number or a vector (list or numpy array) that provides the detection threshold for each slit. ``sigrej_final`` float .. 3.0 Number of sigma for rejection for the final guess to the wavelength solution. ``sigrej_first`` float .. 2.0 Number of sigma for rejection for the first guess to the wavelength solution. @@ -549,22 +549,22 @@ Collate1DPar Keywords Class Instantiation: :class:`~pypeit.par.pypeitpar.Collate1DPar` -========================= ========== ======= =============================== ================================================================================================================================================================================================================================================================================================================================================================================================================== -Key Type Options Default Description -========================= ========== ======= =============================== ================================================================================================================================================================================================================================================================================================================================================================================================================== -``chk_version`` bool .. False Whether to check the data model versions of spec1d files and sensfunc files. -``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 .. ``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 +========================= ========== ======= ============================================ ================================================================================================================================================================================================================================================================================================================================================================================================================== +``chk_version`` bool .. False Whether to check the data model versions of spec1d files and sensfunc files. +``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 .. ``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. +========================= ========== ======= ============================================ ================================================================================================================================================================================================================================================================================================================================================================================================================== ---- @@ -615,21 +615,21 @@ 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 -``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 +``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. +====================== ============== ======= ============================================ =============================================================================================================================================================================================================================================================================================================================================================== ---- @@ -2595,10 +2595,12 @@ Alterations to the default parameters are: echelle = True ech_sigrej = 3.0 lamps = CuI, ArI, NeI, HgI, XeI, ArII, + fwhm = 2.9 + fwhm_fromlines = True reid_arxiv = keck_esi_ECH.fits cc_thresh = 0.5 cc_local_thresh = 0.5 - rms_threshold = 0.2 + rms_threshold = 0.3 [[slitedges]] edge_thresh = 5.0 det_min_spec_length = 0.2 @@ -3606,9 +3608,10 @@ Alterations to the default parameters are: ech_norder_coeff = 6 ech_sigrej = 3.0 lamps = OH_NIRES, - fwhm = 5.0 + fwhm = 2.2 + fwhm_fromlines = True reid_arxiv = keck_nires.fits - rms_threshold = 0.2 + rms_threshold = 0.3 n_final = 3, 4, 4, 4, 4, [[slitedges]] fit_min_spec_length = 0.4 @@ -4815,10 +4818,12 @@ Alterations to the default parameters are: echelle = True ech_sigrej = 3.0 lamps = ThAr_MagE, + fwhm = 3.0 + fwhm_fromlines = True reid_arxiv = magellan_mage.fits cc_thresh = 0.5 cc_local_thresh = 0.5 - rms_threshold = 0.2 + rms_threshold = 0.4 [[slitedges]] edge_thresh = 10.0 max_shift_adj = 3.0 @@ -5933,7 +5938,8 @@ Alterations to the default parameters are: ech_norder_coeff = 6 ech_sigrej = 3.0 lamps = OH_NIRES, - fwhm = 5.0 + fwhm = 2.9 + fwhm_fromlines = True reid_arxiv = p200_triplespec.fits rms_threshold = 0.3 n_final = 3, 4, 4, 4, 4, @@ -6856,7 +6862,7 @@ Alterations to the default parameters are: reid_arxiv = vlt_xshooter_nir.fits cc_thresh = 0.5 cc_local_thresh = 0.5 - rms_threshold = 0.35 + rms_threshold = 0.6 qa_log = False [[slitedges]] edge_thresh = 50.0 @@ -6998,10 +7004,12 @@ Alterations to the default parameters are: ech_sigrej = 3.0 lamps = ThAr_XSHOOTER_UVB, sigdetect = 3.0 + fwhm = 3.8 + fwhm_fromlines = True reid_arxiv = vlt_xshooter_uvb1x1.fits cc_thresh = 0.5 cc_local_thresh = 0.5 - rms_threshold = 0.6 + rms_threshold = 0.7 n_final = 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, [[slitedges]] edge_thresh = 8.0 @@ -7131,11 +7139,12 @@ Alterations to the default parameters are: echelle = True ech_sigrej = 3.0 lamps = ThAr_XSHOOTER_VIS, - fwhm = 11.0 + fwhm = 8.0 + fwhm_fromlines = True reid_arxiv = vlt_xshooter_vis1x1.fits cc_thresh = 0.5 cc_local_thresh = 0.5 - rms_threshold = 0.5 + rms_threshold = 1.2 n_final = 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, [[slitedges]] edge_thresh = 8.0 diff --git a/doc/spectrographs/spectrographs.rst b/doc/spectrographs/spectrographs.rst index 822fd9a3a1..2ab94922ce 100644 --- a/doc/spectrographs/spectrographs.rst +++ b/doc/spectrographs/spectrographs.rst @@ -38,6 +38,7 @@ instrument-specific details for running PypeIt. gemini_gnirs gtc_osiris deimos + keck_hires keck_kcwi lris keck_nires diff --git a/doc/spectrographs/xshooter.rst b/doc/spectrographs/xshooter.rst index 6247303a59..8e4420b399 100644 --- a/doc/spectrographs/xshooter.rst +++ b/doc/spectrographs/xshooter.rst @@ -30,7 +30,7 @@ FWHM For the UVB or the VIS, you may turn off measuring the FWHM (in units of binned pixdels) from the arc lines -by adding this to your :doc:`pypeit_file`: +by adding this to your :ref:`pypeit_file`: .. code-block:: ini @@ -46,7 +46,7 @@ RMS --- Another option is to increase the RMS threshold for a good solution. -This may be done in the :doc:`pypeit_file` as well: +This may be done in the :ref:`pypeit_file` as well: .. code-block:: ini @@ -56,5 +56,5 @@ This may be done in the :doc:`pypeit_file` as well: Note that this is scaled by the ratio of the measured FWHM value -to the default value. See :ref:`_wvcalib-echelle` for +to the default value. See :ref:`wvcalib-echelle` for further details. diff --git a/pypeit/core/wavecal/patterns.py b/pypeit/core/wavecal/patterns.py index 1ea0d39287..fd03c4858b 100644 --- a/pypeit/core/wavecal/patterns.py +++ b/pypeit/core/wavecal/patterns.py @@ -1,4 +1,6 @@ """ Module for finding patterns in arc line spectra + +.. include:: ../include/links.rst """ import numpy as np import scipy.ndimage diff --git a/pypeit/wavecalib.py b/pypeit/wavecalib.py index 3b64ebbefe..0a96906f34 100644 --- a/pypeit/wavecalib.py +++ b/pypeit/wavecalib.py @@ -862,23 +862,25 @@ def echelle_2dfit(self, wv_calib, debug=False, skip_QA=False): Primarily a wrapper for :func:`pypeit.core.arc.fit2darc`, using data unpacked from the ``wv_calib`` dictionary. - Args: - wv_calib (:class:`pypeit.wavecalib.WaveCalib`): - Wavelength calibration object - debug (:obj:`bool`, optional): - Show debugging info - skip_QA (:obj:`bool`, optional): - Flag to skip construction of the nominal QA plots. + Parameters + ---------- + wv_calib : :class:`pypeit.wavecalib.WaveCalib` + Wavelength calibration object + debug : :obj:`bool`, optional + Show debugging info + skip_QA : :obj:`bool`, optional + Flag to skip construction of the nominal QA plots. - Returns: - tuple: - - ``fit2ds``: a list of :class:`pypeit.fitting.PypeItFit`: objects - containing information from 2-d fit. Frequently a list of 1 fit. - The main exception is for a mosaic when one sets ``echelle_separate_2d=True``. - - - ``dets``: a list of integers for the detector numbers. - - - ``order_dets``: a list of integer lists providing list of the orders. + Returns + ------- + fit2ds : list of :class:`pypeit.fitting.PypeItFit` + Contains information from 2-d fit. Frequently a list of 1 fit. The + main exception is for a mosaic when one sets + ``echelle_separate_2d=True``. + dets : list + List of integers for the detector numbers. + save_order_dets: list + List of integer lists providing list of the orders. """ if self.spectrograph.pypeline != 'Echelle': msgs.error('Cannot execute echelle_2dfit for a non-echelle spectrograph.')