Commit 6651475aa989e2f220e80d2ceb8c303dda0fb889

Authored by Jürgen Knödlseder
1 parent 6dfd7517

Enhance 1DC documentation

doc/source/users/tutorials/1dc/first.rst
... ... @@ -21,7 +21,7 @@ If this is not the case, please read :ref:`1dc_getting`.
21 21 first_data
22 22 first_select_obs
23 23 first_skymap
24   - first_select_models
  24 + first_detect
25 25 first_fitting
26 26 first_residuals
27 27 first_stacked
... ...
doc/source/users/tutorials/1dc/first_detect.rst 0 → 100644
  1 +.. _1dc_select_models:
  2 +
  3 +Detecting candidate sources
  4 +---------------------------
  5 +
  6 +As next step you need to identify the location of candidate sources in the
  7 +sky map.
  8 +You do this using the :ref:`cssrcdetect` script:
  9 +
  10 +.. code-block:: bash
  11 +
  12 + $ cssrcdetect
  13 + Input sky map file [skymap.fits]
  14 + Source model type (POINT) [POINT]
  15 + Background model type (NONE|IRF|AEFF|CUBE) [NONE] IRF
  16 + Detection threshold (Gaussian sigma) [5.0] 10.0
  17 + Output model definition XML file [models.xml]
  18 + Output DS9 region file [ds9.reg]
  19 +
  20 +This generates a
  21 +:ref:`model definition XML file <glossary_moddef>`
  22 +that contains point source model components for all sources that were detected
  23 +in the sky map.
  24 +All model components have a power law as spectral component with
  25 +parameters that correspond to 1% of the very-high-energy spectrum of the
  26 +Crab, which is a reasonable starting condition for a subsequent model
  27 +fitting using the :ref:`ctlike` tool.
  28 +To detect the sources, :ref:`cssrcdetect` employs a peak finding algorithm that
  29 +iteratively finds all peaks in the sky map above a given threshold.
  30 +The detection threshold was set here to ``10.0`` which means that only peaks
  31 +are considered that are ten standard deviations above the mean value of the
  32 +sky map pixels.
  33 +The script generated also a `ds9 <http://ds9.si.edu>`_ region file that can
  34 +be overlaid on the sky map.
  35 +Due to the relatively high threshold of ten standard deviations, only two
  36 +sources were detected.
  37 +
  38 +.. figure:: first_skymap_sources.png
  39 + :width: 600px
  40 + :align: center
  41 +
  42 + *Background subtracted sky map of the events recorded during the Galactic Plane Survey around the Galactic Centre with the detected sources overlaid*
  43 +
  44 +Below is the content of the
  45 +:ref:`model definition XML file <glossary_moddef>`
  46 +that was generated by :ref:`cssrcdetect`.
  47 +In addition to the two point sources the file also contains a background model
  48 +component of type ``CTAIrfBackground``.
  49 +This component was added since the background model type was set to ``IRF``
  50 +in the :ref:`cssrcdetect` run.
  51 +Having a background model component added allows to directly use the
  52 +:ref:`model definition XML file <glossary_moddef>`
  53 +for a model fitting with :ref:`ctlike`.
  54 +
  55 +.. code-block:: xml
  56 +
  57 + <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  58 + <source_library title="source library">
  59 + <source name="Src001" type="PointSource">
  60 + <spectrum type="PowerLaw">
  61 + <parameter name="Prefactor" value="1" error="0" scale="5.7e-18" min="0" free="1" />
  62 + <parameter name="Index" value="1" error="-0" scale="-2.48" min="-4.03225806451613" max="4.03225806451613" free="1" />
  63 + <parameter name="PivotEnergy" value="1" scale="300000" free="0" />
  64 + </spectrum>
  65 + <spatialModel type="PointSource">
  66 + <parameter name="RA" value="266.424004498437" error="0" scale="1" free="1" />
  67 + <parameter name="DEC" value="-29.0049010253548" error="0" scale="1" free="1" />
  68 + </spatialModel>
  69 + </source>
  70 + <source name="Src002" type="PointSource">
  71 + <spectrum type="PowerLaw">
  72 + <parameter name="Prefactor" value="1" error="0" scale="5.7e-18" min="0" free="1" />
  73 + <parameter name="Index" value="1" error="-0" scale="-2.48" min="-4.03225806451613" max="4.03225806451613" free="1" />
  74 + <parameter name="PivotEnergy" value="1" scale="300000" free="0" />
  75 + </spectrum>
  76 + <spatialModel type="PointSource">
  77 + <parameter name="RA" value="266.843692146479" error="0" scale="1" free="1" />
  78 + <parameter name="DEC" value="-28.1289200709305" error="0" scale="1" free="1" />
  79 + </spatialModel>
  80 + </source>
  81 + <source name="Background" type="CTAIrfBackground">
  82 + <spectrum type="PowerLaw">
  83 + <parameter name="Prefactor" value="1" error="0" scale="1" min="0" free="1" />
  84 + <parameter name="Index" value="0" error="0" scale="1" min="-10" max="10" free="1" />
  85 + <parameter name="PivotEnergy" value="1" scale="1000000" free="0" />
  86 + </spectrum>
  87 + </source>
  88 + </source_library>
  89 +
