Commit c1b24c0fb66c72e756e090041e49227ad4131e96

Authored by Jürgen Knödlseder
1 parent 30425a82

Add tutorial for first CTA Data Challenge.

The tutorial contains so far an incomplete version of the text, but the basic structure is outlined.
cscripts/Makefile.am
... ... @@ -112,6 +112,7 @@ testscripts = $(srcdir)/tests/__init__.py \
112 112 $(top_srcdir)/test/test_csobs2caldb.py \
113 113 $(top_srcdir)/test/test_csobsdef.py \
114 114 $(top_srcdir)/test/test_csobsinfo.py \
  115 + $(top_srcdir)/test/test_csobsselect.py \
115 116 $(top_srcdir)/test/test_cslightcrv.py \
116 117 $(top_srcdir)/test/test_cspull.py \
117 118 $(top_srcdir)/test/test_csresmap.py \
... ...
doc/source/_templates/index.html
... ... @@ -48,10 +48,12 @@ and next steps, and advance with the coding of the software. {%endtrans%}</p>
48 48 <h2 style="margin-bottom: 0">{%trans%}Documentation{%endtrans%}</h2>
49 49  
50 50 <ul>
  51 +<li><a class="smalllink" href="{{ pathto("users/tutorials/index") }}">{%trans%}Tutorials{%endtrans%}</a></li>
51 52 <li><a class="smalllink" href="{{ pathto("users/user_manual/index") }}">{%trans%}User Manual{%endtrans%}</a></li>
52 53 <li><a class="smalllink" href="{{ pathto("users/reference_manual/index") }}">{%trans%}Reference Manual{%endtrans%}</a></li>
53 54 <li><a class="smalllink" href="{{ pathto("users/faq") }}">{%trans%}Frequently asked questions{%endtrans%}</a></li>
54 55 <li><a class="smalllink" href="{{ pathto("users/issues") }}">{%trans%}Known issues{%endtrans%}</a></li>
  56 +<li><a class="smalllink" href="{{ pathto("users/glossary") }}">{%trans%}Glossary{%endtrans%}</a></li>
55 57 <li><a class="smalllink" href="{{ pathto("users/release_history/index") }}">{%trans%}Release history{%endtrans%}</a></li>
56 58 <li><a class="smalllink" href="doxygen/index.html">{%trans%}Source code documentation (Doxygen){%endtrans%}</a></li>
57 59 </ul>
... ... @@ -59,8 +61,8 @@ and next steps, and advance with the coding of the software. {%endtrans%}&lt;/p&gt;
59 61 <h2 style="margin-bottom: 0">{%trans%}Links{%endtrans%}</h2>
60 62  
61 63 <ul>
62   - <li><a href="https://cta-gitlab.irap.omp.eu/ctools/ctools">GitLab</a></li>
63   - <li><a href="https://github.com/ctools/ctools">GitHub</a></li>
64   - <li><a href="https://cta-redmine.irap.omp.eu/projects/ctools">Redmine</a></li>
65   - <li><a href="https://www.openhub.net/p/ctools_">Open HUB</a>{% endblock %}</li>
  64 +<li><a href="https://cta-gitlab.irap.omp.eu/ctools/ctools">GitLab</a></li>
  65 +<li><a href="https://github.com/ctools/ctools">GitHub</a></li>
  66 +<li><a href="https://cta-redmine.irap.omp.eu/projects/ctools">Redmine</a></li>
  67 +<li><a href="https://www.openhub.net/p/ctools_">Open HUB</a>{% endblock %}</li>
66 68 </ul>
... ...
doc/source/users/glossary.rst 0 → 100644
  1 +Glossary
  2 +========
  3 +
  4 +.. _glossary_eventlist:
  5 +
  6 +.. topic:: Event list
  7 +
  8 + Bla bla ...
  9 +
  10 +.. _glossary_1dc:
  11 +
  12 +.. topic:: First CTA Data Challenge
  13 +
  14 + Bla bla ...
  15 +
  16 +.. _glossary_irf:
  17 +
  18 +.. topic:: Instrument Response Functions
  19 +
  20 + Bla bla ...
  21 +
  22 +.. _glossary_moddef:
  23 +
  24 +.. topic:: Model definition file
  25 +
  26 + Bla bla ...
  27 +
  28 +.. _glossary_obs:
  29 +
  30 +.. topic:: Observation
  31 +
  32 + Bla bla ...
  33 +
  34 +.. _glossary_obsdef:
  35 +
  36 +.. topic:: Observation definition file
  37 +
  38 + Bla bla ...
