Commit 9fb6b02a169577f5232859a56f64ce78ba18c8f2

Authored by Jürgen Knödlseder
1 parent 1c97acc1

Add tutorial for COMPTEL data analysis

doc/source/users/tutorials/howto/comptel/howto_comptel_archive.png 0 → 100644

174 KB

doc/source/users/tutorials/howto/comptel/howto_comptel_butterfly.png 0 → 100644

35.4 KB

doc/source/users/tutorials/howto/comptel/howto_comptel_butterfly.rst 0 → 100644
  1 +.. _howto_comptel_butterfly:
  2 +
  3 +Generate a butterfly diagram for a model component
  4 +--------------------------------------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to use :ref:`ctbutterfly` to create a butterfly diagram
  9 + for a model component from COMPTEL data.
  10 +
  11 +A butterfly diagram shows the envelope of all spectral models that are
  12 +statistically compatible with the data. You can create such a butterfly
  13 +diagram for the Crab using the :ref:`ctbutterfly` tool by providing
  14 +the
  15 +:ref:`model definition file <glossary_moddef>`
  16 +output file from :ref:`ctlike` as input:
  17 +
  18 +.. code-block:: bash
  19 +
  20 + $ ctbutterfly fit=yes
  21 + Input event list, counts cube or observation definition XML file [events.fits] obs.xml
  22 + Source of interest [Crab]
  23 + Input model definition XML file [$CTOOLS/share/models/crab.xml] models.xml
  24 + Start value for first energy bin in TeV [0.1] 0.00000075
  25 + Stop value for last energy bin in TeV [100.0] 0.00003
  26 + Output ASCII file [butterfly.txt]
  27 +
  28 +:ref:`ctbutterfly` produces the ASCII file ``butterfly.txt`` that contains
  29 +the envelope of the butterfly diagram. The figure below gives a graphical
  30 +representation of the envelope. The red data points show the combined
  31 +Crab nebular and pulsar spectrum from
  32 +`Kuiper et al. 2001, A&A, 378, 918 <http://cdsads.u-strasbg.fr/abs/2001A%26A...378..918K>`_
  33 +for comparison.
  34 +
  35 +.. figure:: howto_comptel_butterfly.png
  36 + :width: 600px
  37 + :align: center
  38 +
  39 + *Butterfly diagram of the fitted Crab spectrum*
... ...
doc/source/users/tutorials/howto/comptel/howto_comptel_datasets.jpg 0 → 100644

238 KB

doc/source/users/tutorials/howto/comptel/howto_comptel_download.rst 0 → 100644
  1 +.. _howto_comptel_download:
  2 +
  3 +Download COMPTEL data
  4 +---------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to prepare COMPTEL data for an analysis with
  9 + ctools.
  10 +
  11 +
  12 +COMPTEL data can be downloaded from the HEASARC data server through the
  13 +`Xamin Web Interface <https://heasarc.gsfc.nasa.gov/xamin/>`_.
  14 +As example, the figure below shows a request for data around the Crab pulsar.
  15 +
  16 +.. figure:: howto_comptel_query.jpg
  17 + :width: 600px
  18 + :align: center
  19 +
  20 + *Xamin Web Interface to query COMPTEL data*
  21 +
  22 +Click on the button ``Show table`` in the upper left which opens a new
  23 +window that shows all available data sets. Click on the ``+`` symbol of a
  24 +dataset to get a link to the data archive directory.
  25 +
  26 +.. figure:: howto_comptel_datasets.jpg
  27 + :width: 600px
  28 + :align: center
  29 +
  30 + *Available COMPTEL data for the Crab region*
  31 +
  32 +Clicking on the link brings you to the archive directory, shown below.
  33 +
  34 +.. figure:: howto_comptel_archive.png
  35 + :width: 600px
  36 + :align: center
  37 +
  38 + *COMPTEL data archive for viewing period 0001*
  39 +
  40 +The COMPTEL obervations were divided in so-called viewing periods (``vp``) of
  41 +typically 14 days. The Crab nebula was observed during many viewing periods.
  42 +In this example, the data for the viewing period 0001 was selected. From the
  43 +archive you now have to download the following files:
  44 +
  45 +* ``m32171_drx.fits.gz`` - Exposure map
  46 +* ``m34997_drg.fits.gz`` - Geometry factors (needed for response computation)
  47 +* ``m50438_dre.fits.gz`` - Counts cube for energy interval 0.75 - 1 MeV
  48 +* ``m50439_dre.fits.gz`` - Counts cube for energy interval 1 - 3 MeV
  49 +* ``m50440_dre.fits.gz`` - Counts cube for energy interval 3 - 10 MeV
  50 +* ``m50441_dre.fits.gz`` - Counts cube for energy interval 10 - 30 MeV
  51 +
  52 +The COMPTEL data are usually processed for four standard energy intervals,
  53 +and a 3-dimensional counts cube exists for each of these energy intervals.
  54 +Counts cubes are always suffixed ``_dre``, exposures ``_drx`` and geometry
  55 +factors ``_drg``.
  56 +
  57 + .. warning::
  58 +
  59 + The files in the HEASARC archive have a ``.gz`` extension but apparently
  60 + the files are not gzipped. You may however leave the file names as they
  61 + are and specify later the file names without the ``.gz`` extension since
  62 + reading of gzipped files is transparent for ctools.