... ...
doc/source/users/tutorials/1dc/first_fitting.rst
... ... @@ -9,3 +9,39 @@ Fitting the model components to the data
9 9 Input event list, counts cube or observation definition XML file [events.fits] obs.xml
10 10 Input model XML file [$CTOOLS/share/models/crab.xml] models.xml
11 11 Output model XML file [crab_results.xml] results.xml
  12 +
  13 +
  14 +.. figure:: first_skymap_fitted.png
  15 + :width: 600px
  16 + :align: center
  17 +
  18 + *Background subtracted sky map of the events recorded during the Galactic Plane Survey around the Galactic Centre with the fitted positions of the sources shown as blue circles*
  19 +
  20 +.. code-block:: bash
  21 +
  22 + $ ctbutterfly
  23 + Input event list, counts cube or observation definition XML file [events.fits] obs.xml
  24 + Source of interest [Crab] Src001
  25 + Input model XML file [$CTOOLS/share/models/crab.xml] ctlike_unbinned_bkg_3ptsrc.xml
  26 + Start value for first energy bin in TeV [0.1]
  27 + Stop value for last energy bin in TeV [100.0]
  28 + Output ASCII file [butterfly.txt] butterfly_src001.txt
  29 +
  30 +.. code-block:: bash
  31 +
  32 + $ csspec
  33 + Input event list, counts cube, or observation definition XML file [events.fits] obs.xml
  34 + Input model XML file [results.xml] ctlike_unbinned_bkg_3ptsrc.xml
  35 + Source name [Crab] Src001
  36 + Binning algorithm (LIN|LOG|FILE) [LOG]
  37 + Lower energy limit (TeV) [0.1]
  38 + Upper energy limit (TeV) [100.0]
  39 + Number of energy bins (0=unbinned) [10]
  40 + Output spectrum file [spectrum.fits] spectrum_src001.fits
  41 +
  42 +.. figure:: first_spectrum.png
  43 + :width: 600px
  44 + :align: center
  45 +
  46 + *Butterfly diagrams determined with ctbutterfly and spectral points determined with csspec for Src001 (top) and Src002 (bottom)*
  47 +
... ...
doc/source/users/tutorials/1dc/first_select_obs.rst
... ... @@ -3,8 +3,8 @@
3 3 Selecting the relevant observations
4 4 -----------------------------------
5 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.
  6 +Let's assume that you want to analyse the Galactic Plane Survey data obtained
  7 +with the baseline array around the Galactic Centre.
8 8 For the purpose of this first analysis, you should create a subfolder under
9 9 the ``1dc`` folder (or any other convenient place) that will contain the
10 10 results for your first analysis.
... ...
doc/source/users/tutorials/1dc/first_skymap_fitted.png 0 → 100644

452 KB

doc/source/users/tutorials/1dc/first_skymap_sources.png 0 → 100644

453 KB

doc/source/users/tutorials/1dc/first_spectrum.png 0 → 100644

55.5 KB