Commit ac1a646099366dd4805db8272ed5a5dc48b2780b

Authored by Jürgen Knödlseder
1 parent a0c2cfae

Integrate IACT documentation.

ChangeLog
1 -2016-02-25 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> 1 +2016-02-26 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 2
3 * Version 1.1.0 released 3 * Version 1.1.0 released
4 ======================== 4 ========================
5 5
  6 + Add documentation for IACT analysis (#1646)
6 Adapt to revise GTime operators (#1714) 7 Adapt to revise GTime operators (#1714)
7 Add publish() methods to tools producing images (#1710) 8 Add publish() methods to tools producing images (#1710)
8 Read ahead output filename in cterror (#1700) 9 Read ahead output filename in cterror (#1700)
doc/source/user_manual/iact_analysis/analysis.rst
@@ -20,15 +20,16 @@ To check the available names of FITS data sets, it is recommended to run :ref:`c @@ -20,15 +20,16 @@ To check the available names of FITS data sets, it is recommended to run :ref:`c
20 $ csiactdata 20 $ csiactdata
21 Path were data is located [] /path/to/fits/data/ 21 Path were data is located [] /path/to/fits/data/
22 22
23 -This will list names of available FITS data sets on the screen. In the following it is assumed the users' choice  
24 -of the data set is called ``fits-data-name``. The query for the path where the data is located can be  
25 -omitted by setting environment variable ``$VHEFITS`` to this locations. This might be convenient  
26 -since some other tools also query for the same parameter and can use ``$VHEFITS`` instead. 23 +This will list names of available FITS data sets on the screen. In the
  24 +following it is assumed the user has selected a data set called ``fits-data-name``.
  25 +The query for the path where the data is located can be
  26 +omitted by setting the environment variable ``VHEFITS`` to this locations. This might be convenient
  27 +since some other tools also query for the same parameter and can use ``VHEFITS`` instead.
27 28
28 Find observations 29 Find observations
29 ----------------- 30 -----------------
30 To start an analysis, it is required to assemble a list of observations that should be used. For this purpose, 31 To start an analysis, it is required to assemble a list of observations that should be used. For this purpose,
31 -:ref:`csfindobs` searches for observations according to the user requirement. 32 +:ref:`csfindobs` searches for observations according to user criteria.
32 33
33 Search for sky pointings 34 Search for sky pointings
34 ^^^^^^^^^^^^^^^^^^^^^^^^ 35 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -44,11 +45,14 @@ The most common search for observations is by pointing position in the sky. @@ -44,11 +45,14 @@ The most common search for observations is by pointing position in the sky.
44 Runlist outfile [runlist.lis] 45 Runlist outfile [runlist.lis]
45 46
46 47
47 -Specifying additional search requirements  
48 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
49 -The search for observations can be further constrained arbitrarily. For this purpose, :ref:`csfindobs` contains a hidden parameter  
50 -``expression``. It is possible to use any FITS selection expression that is `supported by cfitsio <http://www.isdc.unige.ch/integral/download/osa/doc/10.1/osa_um_intro/node38.html>`_.  
51 -Available properties (i.e. column names) for selection, can be found `here <http://gamma-astro-data-formats.readthedocs.org/en/latest/data_storage/obs_index/index.html>`_ or by simply browsing the observation index file with a FITS viewer. 48 +Specifying additional search criteria
  49 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  50 +The search for observations can be further constrained arbitrarily. For this purpose,
  51 +:ref:`csfindobs` contains a hidden parameter ``expression``. It is possible to use any
  52 +FITS selection expression that is `supported by cfitsio <http://www.isdc.unige.ch/integral/download/osa/doc/10.1/osa_um_intro/node38.html>`_.
  53 +Available properties (i.e. column names) for selection, can be found
  54 +`here <http://gamma-astro-data-formats.readthedocs.org/en/latest/data_storage/obs_index/index.html>`_
  55 +or by simply browsing the observation index file with a FITS viewer.
52 56
53 Example: 57 Example:
54 58
@@ -57,13 +61,16 @@ Example: @@ -57,13 +61,16 @@ Example:
57 $ csfindobs expression="ZEN_PNT<30&&LIVETIME>1800" 61 $ csfindobs expression="ZEN_PNT<30&&LIVETIME>1800"
58 ... 62 ...
59 63
60 -This command selects all observations that have a zenith angle less than 30 degrees and a livetime larger than 30 minutes. 64 +This command selects all observations that have a zenith angle less than
  65 +30 degrees and a livetime larger than 1800 seconds (i.e. 30 minutes).
61 66
62 -Selections that don't include sky coordinates  
63 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
64 -The sky selection can also be omitted. For instance one does not always know the sky coordinate of a certain object.  
65 -Therefore, it is possible to search for the object name instead.  
66 -For this purpose one can simply pass an invalid coordinate to :ref:`csfindobs`. 67 +
  68 +Omitting the pointing selection
  69 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  70 +You can also omit the pointing selection, for example in case where you
  71 +don't know the sky coordinates of your object of interest. In that case, you
  72 +may directly use the object name in the expression and pass ``NONE`` as
  73 +coordinate to :ref:`csfindobs`:
67 74
68 .. code-block:: bash 75 .. code-block:: bash
69 76
@@ -72,18 +79,20 @@ For this purpose one can simply pass an invalid coordinate to :ref:`csfindobs`. @@ -72,18 +79,20 @@ For this purpose one can simply pass an invalid coordinate to :ref:`csfindobs`.
72 Right ascension [NONE] 79 Right ascension [NONE]
73 Runlist outfile [runlist.lis] 80 Runlist outfile [runlist.lis]
74 81
75 -The selection by region will simply be omitted. 82 +This will omit the selection of pointing positions.
76 83
77 .. note:: 84 .. note::
78 85
79 - On default, :ref:`csfindobs` only select data of highest quality (i.e. QUALITY=0). Specifying the hidden parameter e.g. ``min_qual=1``  
80 - allows to select all data with looser quality criteria. 86 + By default, :ref:`csfindobs` only selects data of highest quality (i.e. QUALITY=0).
  87 + You may overwrite this default by specifying the hidden parameter
  88 + ``min_qual``. For example, ``min_qual=1`` selects all data with a
  89 + looser quality criteria.
81 90
82 Create an observation list 91 Create an observation list
83 -------------------------- 92 --------------------------
84 The runlist ASCII file containing a list of selected observation IDs must now be converted to an 93 The runlist ASCII file containing a list of selected observation IDs must now be converted to an
85 -observation XML file. This file contains information about the location of the files that are required  
86 -for the analysis. The tool :ref:`csiactobs` is intended to do this conversion. 94 +observation definition XML file. This file contains information about the location of the files that are required
  95 +for the analysis. The purpose of the tool :ref:`csiactobs` is to do this conversion.
87 96
88 .. code-block:: bash 97 .. code-block:: bash
89 98
@@ -100,7 +109,7 @@ This tools has now performed various tasks: @@ -100,7 +109,7 @@ This tools has now performed various tasks:
100 * Create a model XML file that contains the background models. In ctools, each observation has its own independent background model. The number of free parameters per model was set to 1, i.e. the normalisation of the background is left free for each observation. The models were saved in ``bgmodels.xml``. 109 * Create a model XML file that contains the background models. In ctools, each observation has its own independent background model. The number of free parameters per model was set to 1, i.e. the normalisation of the background is left free for each observation. The models were saved in ``bgmodels.xml``.
101 * The tool uses an internal hierarchy for assigning the background models. The hidden parameter ``bkg_mod_hiera`` (default=irf|aeff|gauss) steers the order how background models should be created. In case the IRF background model is not available, the script automatically falls back to the background model from effective area (GCTAModelAeffBackground). 110 * The tool uses an internal hierarchy for assigning the background models. The hidden parameter ``bkg_mod_hiera`` (default=irf|aeff|gauss) steers the order how background models should be created. In case the IRF background model is not available, the script automatically falls back to the background model from effective area (GCTAModelAeffBackground).
102 * There are some further hidden parameters to steer the start parameters for the Aeff and Gaussian background model. Have a look at :ref:`csiactobs` to view a full list of parameters. 111 * There are some further hidden parameters to steer the start parameters for the Aeff and Gaussian background model. Have a look at :ref:`csiactobs` to view a full list of parameters.
103 -* In ``csiactobs.log`` (or on screen if ``debug=yes``), the script dumps the complete energy range of the observation container. These values might be important for later usage (e.g. in binned analysis). 112 +* In ``csiactobs.log`` (or on screen if ``debug=yes``), the script logs the complete energy range of the observation container. These values might be important for later usage (e.g. in binned analysis).
104 113
105 In case a sky model is already prepared, it is possible to also provide the hidden parameter ``inmodel``. The output 114 In case a sky model is already prepared, it is possible to also provide the hidden parameter ``inmodel``. The output
106 model XML file will then contain both, the background model and the input sky model: 115 model XML file will then contain both, the background model and the input sky model:
@@ -121,13 +130,13 @@ Note that the number of files to merge is not limited to two. Detailled options @@ -121,13 +130,13 @@ Note that the number of files to merge is not limited to two. Detailled options
121 be passed is given on the reference page of :ref:`csmodelmerge`. It is also important to know that each model in the container 130 be passed is given on the reference page of :ref:`csmodelmerge`. It is also important to know that each model in the container
122 must have a unique name. This implies, for instance, merging the same XML model twice will result in an exception. 131 must have a unique name. This implies, for instance, merging the same XML model twice will result in an exception.
123 132
124 -A list of available sky models can be found here: `models <http://gammalib.sourceforge.net/user_manual/modules/model.html>`_. 133 +A list of available sky models can be found `here <http://gammalib.sourceforge.net/user_manual/modules/model.html>`_.
125 Of particular help to create sky models for your dataset is the section about :ref:`modelling CTA data <models>`. 134 Of particular help to create sky models for your dataset is the section about :ref:`modelling CTA data <models>`.
126 135
127 136
128 Example XML files 137 Example XML files
129 ----------------- 138 -----------------
130 -To get familiar with the XML syntax and format example files for an observation container and a model container 139 +To get familiar with the XML syntax and format, example files for an observation container and a model container
131 are shown in the following. 140 are shown in the following.
132 141
133 Observation XML file 142 Observation XML file
@@ -211,7 +220,7 @@ Model XML file @@ -211,7 +220,7 @@ Model XML file
211 220
212 It is important to ensure background models are properly linked to their respective observation. 221 It is important to ensure background models are properly linked to their respective observation.
213 Therefore it is required to keep the attributes ``instrument`` and ``id`` the same for the observation 222 Therefore it is required to keep the attributes ``instrument`` and ``id`` the same for the observation
214 - and the corresponding background model. The tool :ref:`csiactobs` makes sure this is the case. 223 + and the corresponding background model. The tool :ref:`csiactobs` assures this automatically.
215 224
216 Run ctselect 225 Run ctselect
217 ------------ 226 ------------
@@ -239,7 +248,8 @@ to extract the safe energy range from the instrument response functions and appl @@ -239,7 +248,8 @@ to extract the safe energy range from the instrument response functions and appl
239 is thus superior to the energy limit passed via the user parameters. In addition, to analyse the complete field of view, 248 is thus superior to the energy limit passed via the user parameters. In addition, to analyse the complete field of view,
240 the parameter ``usepnt=yes`` uses, for each observation, the pointing position as centre for the selection radius. 249 the parameter ``usepnt=yes`` uses, for each observation, the pointing position as centre for the selection radius.
241 The radius parameter is dependent on the intrument, for an instrument with a 5 degree field of view, a radius of 2.5 degrees 250 The radius parameter is dependent on the intrument, for an instrument with a 5 degree field of view, a radius of 2.5 degrees
242 -seems reasonable. The time selection is not applied in the above example since an invalid time range was provided. 251 +seems reasonable. The time selection is not applied in the above example;
  252 +specifying 0 as start and end time skips the time selection.
243 For time-resolved analysis, it is important to know the MET time that is required to extract. 253 For time-resolved analysis, it is important to know the MET time that is required to extract.
244 The result of the selection step is written into the observation XML file ``selected_obs.xml``, which now contains references 254 The result of the selection step is written into the observation XML file ``selected_obs.xml``, which now contains references
245 to the new selected event FITS files. 255 to the new selected event FITS files.
@@ -256,7 +266,7 @@ file must now contain the background models and source components to describe th @@ -256,7 +266,7 @@ file must now contain the background models and source components to describe th
256 Source model [$CTOOLS/share/models/crab.xml] crab_models.xml 266 Source model [$CTOOLS/share/models/crab.xml] crab_models.xml
257 Source model output file [crab_results.xml] 267 Source model output file [crab_results.xml]
258 268
259 -The result of the fit was stored in 'crab_results.xml'. Note that fitted parameters, ``Prefactors`` in particular, 269 +The result of the fit was stored in ``crab_results.xml``. Note that fitted parameters, ``Prefactors`` in particular,
260 typically use MeV as energy unit. To monitor the progress of the fit on the screen, one can simply run with the option ``debug=yes``. 270 typically use MeV as energy unit. To monitor the progress of the fit on the screen, one can simply run with the option ``debug=yes``.
261 Alternatively, the logfile ``ctlike.log`` can be inspected after the fit. 271 Alternatively, the logfile ``ctlike.log`` can be inspected after the fit.
262 272
@@ -269,7 +279,7 @@ Stacked (binned) analysis @@ -269,7 +279,7 @@ Stacked (binned) analysis
269 The stacked analysis mode is using a binned analysis where all observations are included and stacked into one event cube. 279 The stacked analysis mode is using a binned analysis where all observations are included and stacked into one event cube.
270 This analysis mode is much faster than unbinned analysis when having a large dataset (e.g. > 100 hours). 280 This analysis mode is much faster than unbinned analysis when having a large dataset (e.g. > 100 hours).
271 For this type of binned analysis, some intermediate data products have to be produced. The products are a binned data cube, 281 For this type of binned analysis, some intermediate data products have to be produced. The products are a binned data cube,
272 -an exposure cube, a psf cube, and a background cube. 282 +an exposure cube, a PSF cube, and a background cube.
273 283
274 Bin events 284 Bin events
275 ^^^^^^^^^^ 285 ^^^^^^^^^^
@@ -291,7 +301,7 @@ Bin events @@ -291,7 +301,7 @@ Bin events
291 Number of energy bins [20] 301 Number of energy bins [20]
292 Output counts cube [cntcube.fits] 302 Output counts cube [cntcube.fits]
293 303
294 -Note that bins only get filled if bin of the cube is fully contained in the energy range and RoI of a considered observation. 304 +Note that bins only get filled if the bin of the cube is fully contained in the energy range and RoI of a considered observation.
295 It is therefore useful to provide the energy range given by :ref:`csiactobs` above. This ensures a maximum agreement between 305 It is therefore useful to provide the energy range given by :ref:`csiactobs` above. This ensures a maximum agreement between
296 observations and binning and reduces the loss of data. 306 observations and binning and reduces the loss of data.
297 307
@@ -300,7 +310,7 @@ Create exposure cube @@ -300,7 +310,7 @@ Create exposure cube
300 After binning the events into a three-dimensional cube, an exposure cube has to be computed. 310 After binning the events into a three-dimensional cube, an exposure cube has to be computed.
301 The exposure is defined as the effective area times the dead-time corrected observation time. 311 The exposure is defined as the effective area times the dead-time corrected observation time.
302 Each observation from the input container gets stacked in the resulting cube. The exposure is stored 312 Each observation from the input container gets stacked in the resulting cube. The exposure is stored
303 -in units of cm^2 s. The exposure cube does not have to contain the same binning as the event cube 313 +in units of :math:`cm^2 s`. The exposure cube does not have to contain the same binning as the event cube
304 but for simplicity, the event cube can be passed to adopt the binning parameters. Note, however, that the 314 but for simplicity, the event cube can be passed to adopt the binning parameters. Note, however, that the
305 exposure cube is defined in true sky coordinates and energy while the counts cube is defined in reconstructed 315 exposure cube is defined in true sky coordinates and energy while the counts cube is defined in reconstructed
306 sky coordinates and energy. Consequently, the sky area and energy range covered by the exposure cube should be 316 sky coordinates and energy. Consequently, the sky area and energy range covered by the exposure cube should be
@@ -309,7 +319,7 @@ and energy dispersion. By computing the exposure cube on the same grid as the co @@ -309,7 +319,7 @@ and energy dispersion. By computing the exposure cube on the same grid as the co
309 from sources at the edge of cube will not be handled correctly. In the example below, however, no source at the edge of the 319 from sources at the edge of cube will not be handled correctly. In the example below, however, no source at the edge of the
310 field of view is present. Therefore, for simplicity, the count cube is used as input cube to extract the binning. 320 field of view is present. Therefore, for simplicity, the count cube is used as input cube to extract the binning.
311 321
312 -This task of computing the exposure cube is is performed by:ref:`ctexpcube`. 322 +This task of computing the exposure cube is is performed by :ref:`ctexpcube`.
313 323
314 .. code-block:: bash 324 .. code-block:: bash
315 325
@@ -337,13 +347,13 @@ Alternatively, the exposure cube can be created with different binning than the @@ -337,13 +347,13 @@ Alternatively, the exposure cube can be created with different binning than the
337 Number of energy bins [20] 30 347 Number of energy bins [20] 30
338 Output exposure cube file [expcube.fits] 348 Output exposure cube file [expcube.fits]
339 349
340 -Create psf cube 350 +Create PSF cube
341 ^^^^^^^^^^^^^^^ 351 ^^^^^^^^^^^^^^^
342 As a next step for the binned analysis, a cube containing the point spread function (PSF) must be computed. 352 As a next step for the binned analysis, a cube containing the point spread function (PSF) must be computed.
343 -Since the PSF cannot be stored by one single parameter, The PSF cube computed by :ref:`ctpsfcube` has a fourth dimension.  
344 -In each bin of the cube, the PSF ist stored as a function of offset from source. The granularity of the 353 +Since the PSF cannot be stored by one single parameter, the PSF cube computed by :ref:`ctpsfcube` has a fourth dimension.
  354 +In each bin of the cube, the PSF is stored as a function of offset from source. The granularity of the
345 PSF histogram is determined by the hidden parameter ``anumbins`` (default: 200). Therefore, when passing 355 PSF histogram is determined by the hidden parameter ``anumbins`` (default: 200). Therefore, when passing
346 -the event cube ot adopt the sky binning for the PSF cube, the resulting FITS file can become quite large due to 356 +the event cube to adopt the sky binning for the PSF cube, the resulting FITS file can become quite large due to
347 the fourth dimension. Usually in IACT analysis, the PSF doesn't change too dramatically across the field of view. 357 the fourth dimension. Usually in IACT analysis, the PSF doesn't change too dramatically across the field of view.
348 Therefore the user can think about reducing the spatial binning of the PSF cube: 358 Therefore the user can think about reducing the spatial binning of the PSF cube:
349 359
doc/source/user_manual/iact_analysis/copy.rst
@@ -27,7 +27,7 @@ in the mounted directory. @@ -27,7 +27,7 @@ in the mounted directory.
27 27
28 Copy data 28 Copy data
29 --------- 29 ---------
30 -After mounting the file system to a folder of your choosing (``/path/to/mountpoint/`` in this case), the copying of the data can be initiated. 30 +After mounting the file system to a folder of your choice (``/path/to/mountpoint/`` in this case), the copying of the data can be initiated.
31 To monitor the progress on the screen, the hidden parameter ``debug=yes`` can be used. To increase the chattiness of the output, 31 To monitor the progress on the screen, the hidden parameter ``debug=yes`` can be used. To increase the chattiness of the output,
32 the hidden parameter ``chatter`` can e.g. be set to 3. 32 the hidden parameter ``chatter`` can e.g. be set to 3.
33 33
@@ -38,8 +38,9 @@ the hidden parameter ``chatter`` can e.g. be set to 3. @@ -38,8 +38,9 @@ the hidden parameter ``chatter`` can e.g. be set to 3.
38 Name of FITS production to download [iact-fits] 38 Name of FITS production to download [iact-fits]
39 Destination path of FITS data [/path/to/local/fits/data/] 39 Destination path of FITS data [/path/to/local/fits/data/]
40 40
41 -The name of the FITS production must be available in the remote ``master.json`` file. In case the names of the available productions is unkown  
42 -there are two options to find out: 41 +The name of the FITS production must be available in the remote
  42 +``master.json`` file. In case the names of the available productions are unkown
  43 +there are two options to determine an appropriate name:
43 44
44 * Run :ref:`csiactdata` and set as ``datapath`` the mountpoint 45 * Run :ref:`csiactdata` and set as ``datapath`` the mountpoint
45 * Try any name, :ref:`csiactcopy` will throw a ``RuntimeError`` with the available production names if the input name is not found 46 * Try any name, :ref:`csiactcopy` will throw a ``RuntimeError`` with the available production names if the input name is not found
doc/source/user_manual/iact_analysis/index.rst
1 -================================  
2 -Analysis using current IACT data  
3 -================================ 1 +Analysing current IACT data
  2 +===========================
4 3
5 .. toctree:: 4 .. toctree::
6 :maxdepth: 2 5 :maxdepth: 2