... ...
doc/source/users/tutorials/howto/comptel/howto_comptel_fitting.rst 0 → 100644
  1 +.. _howto_comptel_fitting:
  2 +
  3 +Fit a model to the data
  4 +-----------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to use :ref:`ctlike` to fit a parametric model to
  9 + COMPTEL data.
  10 +
  11 +Start with creating an
  12 +:ref:`observation definition file <glossary_obsdef>`
  13 +that defines the names of the counts cube files, geometry factor files
  14 +and exposure map files. In addition you will need background model files,
  15 +but since those are not distributed with the data you will use the geometry
  16 +factors also as background files, which is a reasonable zero order
  17 +approximation of the instrumental background distribution in COMPTEL.
  18 +
  19 +Below the
  20 +:ref:`observation definition file <glossary_obsdef>`
  21 +that is needed for the following analyses. Since the four counts cubes
  22 +correspond to the four energy bands, and every observation holds a single
  23 +counts cube, an observation has been added for every energy band.
  24 +The ``IAQ`` parameter indicates the instrument response, which needs
  25 +to be given for each band in the specified format.
  26 +
  27 +.. code-block:: xml
  28 +
  29 + <?xml version="1.0" standalone="no"?>
  30 + <observation_list title="observation library">
  31 + <observation name="Crab" id="100001" instrument="COM">
  32 + <parameter name="DRE" file="m50438_dre.fits"/>
  33 + <parameter name="DRB" file="m34997_drg.fits"/>
  34 + <parameter name="DRG" file="m34997_drg.fits"/>
  35 + <parameter name="DRX" file="m32171_drx.fits"/>
  36 + <parameter name="IAQ" value="ENERG(0.75-1.0)MeV"/>
  37 + </observation>
  38 + <observation name="Crab" id="200001" instrument="COM">
  39 + <parameter name="DRE" file="m50439_dre.fits"/>
  40 + <parameter name="DRB" file="m34997_drg.fits"/>
  41 + <parameter name="DRG" file="m34997_drg.fits"/>
  42 + <parameter name="DRX" file="m32171_drx.fits"/>
  43 + <parameter name="IAQ" value="ENERG(1.0-3.0)MeV"/>
  44 + </observation>
  45 + <observation name="Crab" id="300001" instrument="COM">
  46 + <parameter name="DRE" file="m50440_dre.fits"/>
  47 + <parameter name="DRB" file="m34997_drg.fits"/>
  48 + <parameter name="DRG" file="m34997_drg.fits"/>
  49 + <parameter name="DRX" file="m32171_drx.fits"/>
  50 + <parameter name="IAQ" value="ENERG(3.0-10.0)MeV"/>
  51 + </observation>
  52 + <observation name="Crab" id="400001" instrument="COM">
  53 + <parameter name="DRE" file="m50441_dre.fits"/>
  54 + <parameter name="DRB" file="m34997_drg.fits"/>
  55 + <parameter name="DRG" file="m34997_drg.fits"/>
  56 + <parameter name="DRX" file="m32171_drx.fits"/>
  57 + <parameter name="IAQ" value="ENERG(10.0-30.0)MeV"/>
  58 + </observation>
  59 + </observation_list>
  60 +
  61 +Then you also need a
  62 +:ref:`model definition file <glossary_moddef>`
  63 +that describes the source and background model that you want to fit. In the
  64 +example below, a point source with a ower law is fit at the position of the
  65 +Crab on top of an instrumental background model.
  66 +
  67 +.. code-block:: xml
  68 +
  69 + <?xml version="1.0" standalone="no"?>
  70 + <source_library title="source library">
  71 + <source name="Crab" type="PointSource" tscalc="1">
  72 + <spectrum type="PowerLaw">
  73 + <parameter name="Prefactor" scale="1e-3" value="1.0" min="-1000.0" max="1000.0" free="1"/>
  74 + <parameter name="Index" scale="-1" value="2.0" min="-5.0" max="+5.0" free="1"/>
  75 + <parameter name="PivotEnergy" scale="1.0" value="1.65" min="0.01" max="1000.0" free="0"/>
  76 + </spectrum>
  77 + <spatialModel type="PointSource">
  78 + <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/>
  79 + <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/>
  80 + </spatialModel>
  81 + </source>
  82 + <source name="Background(0.75-1.0)MeV" type="DRBFitting" instrument="COM" id="100001">
  83 + <node>
  84 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  85 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  86 + </node>
  87 + <node>
  88 + <parameter name="Phibar" scale="1.0" value="3.0" min="0.0" max="50.0" free="0"/>
  89 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  90 + </node>
  91 + <node>
  92 + <parameter name="Phibar" scale="1.0" value="5.0" min="0.0" max="50.0" free="0"/>
  93 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  94 + </node>
  95 + <node>
  96 + <parameter name="Phibar" scale="1.0" value="7.0" min="0.0" max="50.0" free="0"/>
  97 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  98 + </node>
  99 + <node>
  100 + <parameter name="Phibar" scale="1.0" value="9.0" min="0.0" max="50.0" free="0"/>
  101 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  102 + </node>
  103 + <node>
  104 + <parameter name="Phibar" scale="1.0" value="11.0" min="0.0" max="50.0" free="0"/>
  105 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  106 + </node>
  107 + <node>
  108 + <parameter name="Phibar" scale="1.0" value="13.0" min="0.0" max="50.0" free="0"/>
  109 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  110 + </node>
  111 + <node>
  112 + <parameter name="Phibar" scale="1.0" value="15.0" min="0.0" max="50.0" free="0"/>
  113 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  114 + </node>
  115 + <node>
  116 + <parameter name="Phibar" scale="1.0" value="17.0" min="0.0" max="50.0" free="0"/>
  117 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  118 + </node>
  119 + ...
  120 + </source>
  121 + <source name="Background(1.0-3.0)MeV" type="DRBFitting" instrument="COM" id="200001">
  122 + <node>
  123 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  124 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  125 + </node>
  126 + ...
  127 + </source>
  128 + <source name="Background(3.0-10.0)MeV" type="DRBFitting" instrument="COM" id="300001">
  129 + <node>
  130 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  131 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  132 + </node>
  133 + ...
  134 + </source>
  135 + <source name="Background(10.0-30.0)MeV" type="DRBFitting" instrument="COM" id="400001">
  136 + <node>
  137 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  138 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  139 + </node>
  140 + ...
  141 + </source>
  142 + </source_library>
  143 +
  144 +Since the file is relatively long it is not entirely reproduced here, but you
  145 +can download the file :download:`models.xml <models.xml>` by clicking on
  146 +the file name.
  147 +
  148 +The first source in the
  149 +:ref:`model definition file <glossary_moddef>`
  150 +is the point source for the Crab, the next four sources are background
  151 +model components for each of the energy bands.
  152 +
  153 +You may have recognised the ``id`` attribute for each model component. This
  154 +attribute links a given model component to a given observation. For example,
  155 +``Background(1.0-3.0)MeV`` has ``id="200001"`` and will hence only be used
  156 +to model the background for the observation that corresponds to the 1 - 3 MeV
  157 +band.
  158 +
  159 +Each background model implements a so called Phibar-fitting of the file that
  160 +was specified for the background model (recall that you specified the geometry
  161 +factors as background model). Phibar-fitting means that the background model
  162 +is fitted to the data for each Phibar-layer of the counts cube. Each background
  163 +model is composed of 25 nodes, corresponding to the number of Phibar layers
  164 +of a COMPTEL counts cube, and each node is defined by it's Phibar value
  165 +(a fixed parameter) and it's Normalization (in general a free parameter).
  166 +For some background models some normalizations of Phibar layers have been set
  167 +to zero and the parameters fixed to exclude layers from the fitting that do
  168 +not contain any data (the filling-factor of a counts cube is energy dependent;
  169 +for the 0.75 - 1 MeV energy bin the first 8 layers are in fact empty).
  170 +
  171 +Now you are ready to fit the model using the :ref:`ctlike` model tool. You do
  172 +this as follows:
  173 +
  174 +.. code-block:: bash
  175 +
  176 + $ ctlike
  177 + Input event list, counts cube or observation definition XML file [events.fits] obs.xml
  178 + Input model definition XML file [$CTOOLS/share/models/crab.xml] models.xml
  179 + Output model definition XML file [crab_results.xml]
  180 +
  181 +:ref:`ctlike` creates on output the
  182 +:ref:`model definition file <glossary_moddef>`
  183 +``crab_results.xml`` where the parameter values were updated by their
  184 +fitted values, and where the statistical uncertainties were added using the
  185 +``error`` attribute. To investigate how the fit went you should inspect the
  186 +log file ``ctlike.log`` that was also created by :ref:`ctlike`:
  187 +
  188 +.. code-block:: bash
  189 +
  190 + 2017-08-26T22:05:05: +=================================+
  191 + 2017-08-26T22:05:05: | Maximum likelihood optimisation |
  192 + 2017-08-26T22:05:05: +=================================+
  193 + 2017-08-26T22:05:06: >Iteration 0: -logL=988086.091, Lambda=1.0e-03
  194 + 2017-08-26T22:05:07: >Iteration 1: -logL=670534.792, Lambda=1.0e-03, delta=317551.299, step=1.0e+00, max(|grad|)=86219.859480 [Index:3]
  195 + 2017-08-26T22:05:08: >Iteration 2: -logL=387046.862, Lambda=1.0e-04, delta=283487.930, step=1.0e+00, max(|grad|)=69886.869623 [Index:3]
  196 + 2017-08-26T22:05:08: >Iteration 3: -logL=154426.362, Lambda=1.0e-05, delta=232620.499, step=1.0e+00, max(|grad|)=47994.333526 [Index:3]
  197 + 2017-08-26T22:05:09: >Iteration 4: -logL=-12393.885, Lambda=1.0e-06, delta=166820.247, step=1.0e+00, max(|grad|)=24763.811238 [Index:3]
  198 + 2017-08-26T22:05:10: >Iteration 5: -logL=-108271.655, Lambda=1.0e-07, delta=95877.770, step=1.0e+00, max(|grad|)=7544.090872 [Index:3]
  199 + 2017-08-26T22:05:11: >Iteration 6: -logL=-145906.957, Lambda=1.0e-08, delta=37635.302, step=1.0e+00, max(|grad|)=1167.483336 [Index:3]
  200 + 2017-08-26T22:05:12: >Iteration 7: -logL=-152898.212, Lambda=1.0e-09, delta=6991.255, step=1.0e+00, max(|grad|)=110.879761 [Index:3]
  201 + 2017-08-26T22:05:12: >Iteration 8: -logL=-153217.134, Lambda=1.0e-10, delta=318.921, step=1.0e+00, max(|grad|)=-2.969681 [Scale factor 2:111]
  202 + 2017-08-26T22:05:13: >Iteration 9: -logL=-153218.344, Lambda=1.0e-11, delta=1.210, step=1.0e+00, max(|grad|)=-0.047390 [Index:3]
  203 + 2017-08-26T22:05:14: >Iteration 10: -logL=-153218.344, Lambda=1.0e-12, delta=0.000, step=1.0e+00, max(|grad|)=-0.001891 [Index:3]
  204 + 2017-08-26T22:05:15:
  205 + 2017-08-26T22:05:15: +====================================+
  206 + 2017-08-26T22:05:15: | Maximum likelihood re-optimisation |
  207 + 2017-08-26T22:05:15: +====================================+
  208 + 2017-08-26T22:05:15: >Iteration 0: -logL=-152378.830, Lambda=1.0e-03
  209 + 2017-08-26T22:05:16: >Iteration 1: -logL=-152759.255, Lambda=1.0e-03, delta=380.425, step=1.0e+00, max(|grad|)=-2.480864 [Scale factor 10:21]
  210 + 2017-08-26T22:05:16: >Iteration 2: -logL=-152760.518, Lambda=1.0e-04, delta=1.264, step=1.0e+00, max(|grad|)=-0.019031 [Scale factor 10:21]
  211 + 2017-08-26T22:05:16: >Iteration 3: -logL=-152760.518, Lambda=1.0e-05, delta=0.000, step=1.0e+00, max(|grad|)=-0.000001 [Scale factor 10:21]
  212 + 2017-08-26T22:05:16:
  213 + 2017-08-26T22:05:16: +============================================+
  214 + 2017-08-26T22:05:16: | Maximum likelihood re-optimisation results |
  215 + 2017-08-26T22:05:16: +============================================+
  216 + 2017-08-26T22:05:16: === GOptimizerLM ===
  217 + 2017-08-26T22:05:16: Optimized function value ..: -152760.518
  218 + 2017-08-26T22:05:16: Absolute precision ........: 0.005
  219 + 2017-08-26T22:05:16: Acceptable value decrease .: 2
  220 + 2017-08-26T22:05:16: Optimization status .......: converged
  221 + 2017-08-26T22:05:16: Number of parameters ......: 200
  222 + 2017-08-26T22:05:16: Number of free parameters .: 87
  223 + 2017-08-26T22:05:16: Number of iterations ......: 3
  224 + 2017-08-26T22:05:16: Lambda ....................: 1e-06
  225 + 2017-08-26T22:05:16:
  226 + 2017-08-26T22:05:16: +=========================================+
  227 + 2017-08-26T22:05:16: | Maximum likelihood optimisation results |
  228 + 2017-08-26T22:05:16: +=========================================+
  229 + 2017-08-26T22:05:16: === GOptimizerLM ===
  230 + 2017-08-26T22:05:16: Optimized function value ..: -153218.344
  231 + 2017-08-26T22:05:16: Absolute precision ........: 0.005
  232 + 2017-08-26T22:05:16: Acceptable value decrease .: 2
  233 + 2017-08-26T22:05:16: Optimization status .......: converged
  234 + 2017-08-26T22:05:16: Number of parameters ......: 206
  235 + 2017-08-26T22:05:16: Number of free parameters .: 89
  236 + 2017-08-26T22:05:16: Number of iterations ......: 10
  237 + 2017-08-26T22:05:16: Lambda ....................: 1e-13
  238 + 2017-08-26T22:05:16: Maximum log likelihood ....: 153218.344
  239 + 2017-08-26T22:05:16: Observed events (Nobs) ...: 527595.000
  240 + 2017-08-26T22:05:16: Predicted events (Npred) ..: 527594.000 (Nobs - Npred = 1.00004221417475)
  241 + 2017-08-26T22:05:16: === GModels ===
  242 + 2017-08-26T22:05:16: Number of models ..........: 5
  243 + 2017-08-26T22:05:16: Number of parameters ......: 206
  244 + 2017-08-26T22:05:16: === GModelSky ===
  245 + 2017-08-26T22:05:16: Name ......................: Crab
  246 + 2017-08-26T22:05:16: Instruments ...............: all
  247 + 2017-08-26T22:05:16: Test Statistic ............: 915.650908945536
  248 + 2017-08-26T22:05:16: Instrument scale factors ..: unity
  249 + 2017-08-26T22:05:16: Observation identifiers ...: all
  250 + 2017-08-26T22:05:16: Model type ................: PointSource
  251 + 2017-08-26T22:05:16: Model components ..........: "PointSource" * "PowerLaw" * "Constant"
  252 + 2017-08-26T22:05:16: Number of parameters ......: 6
  253 + 2017-08-26T22:05:16: Number of spatial par's ...: 2
  254 + 2017-08-26T22:05:16: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  255 + 2017-08-26T22:05:16: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  256 + 2017-08-26T22:05:16: Number of spectral par's ..: 3
  257 + 2017-08-26T22:05:16: Prefactor ................: 0.00237517119227384 +/- 0.000107673211964802 [-1,1] ph/cm2/s/MeV (free,scale=0.001,gradient)
  258 + 2017-08-26T22:05:16: Index ....................: -2.47153532398462 +/- 0.0500838601327289 [5,-5] (free,scale=-1,gradient)
  259 + 2017-08-26T22:05:16: PivotEnergy ..............: 1 [0.01,1000] MeV (fixed,scale=1,gradient)
  260 + 2017-08-26T22:05:16: Number of temporal par's ..: 1
  261 + 2017-08-26T22:05:16: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  262 +
  263 +The fit converged after 10 iterations and did a second fit without the
  264 +source component to determine the Test Statistic value of the Crab.
  265 +The source is detected with a Test Statistic of 915.7 which corresponds to
  266 +a detection significance of about 30 sigma.
  267 +
  268 + .. note::
  269 +
  270 + `Kuiper et al. 2001, A&A, 378, 918 <http://cdsads.u-strasbg.fr/abs/2001A%26A...378..918K>`_
  271 + presented the most comprehensive analysis of the COMPTEL Crab observations
  272 + and summarize in their Table 3 the gamma-ray intensity as function of
  273 + energy for the unpulsed and pulsed component of source. By adding the
  274 + intensities and fitting the resulting values we obtained a prefactor
  275 + of 2.5e-3, which is very close to the prefactor of 2.4e-3 obtained
  276 + in the analysis above. The spectral index of the Kuiper's data is
  277 + -2.2, a bit harder than the index of -2.5 obtained in the fit.
  278 +
  279 + .. note::
  280 +
  281 + The position of a point source can also be adjusted by :ref:`ctlike` for
  282 + an analysis of COMPTEL data, hence you may set the corresponding parameters
  283 + to ``free="1"`` to determine also the best fitting source position.
  284 +
  285 + .. warning::
  286 +
  287 + ctools supports for the moment only the fitting of point sources for
  288 + COMPTEL data. Other spatial shapes will be implemented in the future.