... ...
doc/source/users/index.rst
... ... @@ -6,9 +6,11 @@ User Documentation
6 6 .. toctree::
7 7 :maxdepth: 2
8 8  
  9 + tutorials/index
9 10 user_manual/index
10 11 reference_manual/index
11 12 faq
12 13 issues
  14 + glossary
13 15 release_history/index
14 16 help
... ...
doc/source/users/tutorials/1dc/first.rst 0 → 100644
  1 +.. _1dc_first:
  2 +
  3 +First analysis steps
  4 +====================
  5 +
  6 +The following sections describe how to analyse data from the
  7 +:ref:`First CTA Data Challenge <glossary_1dc>`
  8 +using ctools.
  9 +If you have never used ctools before or if you have never analysed data from the
  10 +:ref:`First CTA Data Challenge <glossary_1dc>`,
  11 +this is the place where you should start.
  12 +
  13 +We assume that you have downloaded the data of the
  14 +:ref:`First CTA Data Challenge <glossary_1dc>`
  15 +and that you have successfully installed the ctools package.
  16 +If this is not the case, please read :ref:`1dc_getting`.
  17 +
  18 +.. toctree::
  19 + :maxdepth: 2
  20 +
  21 + first_data
  22 + first_select_obs
  23 + first_skymap
  24 + first_select_models
  25 + first_fitting
  26 + first_residuals
  27 + first_stacked
... ...
doc/source/users/tutorials/1dc/first_data.rst 0 → 100644
  1 +.. _1dc_first_data:
  2 +
  3 +Data organisation
  4 +-----------------
  5 +
  6 +After downloading the
  7 +:ref:`First CTA Data Challenge <glossary_1dc>`
  8 +data from **TBD** and uncompressing the tarball using
  9 +
  10 +.. code-block:: bash
  11 +
  12 + $ tar xfvz 1dc.tar.gz
  13 +
  14 +you will have a directory ``1dc`` on your disk with the following content:
  15 +
  16 +.. code-block:: bash
  17 +
  18 + caldb/
  19 + caldb/data
  20 + caldb/data/cta
  21 + caldb/data/cta/prod2
  22 + ...
  23 + caldb/data/cta/prod3
  24 + caldb/data/cta/prod3/caldb.indx
  25 + caldb/data/cta/prod3/bcf
  26 + ...
  27 + data/
  28 + data/gps_baseline_000001.fits
  29 + data/gps_baseline_000002.fits
  30 + data/gps_baseline_000003.fits
  31 + ...
  32 + data/gps_threshold_000001.fits
  33 + data/gps_threshold_000002.fits
  34 + data/gps_threshold_000003.fits
  35 + ...
  36 + data/egal_baseline_000001.fits
  37 + data/egal_baseline_000002.fits
  38 + data/egal_baseline_000003.fits
  39 + ...
  40 + data/egal_threshold_000001.fits
  41 + data/egal_threshold_000002.fits
  42 + data/egal_threshold_000003.fits
  43 + ...
  44 + data/obs_gps_baseline.xml
  45 + data/obs_gps_threshold.xml
  46 + data/obs_egal_baseline.xml
  47 + data/obs_egal_threshold.xml
  48 + data/obs_all_baseline.xml
  49 + data/obs_all_threshold.xml
  50 + models/
  51 + models/models_gps.xml
  52 + models/models_egal.xml
  53 + models/map_RXJ1713.fits.gz
  54 + models/map_VelaJunior.fits.gz
  55 + models/map_ics.fits.gz
  56 + models/map_pi0.fits.gz
  57 +
  58 +The ``caldb`` folder contains the
  59 +:ref:`Instrument Response Functions <glossary_irf>`
  60 +that are necessary for the analysis of the simulated CTA data.
  61 +The folder contains the ``prod3`` response that should be used for the
  62 +:ref:`First CTA Data Challenge <glossary_1dc>`.
  63 +For legacy reasons, also the ``prod2`` response functions are shipped with
  64 +the tarball.
  65 +
  66 +The ``data`` folder contains the calibrated, reconstructed and background
  67 +reduced event data that were procuded for the
  68 +:ref:`First CTA Data Challenge <glossary_1dc>`.
  69 +Each event file corresponds to the
  70 +:ref:`event lists <glossary_eventlist>`
  71 +for an
  72 +:ref:`observation (or run) <glossary_obs>`, and contains for each event a
  73 +time stamp, the reconstructued photon arrival direction, and the reconstructed
  74 +photon energy.
  75 +The pointing direction during an observation is fixed.
  76 +Event files exist for the Galactic Plane Survey (starting with ``gps_``) and
  77 +for the extragalactic survey (starting with ``egal_``) for both
  78 +the ``baseline`` configuration and the ``threshold`` implementation.
  79 +
  80 +The files ``obs_XXX_YYYYY.xml`` are so called
  81 +:ref:`Observation Definition Files <glossary_obsdef>`
  82 +that contain the information (or metadata) of a list of observations.
  83 +The files are plain ASCII files in XML format that be inspected and
  84 +manipulated by any text editor.
  85 +The following files are included in the data distribution:
  86 +
  87 +* ``obs_gps_baseline.xml``: Galactic Plane Survey performed with baseline arrays
  88 +* ``obs_gps_threshold.xml``: Galactic Plane Survey performed with threshold implementation
  89 +* ``obs_egal_baseline.xml``: Extragalactic Survey performed with baseline arrays
  90 +* ``obs_egal_threshold.xml``: Extragalactic Survey performed with threshold implementation
  91 +* ``obs_all_baseline.xml``: Both surveys performed with baseline arrays
  92 +* ``obs_all_threshold.xml``: Both surveys performed with threshold implementation
  93 +
  94 +The ``models`` folder contains the definitions of all source and background
  95 +models that have been used for simulating the data.
  96 +The file ``models_gps.xml`` is a so called
  97 +:ref:`Model Definition File <glossary_moddef>`
  98 +that collects the definition of all model components used for the Galactic
  99 +Plane Survey simulation.
  100 +The file ``models_egal.xml`` is the equivalent file for the Extragalactic
  101 +Survey.
  102 +The other files in the folder are FITS files containing sky maps that were
  103 +used as spatial templates for modelling extended or diffuse emission components.
  104 +There files are reference in the
  105 +:ref:`Model Definition File <glossary_moddef>`
  106 +files.
  107 +
  108 +
  109 +
