Commit fafb9193de67e8030aa4489f9dfb3fa0c956372c
1 parent
92a171b6
Implement Luigi's comments on User Manual
Showing
6 changed files
with
46 additions
and
9 deletions
doc/source/users/user_manual/data.rst
| @@ -16,7 +16,7 @@ is shown below. | @@ -16,7 +16,7 @@ is shown below. | ||
| 16 | 16 | ||
| 17 | Metadata, such as the telescope pointing direction, the live time, or any other | 17 | Metadata, such as the telescope pointing direction, the live time, or any other |
| 18 | information that may be relevant for data processing, is stored in the FITS | 18 | information that may be relevant for data processing, is stored in the FITS |
| 19 | -header of the event list binary table. An exemple for the metadata that is | 19 | +header of the event list binary table. An example for the metadata that is |
| 20 | included in the header of the H.E.S.S. Collaboration event lists is shown | 20 | included in the header of the H.E.S.S. Collaboration event lists is shown |
| 21 | below. | 21 | below. |
| 22 | 22 | ||
| @@ -27,7 +27,7 @@ below. | @@ -27,7 +27,7 @@ below. | ||
| 27 | Every event list needs to be accompanied by a table with so-called | 27 | Every event list needs to be accompanied by a table with so-called |
| 28 | :ref:`Good Time Intervals (GTIs) <glossary_gti>` where each row corresponds | 28 | :ref:`Good Time Intervals (GTIs) <glossary_gti>` where each row corresponds |
| 29 | to a time interval of continuous data taking, and the two columns correspond | 29 | to a time interval of continuous data taking, and the two columns correspond |
| 30 | -to the start and stop times of these time intervals. An exemple for the GTIs | 30 | +to the start and stop times of these time intervals. An example for the GTIs |
| 31 | of the H.E.S.S. event lists comprising a single GTI is shown below. | 31 | of the H.E.S.S. event lists comprising a single GTI is shown below. |
| 32 | 32 | ||
| 33 | .. figure:: gti.png | 33 | .. figure:: gti.png |
| @@ -39,3 +39,7 @@ and that the zero-point of the MET is specified by the ``MJDREFI`` and | @@ -39,3 +39,7 @@ and that the zero-point of the MET is specified by the ``MJDREFI`` and | ||
| 39 | ``MJDREFF`` keywords as the integer and fraction part of a Modified Julian Date | 39 | ``MJDREFF`` keywords as the integer and fraction part of a Modified Julian Date |
| 40 | (MJD) in the header of the GTI. The same holds also for the trigger times in | 40 | (MJD) in the header of the GTI. The same holds also for the trigger times in |
| 41 | the event list. | 41 | the event list. |
| 42 | + | ||
| 43 | +For further information on the data format we recommend to read the | ||
| 44 | +`Data formats for gamma-ray astronomy <https://gamma-astro-data-formats.readthedocs.io/en/latest/>`_ | ||
| 45 | +document. |
doc/source/users/user_manual/introduction.rst
| @@ -53,9 +53,8 @@ ctools are available through the ``ctools`` module, cscripts through the | @@ -53,9 +53,8 @@ ctools are available through the ``ctools`` module, cscripts through the | ||
| 53 | ``cscripts`` module. The following example illustrates how data can be simulated | 53 | ``cscripts`` module. The following example illustrates how data can be simulated |
| 54 | from Python: | 54 | from Python: |
| 55 | 55 | ||
| 56 | -.. code-block:: bash | 56 | +.. code-block:: python |
| 57 | 57 | ||
| 58 | - $ python | ||
| 59 | >>> import ctools | 58 | >>> import ctools |
| 60 | >>> sim = ctools.ctobssim() | 59 | >>> sim = ctools.ctobssim() |
| 61 | >>> sim["ra"] = 83.63 | 60 | >>> sim["ra"] = 83.63 |
| @@ -65,9 +64,8 @@ from Python: | @@ -65,9 +64,8 @@ from Python: | ||
| 65 | 64 | ||
| 66 | And here an example for generating a light curve from Python: | 65 | And here an example for generating a light curve from Python: |
| 67 | 66 | ||
| 68 | -.. code-block:: bash | 67 | +.. code-block:: python |
| 69 | 68 | ||
| 70 | - $ python | ||
| 71 | >>> import cslightcrv | 69 | >>> import cslightcrv |
| 72 | >>> lightcrv = cscripts.cslightcrv() | 70 | >>> lightcrv = cscripts.cslightcrv() |
| 73 | >>> lightcrv.execute() | 71 | >>> lightcrv.execute() |
| @@ -94,4 +92,27 @@ execution of a tool a new copy of the par file will be stored in the folder. If | @@ -94,4 +92,27 @@ execution of a tool a new copy of the par file will be stored in the folder. If | ||
| 94 | for some reason a parameter file got corrupt, simply delete it from ``$HOME/pfiles`` | 92 | for some reason a parameter file got corrupt, simply delete it from ``$HOME/pfiles`` |
| 95 | and start again. | 93 | and start again. |
| 96 | 94 | ||
| 95 | +There are two types of user parameters: those that will be queried when starting | ||
| 96 | +a tool and those that are hidden and not queried. Hidden parameters serve to | ||
| 97 | +define default values that normally need not to be changed, but exposing the | ||
| 98 | +parameters in the interface allows to change them by the user for fine tuning | ||
| 99 | +of a tool. An example for a hidden parameter of :ref:`ctobssim` is the ``seed`` | ||
| 100 | +parameter to set the initial seed value of the random number generator. To set | ||
| 101 | +a hidden parameter its value has to be specified on the command line. For | ||
| 102 | +example | ||
| 103 | + | ||
| 104 | +.. code-block:: bash | ||
| 105 | + | ||
| 106 | + $ ctobssim seed=41 | ||
| 97 | 107 | ||
| 108 | +will run :ref:`ctobssim` with a seed value of 41. Multiple hidden parameters | ||
| 109 | +specified on the command line need to be separated by a white space. In the | ||
| 110 | +Python interface, values of hidden parameters are specified in the same way as | ||
| 111 | +values of queried parameters, e.g. | ||
| 112 | + | ||
| 113 | +.. code-block:: python | ||
| 114 | + | ||
| 115 | + >>> import ctools | ||
| 116 | + >>> sim = ctools.ctobssim() | ||
| 117 | + >>> sim["seed"] = 41 | ||
| 118 | + ... |
doc/source/users/user_manual/likelihood.rst
| @@ -136,6 +136,8 @@ where | @@ -136,6 +136,8 @@ where | ||
| 136 | \alpha = \frac{\int_\mathrm{on} d\Omega}{\int_\mathrm{off} d\Omega} | 136 | \alpha = \frac{\int_\mathrm{on} d\Omega}{\int_\mathrm{off} d\Omega} |
| 137 | 137 | ||
| 138 | is the ratio between the solid angles of the On region and the Off region. | 138 | is the ratio between the solid angles of the On region and the Off region. |
| 139 | +The terms in the last row are added so that :math:`-2 \ln L(M_s)` follows a | ||
| 140 | +:math:`\chi^2` distribution. | ||
| 139 | 141 | ||
| 140 | Some special cases need to be handled separately in ``wstat``. | 142 | Some special cases need to be handled separately in ``wstat``. |
| 141 | If :math:`n^\mathrm{on}_i = 0` but :math:`n^\mathrm{off}_i > 0` the | 143 | If :math:`n^\mathrm{on}_i = 0` but :math:`n^\mathrm{off}_i > 0` the |
doc/source/users/user_manual/models_implementation.rst
| @@ -13,7 +13,7 @@ a spatial (tags ``<spatialModel>`` or ``<radialModel>``), and | @@ -13,7 +13,7 @@ a spatial (tags ``<spatialModel>`` or ``<radialModel>``), and | ||
| 13 | a temporal component (tag ``<temporal>``). | 13 | a temporal component (tag ``<temporal>``). |
| 14 | 14 | ||
| 15 | .. math:: | 15 | .. math:: |
| 16 | - M(x,y,E,t) = M_{\rm spatial}(x,y|E) \times M_{\rm spectral}(E) \times M_{\rm temporal}(t) | 16 | + M(p,E,t) = M_{\rm spatial}(p|E) \times M_{\rm spectral}(E) \times M_{\rm temporal}(t) |
| 17 | 17 | ||
| 18 | In this specific example, the source component ``Crab`` describes | 18 | In this specific example, the source component ``Crab`` describes |
| 19 | a point source at the location of the Crab nebula with a power law spectral | 19 | a point source at the location of the Crab nebula with a power law spectral |
doc/source/users/user_manual/models_spatial_src.rst
| @@ -347,8 +347,8 @@ Composite model | @@ -347,8 +347,8 @@ Composite model | ||
| 347 | which implements | 347 | which implements |
| 348 | 348 | ||
| 349 | .. math:: | 349 | .. math:: |
| 350 | - M_{\rm spatial}(x,y|E) = \frac{1}{N} \sum_{i=0}^{N-1} M_{\rm spatial}^{(i)}(x,y|E) | 350 | + M_{\rm spatial}(p|E) = \frac{1}{N} \sum_{i=0}^{N-1} M_{\rm spatial}^{(i)}(p|E) |
| 351 | 351 | ||
| 352 | - where :math:`M_{\rm spatial}^{(i)}(x,y|E)` is any spatial model component | 352 | + where :math:`M_{\rm spatial}^{(i)}(p|E)` is any spatial model component |
| 353 | (including another composite model), and :math:`N` is the number of | 353 | (including another composite model), and :math:`N` is the number of |
| 354 | model components that are combined. | 354 | model components that are combined. |
doc/source/users/user_manual/models_temporal.rst
| @@ -6,6 +6,16 @@ Temporal model components | @@ -6,6 +6,16 @@ Temporal model components | ||
| 6 | The following sections present the temporal model components that are available | 6 | The following sections present the temporal model components that are available |
| 7 | in ctools. | 7 | in ctools. |
| 8 | 8 | ||
| 9 | +.. warning:: | ||
| 10 | + Recall that the model is factorised according to | ||
| 11 | + | ||
| 12 | + .. math:: | ||
| 13 | + M(p,E,t) = M_{\rm spatial}(p|E) \times M_{\rm spectral}(E) \times M_{\rm temporal}(t) | ||
| 14 | + | ||
| 15 | + which implies that the temporal model component is multiplied with the | ||
| 16 | + spectral model component. | ||
| 17 | + | ||
| 18 | + | ||
| 9 | Constant | 19 | Constant |
| 10 | ^^^^^^^^ | 20 | ^^^^^^^^ |
| 11 | 21 |