... ...
doc/source/users/tutorials/howto/comptel/howto_comptel_query.jpg 0 → 100644

262 KB

doc/source/users/tutorials/howto/comptel/howto_comptel_spectrum.png 0 → 100644

22.7 KB

doc/source/users/tutorials/howto/comptel/howto_comptel_spectrum.rst 0 → 100644
  1 +.. _howto_comptel_spectrum:
  2 +
  3 +Generate a spectral energy distribution for a source
  4 +----------------------------------------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to use :ref:`ctlike` to derive the spectral energy
  9 + density of a source from COMPTEL data.
  10 +
  11 +So far the :ref:`csspec` script does not work for COMPTEL data, but you
  12 +will learn here a method that you can use to derive the spectrum of any
  13 +source using COMPTEL data. For this you have to modify the
  14 +:ref:`model definition file <glossary_moddef>`
  15 +and replace the spectral component of the Crab by a node function:
  16 +
  17 +.. code-block:: xml
  18 +
  19 + <?xml version="1.0" standalone="no"?>
  20 + <source_library title="source library">
  21 + <source name="Crab" type="PointSource" tscalc="1">
  22 + <spectrum type="NodeFunction">
  23 + <node>
  24 + <parameter name="Energy" value="0.75" scale="1" free="0" />
  25 + <parameter name="Intensity" value="0.00177777777777778" error="0" scale="1" min="1e-30" free="1" />
  26 + </node>
  27 + <node>
  28 + <parameter name="Energy" value="2.56496392001505" scale="1" free="0" />
  29 + <parameter name="Intensity" value="0.000151997861926818" error="0" scale="1" min="1e-30" free="1" />
  30 + </node>
  31 + <node>
  32 + <parameter name="Energy" value="8.7720532146386" scale="1" free="0" />
  33 + <parameter name="Intensity" value="1.29956343920572e-05" error="0" scale="1" min="1e-30" free="1" />
  34 + </node>
  35 + <node>
  36 + <parameter name="Energy" value="30" scale="1" free="0" />
  37 + <parameter name="Intensity" value="1.11111111111111e-06" error="0" scale="1" min="1e-30" free="1" />
  38 + </node>
  39 + </spectrum>
  40 + <spatialModel type="PointSource">
  41 + <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/>
  42 + <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/>
  43 + </spatialModel>
  44 + </source>
  45 + <source name="Background(0.75-1.0)MeV" type="DRBFitting" instrument="COM" id="100001">
  46 + <node>
  47 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  48 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  49 + </node>
  50 + ...
  51 + </source_library>
  52 +
  53 +Instead of the power law the model now contains a node function with four
  54 +intensity nodes between 0.75 MeV and 30 MeV, and the :ref:`ctlike` tool will
  55 +now adjust the intensities of each of the nodes which will result in a
  56 +spectrum. To do this type now:
  57 +
  58 +.. code-block:: bash
  59 +
  60 + $ ctlike
  61 + Input event list, counts cube or observation definition XML file [obs.xml]
  62 + Input model definition XML file [models.xml] model_nodes.xml
  63 + Output model definition XML file [crab_results.xml] crab_nodes_results.xml
  64 +
  65 +This will produce the
  66 +:ref:`model definition file <glossary_moddef>`
  67 +``crab_nodes_results.xml`` with the intensities of the fitted source at
  68 +each energy. The results are displayed graphically below. The red data points
  69 +show the combined Crab nebular and pulsar spectrum from
  70 +`Kuiper et al. 2001, A&A, 378, 918 <http://cdsads.u-strasbg.fr/abs/2001A%26A...378..918K>`_
  71 +for comparison.
  72 +
  73 +.. figure:: howto_comptel_spectrum.png
  74 + :width: 600px
  75 + :align: center
  76 +
  77 + *Spectrum of the Crab derived using a node function*
  78 +..
  79 +
  80 + .. note::
  81 +
  82 + The ``NodeFunction`` spectral models implements a piece-wise power law
  83 + that is defined by the intensity values at each node.