... ...
doc/source/users/tutorials/1dc/first_fitting.rst 0 → 100644
  1 +.. _1dc_first_fitting:
  2 +
  3 +Fitting the model components to the data
  4 +----------------------------------------
  5 +
  6 +.. code-block:: bash
  7 +
  8 + $ ctlike
  9 + Input event list, counts cube or observation definition XML file [events.fits] obs.xml
  10 + Input model XML file [$CTOOLS/share/models/crab.xml] models.xml
  11 + Output model XML file [crab_results.xml] results.xml
... ...
doc/source/users/tutorials/1dc/first_residuals.rst 0 → 100644
  1 +.. _1dc_first_residuals:
  2 +
  3 +Inspecting the residuals
  4 +------------------------
  5 +
  6 +.. code-block:: bash
  7 +
  8 + $ csresmap
  9 + Input event list, counts cube, or observation definition XML file [obs.xml]
  10 + Input model XML file [results.xml]
  11 + First coordinate of image center in degrees (RA or galactic l) (0-360) [0.0]
  12 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [0.0]
  13 + Lower energy limit (TeV) [0.1]
  14 + Upper energy limit (TeV) [100.0]
  15 + Coordinate System (CEL|GAL) [GAL]
  16 + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR]
  17 + Size of the X axis in pixels [200]
  18 + Size of the Y axis in pixels [200] 100
  19 + Pixel size (deg/pixel) [0.1] 0.05
  20 + Residual map computation algorithm (SUB|SUBDIV|SUBDIVSQRT) [SUB]
  21 + Output residual map file [resmap.fits]
... ...
doc/source/users/tutorials/1dc/first_select_models.rst 0 → 100644
  1 +.. _1dc_select_models:
  2 +
  3 +Selecting the relevant model components
  4 +---------------------------------------
  5 +
  6 +.. code-block:: bash
  7 +
  8 + $ csmodelselect fluxlimit=1.0e-10
  9 + Input event list or observation definition XML file [obs.xml]
  10 + Input model definition XML file [inmodel.xml] ../models/models_gps.xml
  11 + Output model definition XML file [outmodel.xml] models.xml
