Commit a39cd4eab059c41a39475bbea6b7dba5bb8ae733

Authored by Jürgen Knödlseder
1 parent 8346a522

Update documentation and tutorials

doc/source/help/faq.rst
... ... @@ -17,6 +17,7 @@ asked.
17 17 - :ref:`I want to upgrade ctools, do I have to upgrade GammaLib? <faq_upgrade>`
18 18 - :ref:`Should I used binned or unbinned analysis? <faq_analysis>`
19 19 - :ref:`How precise are ctools? <faq_precision>`
  20 +- :ref:`How to get a ctools log file when running the tool from Python? <faq_python_logging>`
20 21  
21 22  
22 23 .. _faq_ctools_gammalib:
... ... @@ -45,77 +46,97 @@ asked.
45 46  
46 47 .. topic:: Are ctools and GammaLib specific to CTA?
47 48  
48   - The short answer is: ctools yes, GammaLib no.
49   -
50   - ctools have been specifically designed to provide the functionalities that
51   - are required to analyse CTA data.
52   - This does not mean that ctools can not be used for analysing data from
53   - other Imaging Air Cherenkov Telescopes; the sole requirement is that the
54   - data and response files are provided in a CTA compliant format.
55   - However, ctools are not designed to analyse data from Fermi/LAT,
56   - INTEGRAL, COMPTEL or other gamma-ray telescopes.
57   - Nevertheless, some joint multi-telescope analysis is supported by ctools.
58   -
59   - GammaLib, however, is a universal framework with a core that is completely
60   - independent of any telescope.
61   - Plugins are used to interface GammaLib with the data and response files of
62   - specific telescopes.
63   - For every new instrument that shall be supported a new plugin needs to be
64   - developed.
65   - So far, plugins exists for CTA (and Imaging Air Cherenkov Telescopes in
66   - general), Fermi/LAT, and COMPTEL.
67   - Some support for integration of any arbitrary multi-wavelength data
68   - exists.
  49 + The short answer is: ctools yes, GammaLib no.
  50 +
  51 + ctools have been specifically designed to provide the functionalities that
  52 + are required to analyse CTA data.
  53 + This does not mean that ctools can not be used for analysing data from
  54 + other Imaging Air Cherenkov Telescopes; the sole requirement is that the
  55 + data and response files are provided in a CTA compliant format.
  56 + However, ctools are not designed to analyse data from Fermi/LAT,
  57 + INTEGRAL, COMPTEL or other gamma-ray telescopes.
  58 + Nevertheless, some joint multi-telescope analysis is supported by ctools.
  59 +
  60 + GammaLib, however, is a universal framework with a core that is completely
  61 + independent of any telescope.
  62 + Plugins are used to interface GammaLib with the data and response files of
  63 + specific telescopes.
  64 + For every new instrument that shall be supported a new plugin needs to be
  65 + developed.
  66 + So far, plugins exists for CTA (and Imaging Air Cherenkov Telescopes in
  67 + general), Fermi/LAT, and COMPTEL.
  68 + Some support for integration of any arbitrary multi-wavelength data
  69 + exists.
69 70  
70 71  
71 72 .. _faq_upgrade:
72 73  
73 74 .. topic:: I want to upgrade ctools, do I have to upgrade GammaLib?
74 75  
75   - For the moment yes.
  76 + For the moment yes.
76 77  
77   - The GammaLib interface is still not fully stabilised, hence ctools is
78   - continuously adapted to match the interface evolution
79   - (see the :ref:`sec_download` section for a correspondance of versions).
80   - We plan however to put the GammaLib interface under change control.
81   - ctools should then become more independent from GammaLib.
  78 + The GammaLib interface is still not fully stabilised, hence ctools is
  79 + continuously adapted to match the interface evolution
  80 + (see the :ref:`sec_download` section for a correspondance of versions).
  81 + We plan however to put the GammaLib interface under change control.
  82 + ctools should then become more independent from GammaLib.