... ...
doc/source/users/tutorials/howto/comptel/howto_comptel_tsmap.png 0 → 100644

20.1 KB

doc/source/users/tutorials/howto/comptel/howto_comptel_tsmap.rst 0 → 100644
  1 +.. _howto_comptel_tsmap:
  2 +
  3 +Generate a Test Statistic map
  4 +-----------------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to use :ref:`cttsmap` to generate a Test Staristic
  9 + map from COMPTEL data.
  10 +
  11 +The Test Statistic (or maximum likelihood ratio) is a measure of the detection
  12 +significance of a gamma-ray source. By displacing the location of a test source
  13 +on a grid of positions you can generate a Test Statistic map that helps in
  14 +finding significant source and assessing the position uncertainty of a
  15 +source. You do this by using the :ref:`cttsmap` tool as follows:
  16 +
  17 +.. code-block:: bash
  18 +
  19 + $ cttsmap
  20 + Input event list, counts cube or observation definition XML file [events.fits] obs.xml
  21 + Test source name [Crab]
  22 + Input model definition XML file [$CTOOLS/share/models/crab.xml] models.xml
  23 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63]
  24 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01]
  25 + Projection method (AIT|AZP|CAR|GLS|MER|MOL|SFL|SIN|STG|TAN) [CAR]
  26 + Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
  27 + Image scale (in degrees/pixel) [0.02] 1.0
  28 + Size of the X axis in pixels [200] 10
  29 + Size of the Y axis in pixels [200] 10
  30 + Output Test Statistic map file [tsmap.fits]
  31 +
  32 +:ref:`cttsmap` created a 10 x 10 pixels map with a pixel size of 1 degree
  33 +around the location of the Crab and saved the result in the FITS file
  34 +``tsmap.fits``. The file also contains the values of all fitted parameters
  35 +at each grid position. The Test Statistics map is displayed using
  36 +`ds9 <http://ds9.si.edu>`_ in the figure below:
  37 +
  38 +.. figure:: howto_comptel_tsmap.png
  39 + :width: 400px
  40 + :align: center
  41 +
  42 + *Test Statistic map for COMPTEL viewing period 1 of the Crab nebula*