... ...
doc/source/users/tutorials/1dc/first_select_obs.rst 0 → 100644
  1 +.. _1dc_first_select_obs:
  2 +
  3 +Selecting the relevant observations
  4 +-----------------------------------
  5 +
  6 +Let us in the following assume that you want to analyse the Galactic Plane
  7 +Survey data obtained with baseline arrays around the Galactic Centre.
  8 +For the purpose of this first analysis, you should create a subfolder under
  9 +the ``1dc`` folder (or any other convenient place) that will contain the
  10 +results for your first analysis.
  11 +You do this by typing:
  12 +
  13 +.. code-block:: bash
  14 +
  15 + $ cd 1dc
  16 + $ mkdir my_first_analysis
  17 + $ cd my_first_analysis
  18 +
  19 +The first step of the analysis consists in selecting the observations from the
  20 +:ref:`Observation Definition File <glossary_obsdef>`
  21 +``obs_gps_baseline.xml`` that have pointing directions close to the Galactic
  22 +Centre.
  23 +You do this with the :ref:`csobsselect` script by typing:
  24 +
  25 +.. code-block:: bash
  26 +
  27 + $ csobsselect
  28 + Input event list or observation definition XML file [obs.xml] ../data/obs_gps_baseline.xml
  29 + Pointing selection region shape (CIRCLE|BOX) [CIRCLE]
  30 + Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] GAL
  31 + Galactic longitude of selection centre (deg) (0-360) [184.56] 0.0
  32 + Galactic latitude of selection centre (deg) (-90-90) [-5.79] 0.0
  33 + Radius of selection circle (deg) (0-180) [5.0]
  34 + Output observation definition XML file [outobs.xml] obs.xml
  35 +
  36 +You selected ``CIRCLE`` as the shape of the pointing selection region,
  37 +specified the Galactic Centre as the centre of the selection region, and
  38 +selected all observations with pointing directions within 5 degrees from
  39 +the Galactic Centre from the ``obs_gps_baseline.xml`` file.
  40 +The selected observations are written into the file ``obs.xml`` that will be
  41 +created in the ``my_first_analysis`` folder.
  42 +The content of the file will look as follows:
  43 +
  44 +.. code-block:: xml
  45 +
  46 + <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  47 + <observation_list title="observation list">
  48 + <observation name="Galactic Plane Survey KSP" id="000020" instrument="CTA">
  49 + <parameter name="EventList" file="../data/gps_baseline_000020.fits" />
  50 + <parameter name="Calibration" database="prod2" response="South_50h" />
  51 + </observation>
  52 + <observation name="Galactic Plane Survey KSP" id="000021" instrument="CTA">
  53 + <parameter name="EventList" file="../data/gps_baseline_000021.fits" />
  54 + <parameter name="Calibration" database="prod2" response="South_50h" />
  55 + </observation>
  56 + <observation name="Galactic Plane Survey KSP" id="000022" instrument="CTA">
  57 + <parameter name="EventList" file="../data/gps_baseline_000022.fits" />
  58 + <parameter name="Calibration" database="prod2" response="South_50h" />
  59 + </observation>
  60 + ...
  61 + </observation_list>
  62 +
  63 +Each ``<observation>`` element corresponds to one observation that is identified
  64 +by a name attribute and a unique identifier attribute.
  65 +An ``<observation>`` element contains two parameters:
  66 +the ``EventList`` parameter that specifies the name of the corresponding event
  67 +file relative to the current working directory, and
  68 +the ``Calibration`` parameter that specifies the
  69 +:ref:`Instrument Response Function <glossary_irf>` that applies to the
  70 +event file.
  71 +
... ...
doc/source/users/tutorials/1dc/first_skymap.png 0 → 100644

330 KB