82 83  
83 84  
84 85 .. _faq_analysis:
85 86  
86 87 .. topic:: Should I used binned or unbinned analysis?
87 88  
88   - This depends on the amount of data you want to analyse and to some extent
89   - on the question you want to answer with your analysis.
90   - For an unbinned analysis, the computation time increases about linearly
91   - with the number of events and hence with the duration of the observation,
92   - while for binned analysis the computation time depends only on the number
93   - of bins that is used.
94   - Consequently, for short observation times (below 30 hours), unbinned
95   - analysis is faster, while for longer times it is advantageous to use
96   - a binned analysis.
97   - If you go to very low energies, either make sure that you have enough
98   - energy bins in a binned analysis to sample properly the strong drop in the
99   - effective area towards small energies, or better, use unbinned analysis.
100   - If you'd like to fit a Gaussian line to your data you may also prefer
101   - unbinned over binned analysis, as the fine sampling required to resolve
102   - the line may require a prohibitive large number of energy bins for a binned
103   - analysis.
  89 + This depends on the amount of data you want to analyse and to some extent
  90 + on the question you want to answer with your analysis.
  91 + For an unbinned analysis, the computation time increases about linearly
  92 + with the number of events and hence with the duration of the observation,
  93 + while for binned analysis the computation time depends only on the number
  94 + of bins that is used.
  95 + Consequently, for short observation times (below 30 hours), unbinned
  96 + analysis is faster, while for longer times it is advantageous to use
  97 + a binned analysis.
  98 + If you go to very low energies, either make sure that you have enough
  99 + energy bins in a binned analysis to sample properly the strong drop in the
  100 + effective area towards small energies, or better, use unbinned analysis.
  101 + If you'd like to fit a Gaussian line to your data you may also prefer
  102 + unbinned over binned analysis, as the fine sampling required to resolve
  103 + the line may require a prohibitive large number of energy bins for a binned
  104 + analysis.
104 105  
105 106  
106 107 .. _faq_precision:
107 108  
108 109 .. topic:: How precise are ctools?
109 110  
110   - The ctools and gammalib codes have a numerical accuracy of better than 1%.
111   - This means that if you use ctools to determine for example the flux
112   - received from a source or the spectral points of an SED, the relative
113   - precision of the flux or the spectral points is better than 1%.
114   - The same is true for spatial parameters, such as source position or
115   - source extension.
116   - For many cases the actual numerical precision is in fact much better
117   - than 1%, but in any case, it should never be worse.
118   - Note, however, that this does not imply that source parameters can be
119   - determined with CTA with an accuracy of 1%. The accuracy depends in the
120   - end on the precision to which the instrument response function is known,
121   - which should be more in the 10% range.
  111 + The ctools and gammalib codes have a numerical accuracy of better than 1%.
  112 + This means that if you use ctools to determine for example the flux
  113 + received from a source or the spectral points of an SED, the relative
  114 + precision of the flux or the spectral points is better than 1%.
  115 + The same is true for spatial parameters, such as source position or
  116 + source extension.
  117 + For many cases the actual numerical precision is in fact much better
  118 + than 1%, but in any case, it should never be worse.
  119 + Note, however, that this does not imply that source parameters can be
  120 + determined with CTA with an accuracy of 1%. The accuracy depends in the
  121 + end on the precision to which the instrument response function is known,
  122 + which should be more in the 10% range.
  123 +
  124 +
  125 +.. _faq_python_logging:
  126 +
  127 +.. topic:: How to get a ctools log file when running the tool from Python?
  128 +
  129 + By default, tools and scripts run from Python will not generate a log file.
  130 + The reason for this is that Python scripts are often used to build ctools
  131 + analysis pipelines and workflows, and one generally does not want that such
  132 + a script pollutes the workspace with log files. You can however instruct a
  133 + ctool or cscript to generate a log file by invoking the ``logFileOpen()``
  134 + method before running the tool, for example
  135 +
  136 + .. code-block:: python
  137 +
  138 + >>> import ctools
  139 + >>> sim = ctools.ctobssim()
  140 + >>> sim.logFileOpen()
  141 + >>> sim.run()
  142 +