... ...
doc/source/users/tutorials/howto/comptel/howto_comptel_ulimit.rst 0 → 100644
  1 +.. _howto_comptel_ulimit:
  2 +
  3 +Derive upper flux limits for a source
  4 +-------------------------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to use :ref:`ctulimit` to determine upper flux limits
  9 + from COMPTEL data using a likelihood profile method.
  10 +
  11 +Suppose we have tried to get the flux from a source, for example the Vela
  12 +pulsar, but we have not managed to detect the source and now want to determine
  13 +an upper flux limit for that object. You can do this with the :ref:`ctulimit`
  14 +tool.
  15 +
  16 +First you have to retreive the COMPTEL data for the Vela pulsar. You can
  17 +do this by following
  18 +:ref:`the tutorial that explains how to download COMPTEL data <howto_comptel_download>`.
  19 +Suppose you have selected the data from viewing period 8. You then have to
  20 +create the following
  21 +:ref:`observation definition file <glossary_obsdef>`:
  22 +
  23 +.. code-block:: xml
  24 +
  25 + <?xml version="1.0" standalone="no"?>
  26 + <observation_list title="observation library">
  27 + <observation name="Vela" id="100001" instrument="COM">
  28 + <parameter name="DRE" file="m50866_dre.fits"/>
  29 + <parameter name="DRB" file="m35330_drg.fits"/>
  30 + <parameter name="DRG" file="m35330_drg.fits"/>
  31 + <parameter name="DRX" file="m32504_drx.fits"/>
  32 + <parameter name="IAQ" value="ENERG(0.75-1.0)MeV"/>
  33 + </observation>
  34 + <observation name="Vela" id="200001" instrument="COM">
  35 + <parameter name="DRE" file="m50867_dre.fits"/>
  36 + <parameter name="DRB" file="m35330_drg.fits"/>
  37 + <parameter name="DRG" file="m35330_drg.fits"/>
  38 + <parameter name="DRX" file="m32504_drx.fits"/>
  39 + <parameter name="IAQ" value="ENERG(1.0-3.0)MeV"/>
  40 + </observation>
  41 + <observation name="Vela" id="300001" instrument="COM">
  42 + <parameter name="DRE" file="m50868_dre.fits"/>
  43 + <parameter name="DRB" file="m35330_drg.fits"/>
  44 + <parameter name="DRG" file="m35330_drg.fits"/>
  45 + <parameter name="DRX" file="m32504_drx.fits"/>
  46 + <parameter name="IAQ" value="ENERG(3.0-10.0)MeV"/>
  47 + </observation>
  48 + <observation name="Vela" id="400001" instrument="COM">
  49 + <parameter name="DRE" file="m50869_dre.fits"/>
  50 + <parameter name="DRB" file="m35330_drg.fits"/>
  51 + <parameter name="DRG" file="m35330_drg.fits"/>
  52 + <parameter name="DRX" file="m32504_drx.fits"/>
  53 + <parameter name="IAQ" value="ENERG(10.0-30.0)MeV"/>
  54 + </observation>
  55 + </observation_list>
  56 +
  57 +As next step you have to create a
  58 +:ref:`model definition file <glossary_moddef>`.
  59 +You can copy the file used for the Crab and adjust the point source
  60 +component as shown below. Note that you need to fix the spectral index, and
  61 +you should also constrain the ``Prefactor`` to positive values.
  62 +
  63 +.. code-block:: xml
  64 +
  65 + <?xml version="1.0" standalone="no"?>
  66 + <source_library title="source library">
  67 + <source name="Vela" type="PointSource">
  68 + <spectrum type="PowerLaw">
  69 + <parameter name="Prefactor" scale="1e-3" value="1.0" min="0.0" max="1000.0" free="1"/>
  70 + <parameter name="Index" scale="-1" value="1.5" min="0.0" max="+5.0" free="0"/>
  71 + <parameter name="PivotEnergy" scale="1.0" value="1.0" min="0.01" max="1000.0" free="0"/>
  72 + </spectrum>
  73 + <spatialModel type="PointSource">
  74 + <parameter name="RA" scale="1.0" value="128.84" min="-360" max="360" free="0"/>
  75 + <parameter name="DEC" scale="1.0" value="-45.18" min="-90" max="90" free="0"/>
  76 + </spatialModel>
  77 + </source>
  78 + <source name="Background(0.75-1.0)MeV" type="DRBFitting" instrument="COM" id="100001">
  79 + ...
  80 + </source_library>
  81 +
  82 +Now you can run the :ref:`ctulimit` tool as follows. Since the tool is normally
  83 +tuned for Cherenkov Telescope data analysis, energies are by default given in
  84 +TeV. To specify a reference energy of the differential flux limit of 1 MeV you
  85 +need to provide the hidden parameter ``eref=0.000001``. You can also set the
  86 +flux interval for the intergal flux computation to 0.75 - 30 MeV by
  87 +specifying ``emin=0.000000075 emax=0.00003`` (all values are given in TeV):
  88 +
  89 +.. code-block:: bash
  90 +
  91 + $ ctulimit eref=0.000001 emin=0.000000075 emax=0.00003
  92 + Input event list, counts cube or observation definition XML file [events.fits] obs.xml
  93 + Source of interest [Crab] Vela
  94 + Input model definition XML file [$CTOOLS/share/models/crab.xml] models.xml
  95 +
  96 +The results of the upper limit computation can then be extracted from the
  97 +``ctulimit.log`` file that is created by :ref:`ctulimit`:
  98 +
  99 +.. code-block:: bash
  100 +
  101 + 2017-08-27T08:13:44: +=====================+
  102 + 2017-08-27T08:13:44: | Upper limit results |
  103 + 2017-08-27T08:13:44: +=====================+
  104 + 2017-08-27T08:13:44: Differential flux limit ...: 9.26955448510129e-06 ph/cm2/s/MeV at 1e-06 TeV
  105 + 2017-08-27T08:13:44: Integral flux limit .......: 6.43104918005e-05 ph/cm2/s within [7.5e-08-3e-05] TeV
  106 + 2017-08-27T08:13:44: Energy flux limit .........: 1.54555137999306e-10 erg/cm2/s within [7.5e-08-3e-05] TeV
