diff --git a/tutorials/conf.py b/tutorials/conf.py index 3a6430e2..d7f0859f 100644 --- a/tutorials/conf.py +++ b/tutorials/conf.py @@ -19,7 +19,7 @@ project = 'pyemir-tutorials' copyright = '2018-2024, Universidad Complutense de Madrid' -author = 'Nicolás Cardiel' +author = 'Nicolás Cardiel, Sergio Pascual' # The full version, including alpha/beta/rc tags release = 'v1.0' @@ -53,17 +53,18 @@ # #html_theme = 'alabaster' html_theme = 'sphinx_rtd_theme' -#html_logo = 'logo.png' +html_logo = '_static/logo.png' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +# This doesn't work. Use html_logo above (NCL, 20241015) html_theme_options = { - 'logo': 'logo.png', - 'show_related': True, - 'show_relbar_bottom': True, - 'show_relbar_top': False + #'logo': 'logo.png', + #'show_related': True, + #'show_relbar_bottom': True, + #'show_relbar_top': False } diff --git a/tutorials/preliminaries/preliminaries.rst b/tutorials/preliminaries/preliminaries.rst index 33d46227..87dae580 100644 --- a/tutorials/preliminaries/preliminaries.rst +++ b/tutorials/preliminaries/preliminaries.rst @@ -20,7 +20,7 @@ Running PyEmir recipes from Numina The ``numina`` script is the interface with GTC pipelines. In order to execute PyEmir recipes you should use execute something like: -:: +.. code-block:: console (emir) $ numina run -r @@ -48,7 +48,7 @@ Download the following file: `pyemir_initial_tree_v2a.tgz If you find any trouble trying to download the previous file, try with the following command line: -:: +.. code-block:: console (emir) $ curl -O https://guaix.fis.ucm.es/data/pyemir/pyemir_initial_tree_v2a.tgz @@ -65,7 +65,7 @@ following command line: It is advisable to decompress the previous file in a pristine directory where you can comfortably start the reduction of your data: -:: +.. code-block:: console (emir) $ mkdir newdir (emir) $ cd newdir @@ -138,7 +138,7 @@ Installing ds9 Probably you already have ds9 installed in your system. If this is not the case, you can use conda to do it! -:: +.. code-block:: console (emir) $ conda install ds9 diff --git a/tutorials/tutorial_flat/index.rst b/tutorials/tutorial_flat/index.rst index 965381de..0154c378 100644 --- a/tutorials/tutorial_flat/index.rst +++ b/tutorials/tutorial_flat/index.rst @@ -52,7 +52,7 @@ flatfield in the initial basic reduction of the original images is not essential. The user can easily check this by setting ``MasterIntensityFlat`` to ``master_flat_ones.fits`` in the ``control.yaml`` file, i.e.: -:: +.. code-block:: yaml - {id: 4, type: 'MasterIntensityFlat', tags: {}, content: 'master_flat_ones.fits'} @@ -124,7 +124,7 @@ containing the basic PyEmir calibration files (see :ref:`initial_file_tree`). Decompress there the previously mentioned tgz file: -:: +.. code-block:: console (emir) $ tar zxvf pyemir_flatpix2pix_tutorial_v1.tgz ... @@ -135,7 +135,7 @@ This action should have populated the file tree with the 20 tungsten FITS images (placed wihtin the ``data`` subdirectory) and some additional auxiliary files: -:: +.. code-block:: console (emir) $ tree . @@ -175,7 +175,7 @@ subdirectory) and some additional auxiliary files: You can easily examine the header of the scientific FITS images using the astropy utility ``fitsheader``: -:: +.. code-block:: console (emir) $ fitsheader data/0002069*.fits -k object -k lampincd -k lampintn -f filename OBJECT LAMPINCD LAMPINTN @@ -213,7 +213,7 @@ and the last 10 images to lamp OFF. Let's have a look to the CSU configuration: -:: +.. code-block:: console (emir) $ pyemir-display_slitlet_arrangement data/0002069432-20190519-EMIR-STARE_SPECTRA.fits \ --longslits --n_clusters 2 @@ -249,7 +249,7 @@ We can also display the first image with lamp ON and the first with lamp OFF: An estimate of the integer vertical offset (in pixels) can be obtained using: -:: +.. code-block:: console $ pyemir-overplot_boundary_model data/0002069432-20190519-EMIR-STARE_SPECTRA.fits \ --rect_wpoly_MOSlibrary data/rect_wpoly_MOSlibrary_grism_H_filter_H.json @@ -314,7 +314,7 @@ properly for all combinations of grism+filter. You can now execute the reduction recipe: -:: +.. code-block:: console (emir) $ numina run flatpix2pix.yaml --link-files -r control.yaml ... @@ -325,7 +325,7 @@ The resulting pixel-to-pixel flatfield can be found in the corresponding .. numina-ximshow obsid_flat_results/reduced_flatpix2pix.fits --geometry 0,0,650,850 -:: +.. code-block:: console (emir) $ numina-ximshow obsid_flat_results/reduced_flatpix2pix.fits diff --git a/tutorials/tutorial_imaging/preliminary_combination.rst b/tutorials/tutorial_imaging/preliminary_combination.rst index 7eb72768..a0c07271 100644 --- a/tutorials/tutorial_imaging/preliminary_combination.rst +++ b/tutorials/tutorial_imaging/preliminary_combination.rst @@ -53,7 +53,7 @@ containing the basic PyEmir calibration files (see :ref:`initial_file_tree`). Decompress there the previously mentioned tgz file: -:: +.. code-block:: console (emir) $ tar zxvf pyemir_imaging_tutorial_v4.tgz ... @@ -64,7 +64,7 @@ This action should have populated the file tree with the 14 scientific raw FITS (placed wihtin the ``data`` subdirectory) and some additional auxiliary files: -:: +.. code-block:: console (emir) $ tree . @@ -105,7 +105,7 @@ subdirectory) and some additional auxiliary files: You can easily examine the header of the scientific FITS images using the astropy utility ``fitsheader``: -:: +.. code-block:: console (emir) $ fitsheader data/0001877* \ -k nobsblck -k obsblock -k nimgobbl -k imgobbl \ @@ -142,7 +142,7 @@ flatfielding, and image reprojection. Remember that the ``numina`` script is the interface with GTC pipelines. In order to execute PyEmir recipes you should type something like: - :: + .. code-block:: console (emir) $ numina run -r @@ -235,7 +235,7 @@ highlighting the first block (first eight lines): In particular, the file used in this example can be easily created using a few simple commands: - :: + .. code-block:: console (emir) $ cd data/ (emir) $ ls 0001877*fits > list_images.txt @@ -282,7 +282,7 @@ You are ready to execute the reduction recipe indicated in the file ``dithered_ini.yaml`` (in this case the reduccion recipe named ``STARE_IMAGE``): -:: +.. code-block:: console (emir) $ numina run dithered_ini.yaml -r control.yaml ... @@ -291,7 +291,7 @@ You are ready to execute the reduction recipe indicated in the file After the execution of the previous command line, two subdirectories for each block should have appeared: -:: +.. code-block:: console (emir) $ ls control.yaml obsid_0001877565_results/ obsid_0001877601_work/ @@ -316,7 +316,7 @@ of a particular block of the observation result file are copied into the In particular, for the first block: -:: +.. code-block:: console (emir) $ tree obsid_0001877553_work/ obsid_0001877553_work/ @@ -331,7 +331,7 @@ links (instead of actual copies of the original raw files) must be placed in the* ``work`` *subdirectory.* This behaviour is set using the parameter ``--link-files``: -:: +.. code-block:: console (emir) $ numina run dithered_ini.yaml --link-files -r control.yaml ... @@ -351,7 +351,7 @@ the* ``work`` *subdirectory.* This behaviour is set using the parameter These subdirectories store the result of the execution of the reduction recipes. In particular, for the first block: -:: +.. code-block:: console $ tree obsid_0001877553_results/ obsid_0001877553_results/ @@ -433,7 +433,7 @@ a combined image. The file ``dithered_v0.yaml`` can also be automatically generated using the same script previously mentioned in step 1: - :: + .. code-block:: console (emir) $ pyemir-generate_yaml_for_dithered_image \ data/list_images.txt --step 1 --repeat 1 \ @@ -451,7 +451,7 @@ a combined image. The combination of the images is finally performed using numina: -:: +.. code-block:: console (emir) $ numina run dithered_v0.yaml --link-files -r control.yaml @@ -459,7 +459,7 @@ The previous execution also generates two auxiliary subdirectories ``work`` and ``results``. The resulting combined image can be found in ``obsid_combined_v0_result/reduced_image.fits``: -:: +.. code-block:: console (emir) $ tree obsid_combined_v0_results/ obsid_combined_v0_results/ @@ -471,7 +471,7 @@ The previous execution also generates two auxiliary subdirectories ``work`` and You can display the image using ``ds9``, using ``numina-ximshow`` (the display tool shipped with numina based on matplotlib), or with any other tool: -:: +.. code-block:: console (emir) $ numina-ximshow obsid_combined_v0_results/reduced_image.fits diff --git a/tutorials/tutorial_imaging/refined_combination.rst b/tutorials/tutorial_imaging/refined_combination.rst index 247b5f62..3f0f926f 100644 --- a/tutorials/tutorial_imaging/refined_combination.rst +++ b/tutorials/tutorial_imaging/refined_combination.rst @@ -67,7 +67,7 @@ line 127 has also been changed in order to avoid overwriting the ``work`` and The refined version of the combined image is then obtained by executing numina again with this new observation result file: -:: +.. code-block:: console (emir) $ numina run dithered_v1.yaml --link-files -r control.yaml @@ -139,7 +139,7 @@ number 148; note also the ``id`` change in line 127): The contents of the ASCII file with the measured offsets is the following: -:: +.. code-block:: console (emir) $ cat data/user_offsets.txt 822 907 @@ -159,7 +159,7 @@ The contents of the ASCII file with the measured offsets is the following: Execute numina to obtain the new version of the combined image: -:: +.. code-block:: console (emir) $ numina run dithered_v2.yaml --link-files -r control.yaml @@ -225,7 +225,7 @@ In this case we have modified the ``id`` (line 127) and set Execute numina again with this new observation result file: -:: +.. code-block:: console (emir) $ numina run dithered_v3.yaml --link-files -r control.yaml @@ -329,13 +329,13 @@ computed from the WCS information in the image headers). Execute numina to start the reduction including object masking: -:: +.. code-block:: console (emir) $ numina run dithered_v4.yaml --link-files -r control.yaml It is useful to subtract the new result from the one derived previously: -:: +.. code-block:: console (emir) $ numina-imath obsid_combined_v1_results/reduced_image.fits - \ obsid_combined_v4_results/reduced_image.fits difference_v4.fits @@ -523,7 +523,7 @@ we are using a pattern of 10 x 10 regions in each quadrant. The median value in each of these 100 subregions is computed (masking pixels affected by objects) and a smooth spline surface is fitted to that collection of points. -:: +.. code-block:: console (emir) $ numina run dithered_v5.yaml --link-files -r control.yaml @@ -582,7 +582,7 @@ change in the ``id`` in line 127): **by default, which means that the correction described next is not performed unless splicitly stated.** -:: +.. code-block:: console (emir) $ numina run dithered_v6.yaml --link-files -r control.yaml @@ -638,7 +638,7 @@ strategy is followed in order to perform this latter reduction step: We can easily compare the new result with the one obtained using ``dithered_v5.yaml``. For that purpose is useful to subtract the new result from the one derived previously: -:: +.. code-block:: console (emir) $ numina-imath obsid_combined_v6_results/reduced_image.fits - \ obsid_combined_v5_results/reduced_image.fits difference_v6.fits diff --git a/tutorials/tutorial_mos/mos_example.rst b/tutorials/tutorial_mos/mos_example.rst index 009840b8..e437dbda 100644 --- a/tutorials/tutorial_mos/mos_example.rst +++ b/tutorials/tutorial_mos/mos_example.rst @@ -36,7 +36,7 @@ Download the following file: `pyemir_mos_tutorial.tgz If you find any trouble trying to download the previous file, try with the command line: -:: +.. code-block:: console (emir) $ curl -O -r @@ -224,7 +224,7 @@ You are ready to execute the reduction recipe indicated in the file ``0_preliminary_calibration.yaml`` (in this case the reduccion recipe named ``GENERATE_RECTWV_COEFF``): -:: +.. code-block:: console (emir) $ numina run 0_preliminary_calibration.yaml -r control.yaml ... @@ -241,7 +241,7 @@ have been created: The ``work`` subdirectory ------------------------- -:: +.. code-block:: console (emir) $ tree obsid_0001041345_work/ obsid_0001041345_work/ @@ -273,7 +273,7 @@ links (instead of actual copies of the original raw files) must be placed in the* ``work`` *subdirectory.* This behaviour is set using the parameter ``--link-files``: -:: +.. code-block:: console (emir) $ numina run 0_preliminary_calibration.yaml --link-files -r control.yaml ... @@ -357,7 +357,7 @@ of the reduction recipe. In particular: The ``results`` subdirectory ---------------------------- -:: +.. code-block:: console (emir) $ tree obsid_0001401345_results/ obsid_0001401345_results/ @@ -380,7 +380,7 @@ important files here are: You can easily display the last image using ``ds9`` or the visualization tool provided with numina: -:: +.. code-block:: console (emir) $ numina-ximshow obsid_0001041345_results/reduced_mos.fits --z1z2 0,1000 @@ -392,7 +392,7 @@ provided with numina: - The wavelength calibration coefficientes are stored in the usual FITS keywords ``CRPIX1``, ``CRVAL1`` and ``CDELT1``: - :: + .. code-block:: console (emir) $ fitsheader obsid_0001041345_results/reduced_mos.fits -k crpix1 -k crval1 -k cdelt1 -f filename CRPIX1 CRVAL1 CDELT1 @@ -409,7 +409,7 @@ provided with numina: - Note that the image dimensions are now NAXIS1=3400 and NAXIS2=2090: - :: + .. code-block:: console (emir) $ fitsheader obsid_0001041345_results/reduced_mos.fits -k naxis* -f filename NAXIS NAXIS1 NAXIS2 @@ -459,7 +459,7 @@ to the preliminary rectified and wavelength calibrated image (making a zoom in a relatively narrow range in the X direction) it is clear that the relative wavelength calibration between slitlets does not agree within roughtly 1 pixel: -:: +.. code-block:: console (emir) $ numina-ximshow obsid_0001041345_results/reduced_mos.fits --bbox 1920,2050,1,2090 --z1z2 0,11000 @@ -488,7 +488,7 @@ the 3 types of arc lamps were simultaneously ON during the exposure time. An easy way to check that this was really the case is to examine the corresponding status keywords: -:: +.. code-block:: console (emir) $ fitsheader obsid_0001041345_results/reduced_mos.fits -k lampxe* -k lampne* -k lamphg* -f filename LAMPXE1 LAMPXE2 LAMPNE1 LAMPNE2 LAMPHG1 LAMPHG2 @@ -527,7 +527,7 @@ For example, we can execute the auxiliary script previously used (since the three images were obtained consecutively with exactly the same configuration, we can choose any of them): -:: +.. code-block:: console (emir) $ pyemir-overplot_boundary_model \ data/0001041345-20160917-EMIR-TEST0.fits \ @@ -595,7 +595,7 @@ subdirectory. In particular: Open ``ds9`` with the same image -:: +.. code-block:: console (emir) $ ds9 data/0001041345-20160917-EMIR-TEST0.fits @@ -628,7 +628,7 @@ Since we know that the raw data correspond to arc images, we can overplot the expected locations of the some of the brightest arc lines by using the additional parameter ``--arc_lines``: -:: +.. code-block:: console (emir) $ pyemir-overplot_boundary_model \ data/0001041345-20160917-EMIR-TEST0.fits \ @@ -653,7 +653,7 @@ auxiliary ds9-region with the expected location of the arc lines, created under the ``obsid_0001041345_work`` subdirectory. In this case, open ``ds9`` with the same image: -:: +.. code-block:: console (emir) $ ds9 data/0001041345-20160917-EMIR-TEST0.fits @@ -713,7 +713,7 @@ behavior of the reduction recipe: Execute the reduction recipe using the new observation result file: -:: +.. code-block:: console (emir) $ numina run 1_refined_calibration.yaml --link-files -r control.yaml ... @@ -725,7 +725,7 @@ wavelength calibration of the different slitlets matches). The new ``reduced_mos.fits`` image now does exhibit a much better wavelength calibration: -:: +.. code-block:: console (emir) $ numina-ximshow obsid_0001041345_refined_results/reduced_mos.fits \ --bbox 1920,2050,1,2090 --z1z2 0,11000 @@ -743,7 +743,7 @@ display that new image zooming into the same region employed in the last plot (note that the intensity of the arc lines in ``expected_catalog_lines.fits`` ranges from 0.0 to 1.0): -:: +.. code-block:: console (emir) $ numina-ximshow obsid_0001041345_refined_work/expected_catalog_lines.fits \ --bbox 1920,2050,1,2090 --z1z2 0,0.4 @@ -762,7 +762,7 @@ perfectly horizontal, whereas the expected arc lines are vertical (the image has been rectified!). These region files are useful to locate individual slitlets by number. -:: +.. code-block:: console (emir) $ ds9 obsid_0001041345_refined_results/reduced_mos.fits