... ...
doc/source/users/glossary.rst
... ... @@ -48,7 +48,7 @@ Glossary
48 48 .. math::
49 49 E_{\rm disp}(E'| p, E) =
50 50 \frac{\sum_i E_{\rm disp,i}(E'| p, E) \times A_{\rm eff,i}(p, E) \times \tau_i}
51   - {\sum_i E_{\rm disp,i}(E'| p, E) \times \tau_i}
  51 + {\sum_i A_{\rm eff,i}(p, E) \times \tau_i}
52 52  
53 53 where
54 54 :math:`E_{\rm disp,i}(E'| p, E)` is the energy dispersion for observation :math:`i`,
... ...
doc/source/users/tutorials/quickstart/ctools-from-python.ipynb
... ... @@ -381,7 +381,7 @@
381 381 "data": {
382 382 "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAERCAYAAAB4jRxOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGP1JREFUeJzt3XuwpHV95/H3Z2TBoFGjm0ACMuAapEK56yULXnbLVoyg\n7ooxbgnEjeIaLU0R92KJVZidmaSKdXPbNaImZsnEuDWOVxRiKNFIa1F4YUXAIAPjjWEWZ4wbXHXX\nRTJ+949+DtO0feb0OX0/z/tVNUX3093P93sezvn2r3/Pr79PqgpJ0ua3Zd4JSJJmw4IvSS1hwZek\nlrDgS1JLWPAlqSUs+JLUEhZ8SWoJC74ktcRR09hpkgC/AzwMuKGq3j2NOJKk0U1rhH8ucALwQ2D/\nlGJIktZhpIKf5PIkB5PcMrD9nCR7ktyR5OK+hx4HXF9VrwdeO8F8JUkbNOoIfydwdv+GJFuAy5rt\npwPnJzmteXg/cE9z++8nkKckaUwjFfyquo7DBXzFGcDeqrqzqu4DdtObygH4EHBOkrcAn55UspKk\njRvnpO0JwF199/fTexOgqn4AvPJIL05im05J2oCqykZe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Lkx8tAmM9H2yNIQgyP3YSP5Na/aU1Xfbrpxrsyj97en/QHw4BHz6e/Ueoje30CAd1XVJUOe/4M6\nfKJr1S6PVbU/vRbSz6TXOvuCEfNZzQtr+HUEdgOvp3eO40NrnFN4ML1jIwGO8DVZw4rh9Ryed34p\nh68h8Bngxc3t81bZ1+D+rqXX7hge2KL5NuCxI+SyWr5/Dbw4vYvbrFyw/dEDzwHYA5ySwxdFf8nA\n/i4H/jvw3r43iY34GPC6+5N84Dz8J4DT6XVNPNJ0DvQuhjGrNt5aAhZ8TdJPJNmX5K7mv/8W+E3g\nwiQ30ZsXXylk/w749832fwT875WdJPk08F7gWc1+Vi7M8sbmNXfQa9d8ebP9anoXdO73u31z+Df2\nL+HsUwBVdRu9q3pdk+Rm4Bp600T3P6d53v8DXktzqUvgu/150+uZ/hDgz9c8UkPy6PPbwLFJbkny\nJWBbXw4/Aq4AfrKqrl9jv0/lyFM+ahmXZWoukvxEVf2guf0S4Lyq+uUx9vdB4A1V9dVJ5bhKnIc0\nK2BI8jbgjmouUJHkF4E/qKrBN5+V124Dvl9VfzCl3J4NvLZZlvmLwGuq6t9MI5aWkyN8zcuTm6Wa\nNwOvAf7DmPt7I4dH5dP0682nhluBhwF/ApDkYuD9TR6r+X7z+u2TTirJBfRWPq2sDHokfZ8MJHCE\nL0mt4QhfklrCgi9JLWHBl6SWsOBLUktY8CWpJf4/YSiW8RnJDJkAAAAASUVORK5CYII=\n",
383 383 "text/plain": [
384   - "<matplotlib.figure.Figure at 0x1067bc490>"
  384 + "<matplotlib.figure.Figure at 0x10f3d3ad0>"
385 385 ]
386 386 },
387 387 "metadata": {},
... ... @@ -491,8 +491,8 @@
491 491 " RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)\n",
492 492 " DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)\n",
493 493 " Number of spectral par's ..: 3\n",
494   - " Prefactor ................: 5.71641985530777e-16 +/- 6.16044729438793e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)\n",
495   - " Index ....................: -2.47207574641491 +/- 0.00792255648868446 [-0,-5] (free,scale=-1,gradient)\n",
  494 + " Prefactor ................: 5.71641983396841e-16 +/- 6.16044728001869e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)\n",
  495 + " Index ....................: -2.47207578184696 +/- 0.00792255637026554 [-0,-5] (free,scale=-1,gradient)\n",
496 496 " PivotEnergy ..............: 300000 [10000,1000000000] MeV (fixed,scale=1000000,gradient)\n",
497 497 " Number of temporal par's ..: 1\n",
498 498 " Normalization ............: 1 (relative value) (fixed,scale=1,gradient)\n",
... ... @@ -504,8 +504,8 @@
504 504 " Model type ................: \"PowerLaw\" * \"Constant\"\n",
505 505 " Number of parameters ......: 4\n",
506 506 " Number of spectral par's ..: 3\n",
507   - " Prefactor ................: 0.999546835049722 +/- 0.00722086200687532 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)\n",
508   - " Index ....................: -0.000149670672999089 +/- 0.00255125105704583 [-5,5] (free,scale=1,gradient)\n",
  507 + " Prefactor ................: 0.999547413672001 +/- 0.00722086618569711 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)\n",
  508 + " Index ....................: -0.000149454940530402 +/- 0.00255125105744512 [-5,5] (free,scale=1,gradient)\n",
509 509 " PivotEnergy ..............: 1000000 [10000,1000000000] MeV (fixed,scale=1000000,gradient)\n",
510 510 " Number of temporal par's ..: 1\n",
511 511 " Normalization ............: 1 (relative value) (fixed,scale=1,gradient)\n"
... ... @@ -568,11 +568,11 @@
568 568 " Model components ..........: \"PointSource\" * \"PowerLaw\" * \"Constant\"\n",
569 569 " Number of parameters ......: 6\n",
570 570 " Number of spatial par's ...: 2\n",
571   - " RA .......................: 83.6321512928169 +/- 0.000642709898034108 [-360,360] deg (free,scale=1)\n",
572   - " DEC ......................: 22.0153650383811 +/- 0.000605599763935102 [-90,90] deg (free,scale=1)\n",
  571 + " RA .......................: 83.6321513539243 +/- 0.000642709906923956 [-360,360] deg (free,scale=1)\n",
  572 + " DEC ......................: 22.015365038759 +/- 0.000605599773766818 [-90,90] deg (free,scale=1)\n",
573 573 " Number of spectral par's ..: 3\n",
574   - " Prefactor ................: 5.71414829573802e-16 +/- 6.15917758147358e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)\n",
575   - " Index ....................: -2.47211135009306 +/- 0.0079230681070739 [-0,-5] (free,scale=-1,gradient)\n",
  574 + " Prefactor ................: 5.71414829301837e-16 +/- 6.15917760942954e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)\n",
  575 + " Index ....................: -2.47211138483201 +/- 0.0079230679574118 [-0,-5] (free,scale=-1,gradient)\n",
576 576 " PivotEnergy ..............: 300000 [10000,1000000000] MeV (fixed,scale=1000000,gradient)\n",
577 577 " Number of temporal par's ..: 1\n",
578 578 " Normalization ............: 1 (relative value) (fixed,scale=1,gradient)\n",
... ... @@ -584,8 +584,8 @@
584 584 " Model type ................: \"PowerLaw\" * \"Constant\"\n",
585 585 " Number of parameters ......: 4\n",
586 586 " Number of spectral par's ..: 3\n",
587   - " Prefactor ................: 0.999542788067004 +/- 0.00722079542969056 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)\n",
588   - " Index ....................: -0.00014887248036908 +/- 0.00255123898184119 [-5,5] (free,scale=1,gradient)\n",
  587 + " Prefactor ................: 0.999543391635431 +/- 0.0072207997895289 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)\n",
  588 + " Index ....................: -0.000148647508899144 +/- 0.0025512389825989 [-5,5] (free,scale=1,gradient)\n",
589 589 " PivotEnergy ..............: 1000000 [10000,1000000000] MeV (fixed,scale=1000000,gradient)\n",
590 590 " Number of temporal par's ..: 1\n",
591 591 " Normalization ............: 1 (relative value) (fixed,scale=1,gradient)\n"
... ... @@ -615,7 +615,7 @@
615 615 "name": "stdout",
616 616 "output_type": "stream",
617 617 "text": [
618   - "4.2173620963\n"
  618 + "4.21736054635\n"
619 619 ]
620 620 }
621 621 ],
... ... @@ -633,11 +633,32 @@
633 633 ]
634 634 },
635 635 {
636   - "cell_type": "code",
637   - "execution_count": null,
  636 + "cell_type": "markdown",
638 637 "metadata": {},
  638 + "source": [
  639 + "## Generating a log file\n",
  640 + "\n",
  641 + "By default, tools and scripts run from Python will not generate a log file. The reason for this is that Python scripts are often used to build ctools analysis pipelines and workflows, and one generally does not want that such a script pollutes the workspace with log files. You can however instruct a ctool or cscript to generate a log file as follows:"
  642 + ]
  643 + },
  644 + {
  645 + "cell_type": "code",
  646 + "execution_count": 15,
  647 + "metadata": {
  648 + "scrolled": true
  649 + },
639 650 "outputs": [],
640   - "source": []
  651 + "source": [
  652 + "like.logFileOpen()\n",
  653 + "like.run()"
  654 + ]
  655 + },
  656 + {
  657 + "cell_type": "markdown",
  658 + "metadata": {},
  659 + "source": [
  660 + "This creates a log file named ``ctlike.log`` in your local work space that you can visualise using any editor."
  661 + ]
641 662 }
642 663 ],
643 664 "metadata": {
... ...
doc/source/users/user_manual/introduction.rst
... ... @@ -103,7 +103,7 @@ example
103 103  
104 104 .. code-block:: bash
105 105  
106   - $ ctobssim seed=41
  106 + $ ctobssim seed=41
107 107  
108 108 will run :ref:`ctobssim` with a seed value of 41. Multiple hidden parameters
109 109 specified on the command line need to be separated by a white space. In the
... ... @@ -116,3 +116,32 @@ values of queried parameters, e.g.
116 116 >>> sim = ctools.ctobssim()
117 117 >>> sim["seed"] = 41
118 118 ...
  119 +
  120 +
  121 +Log files
  122 +---------
  123 +
  124 +Each ctool and cscript will produce a log file that is written in the working
  125 +directory. The log file is in ASCII file format and can be read by any editor.
  126 +By default, the name of the ASCII file is the name of the tool or script,
  127 +suffixed by ``.log``. You can change the log file name using the hidden
  128 +``logfile`` parameter, for example
  129 +
  130 +.. code-block:: bash
  131 +
  132 + $ ctobssim logfile=my_first_simulation.log
  133 +
  134 +When calling a ctool or cscript from Python, no log file will be written by
  135 +default. The reason for this is that Python scripts are often used to build
  136 +ctools analysis pipelines and workflows, and one generally does not want that
  137 +such a script pollutes the workspace with log files. You can however instruct
  138 +a ctool or cscript to generate a log file by invoking the ``logFileOpen()``
  139 +method before running the tool, for example
  140 +
  141 +.. code-block:: python
  142 +
  143 + >>> import ctools
  144 + >>> sim = ctools.ctobssim()
  145 + ...
  146 + >>> sim.logFileOpen()
  147 + >>> sim.run()
... ...
doc/source/users/user_manual/models_implementation.rst
... ... @@ -15,6 +15,42 @@ a temporal component (tag ``&lt;temporal&gt;``).
15 15 .. math::
16 16 M(p,E,t) = M_{\rm spatial}(p|E) \times M_{\rm spectral}(E) \times M_{\rm temporal}(t)
17 17  
  18 +where :math:`M(p,E,t)` is given in units of
  19 +:math:`photons \,\, cm^{-2} s^{-1} MeV^{-1} sr^{-1}`.
  20 +
  21 +The spatial model component describes the energy dependent morphology of the
  22 +source.
  23 +It satisfies
  24 +
  25 +.. math::
  26 + \int_{\Omega} M_{\rm spatial}(p|E) \, d\Omega = 1
  27 +
  28 +for all :math:`E`, hence the spatial component does not
  29 +impact the spatially integrated spectral and temporal properties of the
  30 +source (the integration is done here over the spatial parameters
  31 +:math:`p` in a spherical coordinate system).
  32 +The units of the spatial model component are
  33 +:math:`[M_{\rm spatial}] = {\rm sr}^{-1}`
  34 +(but see the exception of the
  35 +:ref:`DiffuseMapCube spatial model component <um_models_spatial_src_diffuse_cube>`).
  36 +
  37 +The spectral model component describes the spatially integrated spectral
  38 +distribution of the source.
  39 +It satisfies
  40 +
  41 +.. math::
  42 + \int_{E} M_{\rm spectral}(E) \, dE = \Phi
  43 +
  44 +where :math:`\Phi` is the spatially and spectrally integrated total source
  45 +flux.
  46 +The units of the spectral model component
  47 +are :math:`[M_{\rm spectral}] = {\rm cm}^{-2} {\rm s}^{-1} {\rm MeV}^{-1}`.
  48 +
  49 +The temporal model component describes the relative variation of the
  50 +source flux with respect to the mean value given by the spectral model
  51 +component.
  52 +The temporal model component is unit less.
  53 +
18 54 In this specific example, the source component ``Crab`` describes
19 55 a point source at the location of the Crab nebula with a power law spectral
20 56 shape that is constant in time.
... ...
doc/source/users/user_manual/models_spatial_src.rst
... ... @@ -61,6 +61,9 @@ Point source
61 61 Radial source
62 62 ^^^^^^^^^^^^^
63 63  
  64 +RadialDisk
  65 +~~~~~~~~~~
  66 +
64 67 The ``RadialDisk`` model describes a uniform intensity distribution within
65 68 a given radius
66 69  
... ... @@ -83,6 +86,9 @@ Radial source
83 86 * ``DEC`` is the Declination (degrees)
84 87 * ``Radius`` is the disk radius (degrees)
85 88  
  89 +RadialGaussian
  90 +~~~~~~~~~~~~~~
  91 +
86 92 The ``RadialGaussian`` model describes a Gaussian intensity distribution
87 93  
88 94 .. code-block:: xml
... ... @@ -108,7 +114,10 @@ Radial source
108 114  
109 115 * ``RA`` is the Right Ascension (degrees)
110 116 * ``DEC`` is the Declination (degrees)
111   - * :math:`\sigma` == ``Sigma`` (degrees)
  117 + * :math:`\sigma` = ``Sigma`` (degrees)
  118 +
  119 +RadialShell
  120 +~~~~~~~~~~~
112 121  
113 122 The ``RadialShell`` model describes a spherical shell projected on the sky
114 123  
... ... @@ -159,6 +168,9 @@ Radial source
159 168 Elliptical source
160 169 ^^^^^^^^^^^^^^^^^
161 170  
  171 +EllipticalDisk
  172 +~~~~~~~~~~~~~~
  173 +
162 174 The ``EllipticalDisk`` model describes a uniform intensity distribution within
163 175 an elliptical circumference:
164 176  
... ... @@ -185,6 +197,9 @@ Elliptical source
185 197 * ``MinorRadius`` is the minor radius of the ellipse (degrees)
186 198 * ``MajorRadius`` is the major radius of the ellipse (degrees)
187 199  
  200 +EllipticalGaussian
  201 +~~~~~~~~~~~~~~~~~~
  202 +
188 203 The ``EllipticalGaussian`` model describes a Gaussian intensity distribution
189 204  
190 205 .. code-block:: xml
... ... @@ -232,6 +247,9 @@ Elliptical source
232 247 Diffuse source
233 248 ^^^^^^^^^^^^^^
234 249  
  250 +DiffuseIsotropic
  251 +~~~~~~~~~~~~~~~~
  252 +
235 253 The ``DiffuseIsotropic`` model describes an isotropic intensity distribution
236 254  
237 255 .. code-block:: xml
... ... @@ -253,6 +271,9 @@ Diffuse source
253 271 For compatibility with the Fermi/LAT ScienceTools the model type
254 272 ``DiffuseIsotropic`` can be replaced by ``ConstantValue``.
255 273  
  274 +DiffuseMap
  275 +~~~~~~~~~~
  276 +
256 277 The ``DiffuseMap`` model describes an arbitrary intensity distribution in
257 278 form of a sky map
258 279  
... ... @@ -281,8 +302,15 @@ Diffuse source
281 302 ``Normalization`` can be replaced by ``Prefactor``.
282 303  
283 304 .. note::
284   - You may add the ``normalize="0"`` to the spatial model tag to avoid the
285   - normalization of the diffuse map to an integral of unity
  305 + By default, the diffuse map is normalised so that
  306 +
  307 + .. math::
  308 + \int_{\Omega} M_{\rm spatial}(p|E) \, d\Omega = 1
  309 +
  310 + which means that the units of the spatial model component are
  311 + :math:`[M_{\rm spatial}] = {\rm sr}^{-1}`.
  312 + To avoid the normalisation you may add the ``normalize="0"`` attribute
  313 + to the spatial model tag.
286 314  
287 315 .. code-block:: xml
288 316  
... ... @@ -295,6 +323,19 @@ Diffuse source
295 323 </spectrum>
296 324 </source>
297 325  
  326 + In that case, generally
  327 +
  328 + .. math::
  329 + \int_{\Omega} M_{\rm spatial}(p|E) \, d\Omega \neq 1
  330 +
  331 + and the spectral component cannot be directly interpreted as a physical
  332 + source intensity.
  333 +
  334 + .. _um_models_spatial_src_diffuse_cube:
  335 +
  336 +DiffuseMapCube
  337 +~~~~~~~~~~~~~~
  338 +
298 339 The ``DiffuseMapCube`` model describes an arbitrary energy-dependent intensity
299 340 distribution in form of a map cube
300 341  
... ... @@ -313,6 +354,18 @@ Diffuse source
313 354  
314 355 * ``Normalization`` is a normalization value
315 356  
  357 + Note that the map cube is not normalised to unit, hence generally
  358 +
  359 + .. math::
  360 + \int_{\Omega} M_{\rm spatial}(p|E) \, d\Omega \neq 1
  361 +
  362 + To compute the flux in a given energy band for a ``DiffuseMapCube`` model
  363 + you have to integrated both the spatial and spectral components, i.e.
  364 +
  365 + .. math::
  366 + \Phi = \int_{\Omega} \int_{E} M_{\rm spatial}(p|E) \times
  367 + M_{\rm spectral}(E)\, d\Omega \, dE
  368 +
316 369 .. note::
317 370 For compatibility with the Fermi/LAT ScienceTools the model type
318 371 ``DiffuseMapCube`` can be replaced by ``MapCubeFunction`` and the parameter
... ...