... ...
doc/source/users/tutorials/howto/comptel/index.rst 0 → 100644
  1 +.. _howto_comptel:
  2 +
  3 +Analysing COMPTEL data
  4 +----------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to analyse data from the COMPTEL telescope about NASA's
  9 + `CGRO <https://heasarc.gsfc.nasa.gov/docs/cgro/cgro.html>`_
  10 + satellite with ctools.
  11 +
  12 +You can use ctools to analyse data from the COMPTEL telescope aboard NASA's
  13 +`CGRO <https://heasarc.gsfc.nasa.gov/docs/cgro/cgro.html>`_ satellite.
  14 +In this tutorial you will learn how to do that with a simple analysis.
  15 +
  16 +.. toctree::
  17 + :maxdepth: 1
  18 +
  19 + howto_comptel_download
  20 + howto_comptel_fitting
  21 + howto_comptel_butterfly
  22 + howto_comptel_spectrum
  23 + howto_comptel_tsmap
  24 + howto_comptel_ulimit
... ...
doc/source/users/tutorials/howto/comptel/models.xml 0 → 100644
  1 +<?xml version="1.0" standalone="no"?>
  2 +<source_library title="source library">
  3 + <source name="Crab" type="PointSource" tscalc="1">
  4 + <spectrum type="PowerLaw">
  5 + <parameter name="Prefactor" scale="1e-3" value="1.0" min="-1000.0" max="1000.0" free="1"/>
  6 + <parameter name="Index" scale="-1" value="2.0" min="-5.0" max="+5.0" free="1"/>
  7 + <parameter name="PivotEnergy" scale="1.0" value="1.0" min="0.01" max="1000.0" free="0"/>
  8 + </spectrum>
  9 + <spatialModel type="PointSource">
  10 + <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="0"/>
  11 + <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/>
  12 + </spatialModel>
  13 + </source>
  14 + <source name="Background(0.75-1.0)MeV" type="DRBFitting" instrument="COM" id="100001">
  15 + <node>
  16 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  17 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  18 + </node>
  19 + <node>
  20 + <parameter name="Phibar" scale="1.0" value="3.0" min="0.0" max="50.0" free="0"/>
  21 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  22 + </node>
  23 + <node>
  24 + <parameter name="Phibar" scale="1.0" value="5.0" min="0.0" max="50.0" free="0"/>
  25 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  26 + </node>
  27 + <node>
  28 + <parameter name="Phibar" scale="1.0" value="7.0" min="0.0" max="50.0" free="0"/>
  29 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  30 + </node>
  31 + <node>
  32 + <parameter name="Phibar" scale="1.0" value="9.0" min="0.0" max="50.0" free="0"/>
  33 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  34 + </node>
  35 + <node>
  36 + <parameter name="Phibar" scale="1.0" value="11.0" min="0.0" max="50.0" free="0"/>
  37 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  38 + </node>
  39 + <node>
  40 + <parameter name="Phibar" scale="1.0" value="13.0" min="0.0" max="50.0" free="0"/>
  41 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  42 + </node>
  43 + <node>
  44 + <parameter name="Phibar" scale="1.0" value="15.0" min="0.0" max="50.0" free="0"/>
  45 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  46 + </node>
  47 + <node>
  48 + <parameter name="Phibar" scale="1.0" value="17.0" min="0.0" max="50.0" free="0"/>
  49 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  50 + </node>
  51 + <node>
  52 + <parameter name="Phibar" scale="1.0" value="19.0" min="0.0" max="50.0" free="0"/>
  53 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  54 + </node>
  55 + <node>
  56 + <parameter name="Phibar" scale="1.0" value="21.0" min="0.0" max="50.0" free="0"/>
  57 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  58 + </node>
  59 + <node>
  60 + <parameter name="Phibar" scale="1.0" value="23.0" min="0.0" max="50.0" free="0"/>
  61 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  62 + </node>
  63 + <node>
  64 + <parameter name="Phibar" scale="1.0" value="25.0" min="0.0" max="50.0" free="0"/>
  65 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  66 + </node>
  67 + <node>
  68 + <parameter name="Phibar" scale="1.0" value="27.0" min="0.0" max="50.0" free="0"/>
  69 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  70 + </node>
  71 + <node>
  72 + <parameter name="Phibar" scale="1.0" value="29.0" min="0.0" max="50.0" free="0"/>
  73 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  74 + </node>
  75 + <node>
  76 + <parameter name="Phibar" scale="1.0" value="31.0" min="0.0" max="50.0" free="0"/>
  77 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  78 + </node>
  79 + <node>
  80 + <parameter name="Phibar" scale="1.0" value="33.0" min="0.0" max="50.0" free="0"/>
  81 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  82 + </node>
  83 + <node>
  84 + <parameter name="Phibar" scale="1.0" value="35.0" min="0.0" max="50.0" free="0"/>
  85 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  86 + </node>
  87 + <node>
  88 + <parameter name="Phibar" scale="1.0" value="37.0" min="0.0" max="50.0" free="0"/>
  89 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  90 + </node>
  91 + <node>
  92 + <parameter name="Phibar" scale="1.0" value="39.0" min="0.0" max="50.0" free="0"/>
  93 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  94 + </node>
  95 + <node>
  96 + <parameter name="Phibar" scale="1.0" value="41.0" min="0.0" max="50.0" free="0"/>
  97 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  98 + </node>
  99 + <node>
  100 + <parameter name="Phibar" scale="1.0" value="43.0" min="0.0" max="50.0" free="0"/>
  101 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  102 + </node>
  103 + <node>
  104 + <parameter name="Phibar" scale="1.0" value="45.0" min="0.0" max="50.0" free="0"/>
  105 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  106 + </node>
  107 + <node>
  108 + <parameter name="Phibar" scale="1.0" value="47.0" min="0.0" max="50.0" free="0"/>
  109 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  110 + </node>
  111 + <node>
  112 + <parameter name="Phibar" scale="1.0" value="49.0" min="0.0" max="50.0" free="0"/>
  113 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  114 + </node>
  115 + </source>
  116 + <source name="Background(1.0-3.0)MeV" type="DRBFitting" instrument="COM" id="200001">
  117 + <node>
  118 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  119 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  120 + </node>
  121 + <node>
  122 + <parameter name="Phibar" scale="1.0" value="3.0" min="0.0" max="50.0" free="0"/>
  123 + <parameter name="Normalization" scale="1.0" value="0.0" min="0.0" max="1000.0" free="0"/>
  124 + </node>
  125 + <node>
  126 + <parameter name="Phibar" scale="1.0" value="5.0" min="0.0" max="50.0" free="0"/>
  127 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  128 + </node>
  129 + <node>
  130 + <parameter name="Phibar" scale="1.0" value="7.0" min="0.0" max="50.0" free="0"/>
  131 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  132 + </node>
  133 + <node>
  134 + <parameter name="Phibar" scale="1.0" value="9.0" min="0.0" max="50.0" free="0"/>
  135 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  136 + </node>
  137 + <node>
  138 + <parameter name="Phibar" scale="1.0" value="11.0" min="0.0" max="50.0" free="0"/>
  139 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  140 + </node>
  141 + <node>
  142 + <parameter name="Phibar" scale="1.0" value="13.0" min="0.0" max="50.0" free="0"/>
  143 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  144 + </node>
  145 + <node>
  146 + <parameter name="Phibar" scale="1.0" value="15.0" min="0.0" max="50.0" free="0"/>
  147 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  148 + </node>
  149 + <node>
  150 + <parameter name="Phibar" scale="1.0" value="17.0" min="0.0" max="50.0" free="0"/>
  151 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  152 + </node>
  153 + <node>
  154 + <parameter name="Phibar" scale="1.0" value="19.0" min="0.0" max="50.0" free="0"/>
  155 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  156 + </node>
  157 + <node>
  158 + <parameter name="Phibar" scale="1.0" value="21.0" min="0.0" max="50.0" free="0"/>
  159 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  160 + </node>
  161 + <node>
  162 + <parameter name="Phibar" scale="1.0" value="23.0" min="0.0" max="50.0" free="0"/>
  163 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  164 + </node>
  165 + <node>
  166 + <parameter name="Phibar" scale="1.0" value="25.0" min="0.0" max="50.0" free="0"/>
  167 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  168 + </node>
  169 + <node>
  170 + <parameter name="Phibar" scale="1.0" value="27.0" min="0.0" max="50.0" free="0"/>
  171 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  172 + </node>
  173 + <node>
  174 + <parameter name="Phibar" scale="1.0" value="29.0" min="0.0" max="50.0" free="0"/>
  175 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  176 + </node>
  177 + <node>
  178 + <parameter name="Phibar" scale="1.0" value="31.0" min="0.0" max="50.0" free="0"/>
  179 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  180 + </node>
  181 + <node>
  182 + <parameter name="Phibar" scale="1.0" value="33.0" min="0.0" max="50.0" free="0"/>
  183 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  184 + </node>
  185 + <node>
  186 + <parameter name="Phibar" scale="1.0" value="35.0" min="0.0" max="50.0" free="0"/>
  187 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  188 + </node>
  189 + <node>
  190 + <parameter name="Phibar" scale="1.0" value="37.0" min="0.0" max="50.0" free="0"/>
  191 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  192 + </node>
  193 + <node>
  194 + <parameter name="Phibar" scale="1.0" value="39.0" min="0.0" max="50.0" free="0"/>
  195 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  196 + </node>
  197 + <node>
  198 + <parameter name="Phibar" scale="1.0" value="41.0" min="0.0" max="50.0" free="0"/>
  199 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  200 + </node>
  201 + <node>
  202 + <parameter name="Phibar" scale="1.0" value="43.0" min="0.0" max="50.0" free="0"/>
  203 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  204 + </node>
  205 + <node>
  206 + <parameter name="Phibar" scale="1.0" value="45.0" min="0.0" max="50.0" free="0"/>
  207 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  208 + </node>
  209 + <node>
  210 + <parameter name="Phibar" scale="1.0" value="47.0" min="0.0" max="50.0" free="0"/>
  211 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  212 + </node>
  213 + <node>
  214 + <parameter name="Phibar" scale="1.0" value="49.0" min="0.0" max="50.0" free="0"/>
  215 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  216 + </node>
  217 + </source>
  218 + <source name="Background(3.0-10.0)MeV" type="DRBFitting" instrument="COM" id="300001">
  219 + <node>
  220 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  221 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  222 + </node>
  223 + <node>
  224 + <parameter name="Phibar" scale="1.0" value="3.0" min="0.0" max="50.0" free="0"/>
  225 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  226 + </node>
  227 + <node>
  228 + <parameter name="Phibar" scale="1.0" value="5.0" min="0.0" max="50.0" free="0"/>
  229 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  230 + </node>
  231 + <node>
  232 + <parameter name="Phibar" scale="1.0" value="7.0" min="0.0" max="50.0" free="0"/>
  233 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  234 + </node>
  235 + <node>
  236 + <parameter name="Phibar" scale="1.0" value="9.0" min="0.0" max="50.0" free="0"/>
  237 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  238 + </node>
  239 + <node>
  240 + <parameter name="Phibar" scale="1.0" value="11.0" min="0.0" max="50.0" free="0"/>
  241 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  242 + </node>
  243 + <node>
  244 + <parameter name="Phibar" scale="1.0" value="13.0" min="0.0" max="50.0" free="0"/>
  245 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  246 + </node>
  247 + <node>
  248 + <parameter name="Phibar" scale="1.0" value="15.0" min="0.0" max="50.0" free="0"/>
  249 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  250 + </node>
  251 + <node>
  252 + <parameter name="Phibar" scale="1.0" value="17.0" min="0.0" max="50.0" free="0"/>
  253 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  254 + </node>
  255 + <node>
  256 + <parameter name="Phibar" scale="1.0" value="19.0" min="0.0" max="50.0" free="0"/>
  257 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  258 + </node>
  259 + <node>
  260 + <parameter name="Phibar" scale="1.0" value="21.0" min="0.0" max="50.0" free="0"/>
  261 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  262 + </node>
  263 + <node>
  264 + <parameter name="Phibar" scale="1.0" value="23.0" min="0.0" max="50.0" free="0"/>
  265 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  266 + </node>
  267 + <node>
  268 + <parameter name="Phibar" scale="1.0" value="25.0" min="0.0" max="50.0" free="0"/>
  269 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  270 + </node>
  271 + <node>
  272 + <parameter name="Phibar" scale="1.0" value="27.0" min="0.0" max="50.0" free="0"/>
  273 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  274 + </node>
  275 + <node>
  276 + <parameter name="Phibar" scale="1.0" value="29.0" min="0.0" max="50.0" free="0"/>
  277 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  278 + </node>
  279 + <node>
  280 + <parameter name="Phibar" scale="1.0" value="31.0" min="0.0" max="50.0" free="0"/>
  281 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  282 + </node>
  283 + <node>
  284 + <parameter name="Phibar" scale="1.0" value="33.0" min="0.0" max="50.0" free="0"/>
  285 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  286 + </node>
  287 + <node>
  288 + <parameter name="Phibar" scale="1.0" value="35.0" min="0.0" max="50.0" free="0"/>
  289 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  290 + </node>
  291 + <node>
  292 + <parameter name="Phibar" scale="1.0" value="37.0" min="0.0" max="50.0" free="0"/>
  293 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  294 + </node>
  295 + <node>
  296 + <parameter name="Phibar" scale="1.0" value="39.0" min="0.0" max="50.0" free="0"/>
  297 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  298 + </node>
  299 + <node>
  300 + <parameter name="Phibar" scale="1.0" value="41.0" min="0.0" max="50.0" free="0"/>
  301 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  302 + </node>
  303 + <node>
  304 + <parameter name="Phibar" scale="1.0" value="43.0" min="0.0" max="50.0" free="0"/>
  305 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  306 + </node>
  307 + <node>
  308 + <parameter name="Phibar" scale="1.0" value="45.0" min="0.0" max="50.0" free="0"/>
  309 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  310 + </node>
  311 + <node>
  312 + <parameter name="Phibar" scale="1.0" value="47.0" min="0.0" max="50.0" free="0"/>
  313 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  314 + </node>
  315 + <node>
  316 + <parameter name="Phibar" scale="1.0" value="49.0" min="0.0" max="50.0" free="0"/>
  317 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  318 + </node>
  319 + </source>
  320 + <source name="Background(10.0-30.0)MeV" type="DRBFitting" instrument="COM" id="400001">
  321 + <node>
  322 + <parameter name="Phibar" scale="1.0" value="1.0" min="0.0" max="50.0" free="0"/>
  323 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  324 + </node>
  325 + <node>
  326 + <parameter name="Phibar" scale="1.0" value="3.0" min="0.0" max="50.0" free="0"/>
  327 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  328 + </node>
  329 + <node>
  330 + <parameter name="Phibar" scale="1.0" value="5.0" min="0.0" max="50.0" free="0"/>
  331 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  332 + </node>
  333 + <node>
  334 + <parameter name="Phibar" scale="1.0" value="7.0" min="0.0" max="50.0" free="0"/>
  335 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  336 + </node>
  337 + <node>
  338 + <parameter name="Phibar" scale="1.0" value="9.0" min="0.0" max="50.0" free="0"/>
  339 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  340 + </node>
  341 + <node>
  342 + <parameter name="Phibar" scale="1.0" value="11.0" min="0.0" max="50.0" free="0"/>
  343 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  344 + </node>
  345 + <node>
  346 + <parameter name="Phibar" scale="1.0" value="13.0" min="0.0" max="50.0" free="0"/>
  347 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  348 + </node>
  349 + <node>
  350 + <parameter name="Phibar" scale="1.0" value="15.0" min="0.0" max="50.0" free="0"/>
  351 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  352 + </node>
  353 + <node>
  354 + <parameter name="Phibar" scale="1.0" value="17.0" min="0.0" max="50.0" free="0"/>
  355 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  356 + </node>
  357 + <node>
  358 + <parameter name="Phibar" scale="1.0" value="19.0" min="0.0" max="50.0" free="0"/>
  359 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  360 + </node>
  361 + <node>
  362 + <parameter name="Phibar" scale="1.0" value="21.0" min="0.0" max="50.0" free="0"/>
  363 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  364 + </node>
  365 + <node>
  366 + <parameter name="Phibar" scale="1.0" value="23.0" min="0.0" max="50.0" free="0"/>
  367 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  368 + </node>
  369 + <node>
  370 + <parameter name="Phibar" scale="1.0" value="25.0" min="0.0" max="50.0" free="0"/>
  371 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  372 + </node>
  373 + <node>
  374 + <parameter name="Phibar" scale="1.0" value="27.0" min="0.0" max="50.0" free="0"/>
  375 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  376 + </node>
  377 + <node>
  378 + <parameter name="Phibar" scale="1.0" value="29.0" min="0.0" max="50.0" free="0"/>
  379 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  380 + </node>
  381 + <node>
  382 + <parameter name="Phibar" scale="1.0" value="31.0" min="0.0" max="50.0" free="0"/>
  383 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  384 + </node>
  385 + <node>
  386 + <parameter name="Phibar" scale="1.0" value="33.0" min="0.0" max="50.0" free="0"/>
  387 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  388 + </node>
  389 + <node>
  390 + <parameter name="Phibar" scale="1.0" value="35.0" min="0.0" max="50.0" free="0"/>
  391 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  392 + </node>
  393 + <node>
  394 + <parameter name="Phibar" scale="1.0" value="37.0" min="0.0" max="50.0" free="0"/>
  395 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  396 + </node>
  397 + <node>
  398 + <parameter name="Phibar" scale="1.0" value="39.0" min="0.0" max="50.0" free="0"/>
  399 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  400 + </node>
  401 + <node>
  402 + <parameter name="Phibar" scale="1.0" value="41.0" min="0.0" max="50.0" free="0"/>
  403 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  404 + </node>
  405 + <node>
  406 + <parameter name="Phibar" scale="1.0" value="43.0" min="0.0" max="50.0" free="0"/>
  407 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  408 + </node>
  409 + <node>
  410 + <parameter name="Phibar" scale="1.0" value="45.0" min="0.0" max="50.0" free="0"/>
  411 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  412 + </node>
  413 + <node>
  414 + <parameter name="Phibar" scale="1.0" value="47.0" min="0.0" max="50.0" free="0"/>
  415 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  416 + </node>
  417 + <node>
  418 + <parameter name="Phibar" scale="1.0" value="49.0" min="0.0" max="50.0" free="0"/>
  419 + <parameter name="Normalization" scale="1.0" value="1.0" min="0.0" max="1000.0" free="1"/>
  420 + </node>
  421 + </source>
  422 +</source_library>
