Skip to content

Commit

Permalink
Include code-block directive
Browse files Browse the repository at this point in the history
  • Loading branch information
nicocardiel committed Oct 15, 2024
1 parent a4ebb98 commit 5436ae8
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 110 deletions.
13 changes: 7 additions & 6 deletions tutorials/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
}

8 changes: 4 additions & 4 deletions tutorials/preliminaries/preliminaries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <observation_result_file.yaml> -r <requirements_file.yaml>
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions tutorials/tutorial_flat/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down Expand Up @@ -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
...
Expand All @@ -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
.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
...
Expand All @@ -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
Expand Down
28 changes: 14 additions & 14 deletions tutorials/tutorial_imaging/preliminary_combination.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
Expand All @@ -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
.
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 <observation_result_file.yaml> -r <requirements_file.yaml>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
...
Expand All @@ -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/
Expand All @@ -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/
Expand All @@ -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
...
Expand All @@ -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/
Expand Down Expand Up @@ -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 \
Expand All @@ -451,15 +451,15 @@ 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
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/
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions tutorials/tutorial_imaging/refined_combination.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 5436ae8

Please sign in to comment.