doc/source/users/tutorials/1dc/first_skymap.rst 0 → 100644
  1 +.. _1dc_sky_map:
  2 +
  3 +Generating a sky map from the events
  4 +------------------------------------
  5 +
  6 +Once the observations are selected, the first thing that you want to do is to
  7 +visualize the content of the observations by generating a sky map from the
  8 +events.
  9 +You do this with the :ref:`ctskymap` tool by typing:
  10 +
  11 +.. code-block:: bash
  12 +
  13 + $ ctskymap
  14 + Input event list or observation definition XML file [events.fits] obs.xml
  15 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63] 0.0
  16 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01] 0.0
  17 + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR]
  18 + Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] GAL
  19 + Image scale (in degrees/pixel) [0.02]
  20 + Size of the X axis in pixels [200] 500
  21 + Size of the Y axis in pixels [200] 250
  22 + Lower energy limit (TeV) [0.1]
  23 + Upper energy limit (TeV) [100.0]
  24 + Output skymap file [skymap.fits]
  25 +
  26 +We generate here a sky map centred on the Galactic Centre in Galactic
  27 +coordinates using a cartesian projection.
  28 +The sky map is 10° wide and 5° high, with an image scale of 0.02° per pixel.
  29 +All events between 0.1 and 100 TeV have been collected in the skymap.
  30 +The :ref:`ctskymap` tool writes the result into the FITS file ``skymap.fits``
  31 +that will be created in the ``my_first_analysis`` folder.
  32 +The FITS file can be displayed using for example ds9 (see below):
  33 +
  34 +.. figure:: first_skymap.png
  35 + :width: 600px
  36 + :align: center
  37 +
  38 + *Sky map of the events recorded during the Galactic Plane Survey around the Galactic Centre*
  39 +
  40 +Bla
... ...
doc/source/users/tutorials/1dc/first_stacked.rst 0 → 100644
  1 +.. _1dc_first_stacked:
  2 +
  3 +Performing a stacked analysis
  4 +-----------------------------
  5 +
  6 +To be written ...
... ...
doc/source/users/tutorials/1dc/getting.rst 0 → 100644
  1 +.. _1dc_getting:
  2 +
  3 +Getting the data and analysis tools
  4 +===================================
  5 +
  6 +Getting the data
  7 +----------------
  8 +
  9 +To be written ...
  10 +
  11 +
  12 +Getting the analysis tools
  13 +--------------------------
  14 +
  15 +To be written ...
... ...
doc/source/users/tutorials/1dc/index.rst 0 → 100644
  1 +.. _1dc:
  2 +
  3 +First CTA Data Challenge
  4 +========================
  5 +
  6 +.. toctree::
  7 + :maxdepth: 2
  8 +
  9 + scope
  10 + getting
  11 + first
  12 +
... ...
doc/source/users/tutorials/1dc/scope.rst 0 → 100644
  1 +.. _1dc_scope:
  2 +
  3 +Scope of the First CTA Data Challenge
  4 +=====================================
  5 +
  6 +The primary goal of the
  7 +:ref:`First CTA Data Challenge <glossary_1dc>`
  8 +is to make the members of the CTA Consortium Science Working Groups familiar
  9 +with the CTA data format and tools and to stimulate the simulation and
  10 +benchmarking activities in the groups.
  11 +A secondary goal is to test CTA Science Analysis tools and to provide User
  12 +feedback to the code developers.
  13 +
  14 +The data distributed in the
  15 +:ref:`First CTA Data Challenge <glossary_1dc>`
  16 +are high-level data in form of
  17 +:ref:`event lists <glossary_eventlist>`
  18 +and
  19 +:ref:`Instrument Response Functions <glossary_irf>`
  20 +(data level 3).
  21 +The
  22 +:ref:`event lists <glossary_eventlist>`
  23 +have been simulated from high-level
  24 +:ref:`Instrument Response Functions <glossary_irf>`
  25 +that correspond to an ideal CTA with good and stable atmosphere and instrument
  26 +conditions; only zenith angles of 20° and 40° **(TBC)** have been simulated.
  27 +
  28 +Data are provided for the Baseline arrays and the Threshold Implementation.
  29 +
  30 +Two Key Science Projects (KSPs) have been simulated using realistic pointing
  31 +patterns:
  32 +
  33 +* the Galactic Plane Scan (GPS)
  34 +* the extragalactic survey
  35 +
  36 +The source model used for the simulations is distributed together with the
  37 +data to the CTA Consortium Science Working Groups, so that analysis results
  38 +can be compared to the Monte Carlo truth.
... ...
doc/source/users/tutorials/index.rst 0 → 100644
  1 +.. _tutorials:
  2 +
  3 +Tutorials
  4 +=========
  5 +
  6 +.. toctree::
  7 + :maxdepth: 2
  8 +
  9 + 1dc/index
... ...