... ...
doc/source/users/tutorials/howto/fermi/howto_fermi_fitting.rst
... ... @@ -254,3 +254,9 @@ using the Fermi-LAT Science Tools.
254 254 2017-08-26T13:05:12: Test Statistic ............: 326326.556902542
255 255  
256 256 which is also close to the value determined by gtlike.
  257 +
  258 + .. warning::
  259 +
  260 + ctools supports for the moment only the fitting of point sources for
  261 + Fermi-LAT data. Other spatial shapes need to be preconvolved with the
  262 + instrument response functions and added to the ``srcmaps.fits`` file.
... ...
doc/source/users/tutorials/howto/fermi/howto_fermi_spectrum.rst
... ... @@ -60,7 +60,7 @@ will result in a spectrum. To do this type now:
60 60  
61 61 .. code-block:: bash
62 62  
63   - $ ctlike debug=yes
  63 + $ ctlike
64 64 Input event list, counts cube or observation definition XML file [obs.xml]
65 65 Input model definition XML file [models.xml] model_nodes.xml
66 66 Output model definition XML file [vela_results.xml] vela_nodes_results.xml
... ...
doc/source/users/tutorials/howto/fermi/index.rst
... ... @@ -8,7 +8,7 @@ Analysing Fermi-LAT data
8 8 You will learn how to analyse data from the LAT telescope about NASA's
9 9 `Fermi <https://fermi.gsfc.nasa.gov/ssc/>`_ satellite with ctools.
10 10  
11   -You can use ctools to analyse data from the LAT telescope about NASA's
  11 +You can use ctools to analyse data from the LAT telescope aboard NASA's
12 12 `Fermi <https://fermi.gsfc.nasa.gov/ssc/>`_ satellite.
13 13 To do this you need to be familar with the Fermi-LAT Science Tools that you
14 14 will use to prepare the Fermi-LAT data for the analysis. You can download the
... ...
doc/source/users/tutorials/howto/index.rst
... ... @@ -22,5 +22,10 @@ These examples can be easily adapted to any data you have at your disposal.
22 22 howto_phasecurve
23 23 howto_exclude
24 24 howto_vo
  25 +
  26 +.. toctree::
  27 + :maxdepth: 1
  28 +
25 29 How to analyse Fermi-LAT data with ctools? <fermi/index>
26   - How to analyse H.E.S.S. data with ctools? <iact/index>
27 30 \ No newline at end of file
  31 + How to analyse COMPTEL data with ctools? <comptel/index>
  32 + How to analyse H.E.S.S. data with ctools? <iact/index>
... ...