Commit fc7ddbc3354f0eb5d4c92a2197780411c2f53e8f

Authored by Jürgen Knödlseder
1 parent a4fbcc45

Update user documentation for release 0.9

doc/source/user_manual/getting.rst
@@ -31,7 +31,7 @@ Installing gammalib @@ -31,7 +31,7 @@ Installing gammalib
31 ctools is built on top of gammalib, hence gammalib needs to be built, 31 ctools is built on top of gammalib, hence gammalib needs to be built,
32 installed and configured before ctools can be installed. In case that 32 installed and configured before ctools can be installed. In case that
33 ctools is already installed on your system you may skip reading this 33 ctools is already installed on your system you may skip reading this
34 -section and continue with Section TBD that explains how to install ctools. 34 +section and continue with the :ref:`sec_building_ctools` section.
35 35
36 You will need the following to build the gammalib: 36 You will need the following to build the gammalib:
37 37
@@ -59,7 +59,7 @@ in an appropriate location (for example ``$HOME/builds``), and type @@ -59,7 +59,7 @@ in an appropriate location (for example ``$HOME/builds``), and type
59 59
60 .. code-block:: bash 60 .. code-block:: bash
61 61
62 - $ tar xvfz gammalib-1.0.0.tar.gz 62 + $ tar xvfz gammalib-0.10.0.tar.gz
63 63
64 (the ``$`` symbol indicates the console prompt and is not part of the 64 (the ``$`` symbol indicates the console prompt and is not part of the
65 command that you should type in). 65 command that you should type in).
@@ -69,7 +69,7 @@ typing @@ -69,7 +69,7 @@ typing
69 69
70 .. code-block:: bash 70 .. code-block:: bash
71 71
72 - $ cd gammalib-1.0.0 72 + $ cd gammalib-0.10.0
73 $ ./configure 73 $ ./configure
74 $ make 74 $ make
75 $ make check 75 $ make check
@@ -117,6 +117,8 @@ If you use C shell or a variant then add the following to your @@ -117,6 +117,8 @@ If you use C shell or a variant then add the following to your
117 source $GAMMALIB/bin/gammalib-init.csh 117 source $GAMMALIB/bin/gammalib-init.csh
118 118
119 119
  120 +.. _sec_building_ctools:
  121 +
120 Building ctools 122 Building ctools
121 --------------- 123 ---------------
122 124
@@ -125,7 +127,7 @@ an appropriate location (for example ``$HOME/builds``), and type @@ -125,7 +127,7 @@ an appropriate location (for example ``$HOME/builds``), and type
125 127
126 .. code-block:: bash 128 .. code-block:: bash
127 129
128 - $ tar xvfz ctools-1.0.0.tar.gz 130 + $ tar xvfz ctools-0.9.0.tar.gz
129 131
130 (the ``$`` symbol indicates the console prompt and is not part of the 132 (the ``$`` symbol indicates the console prompt and is not part of the
131 command that you should type in). 133 command that you should type in).
@@ -134,7 +136,7 @@ Step in the directory and build the ctools by typing @@ -134,7 +136,7 @@ Step in the directory and build the ctools by typing
134 136
135 .. code-block:: bash 137 .. code-block:: bash
136 138
137 - $ cd ctools-1.0.0 139 + $ cd ctools-0.9.0
138 $ ./configure 140 $ ./configure
139 $ make 141 $ make
140 142
@@ -171,7 +173,7 @@ following output at the end of the unit testing: @@ -171,7 +173,7 @@ following output at the end of the unit testing:
171 PASS: test_python.py 173 PASS: test_python.py
172 make[4]: Nothing to be done for `all'. 174 make[4]: Nothing to be done for `all'.
173 ============================================================================ 175 ============================================================================
174 - Testsuite summary for ctools 1.0.0 176 + Testsuite summary for ctools 0.9.0
175 ============================================================================ 177 ============================================================================
176 # TOTAL: 3 178 # TOTAL: 3
177 # PASS: 3 179 # PASS: 3
@@ -189,26 +191,33 @@ For older automake version, you should see @@ -189,26 +191,33 @@ For older automake version, you should see
189 *************** 191 ***************
190 * Test ctools * 192 * Test ctools *
191 *************** 193 ***************
192 - Test ctobssim: .... ok 194 + Test ctobssim: .. ok
193 Test ctskymap: .. ok 195 Test ctskymap: .. ok
194 Test ctbin: .... ok 196 Test ctbin: .... ok
195 - Test ctmodel: ...... ok  
196 - Test ctselect: .. ok  
197 - Test ctlike: ........ ok  
198 - Test cttsmap: .. ok  
199 Test ctexpcube: .... ok 197 Test ctexpcube: .... ok
200 Test ctpsfcube: .... ok 198 Test ctpsfcube: .... ok
201 Test ctbkgcube: ...... ok 199 Test ctbkgcube: ...... ok
  200 + Test ctmodel: ...... ok
  201 + Test ctselect: .. ok
  202 + Test ctlike: ...... ok
  203 + Test cttsmap: .. ok
202 Test ctcubemask: .. ok 204 Test ctcubemask: .. ok
203 Test ctbutterfly: .. ok 205 Test ctbutterfly: .. ok
  206 + Test ctulimit: .. ok
204 PASS: test_ctools.sh 207 PASS: test_ctools.sh
205 208
206 ***************** 209 *****************
207 * Test cscripts * 210 * Test cscripts *
208 ***************** 211 *****************
  212 + Test csobsdef: .. ok
209 Test cspull: .. ok 213 Test cspull: .. ok
  214 + Test cssens: .. ok
210 Test cstsdist: .. ok 215 Test cstsdist: .. ok
211 Test csresmap: .. ok 216 Test csresmap: .. ok
  217 + Test csspec (unbinned): .. ok
  218 + Test csspec (binned): .. ok
  219 + Test cslightcrv (unbinned): .. ok
  220 + Test cslightcrv (binned): .. ok
212 PASS: test_cscripts.sh 221 PASS: test_cscripts.sh
213 222
214 *********************** 223 ***********************
@@ -227,6 +236,7 @@ For older automake version, you should see @@ -227,6 +236,7 @@ For older automake version, you should see
227 Test ctbkgcube functionality: ... ok 236 Test ctbkgcube functionality: ... ok
228 Test ctcubemask functionality: ... ok 237 Test ctcubemask functionality: ... ok
229 Test ctbutterfly functionality: ... ok 238 Test ctbutterfly functionality: ... ok
  239 + Test ctulimit functionality: ... ok
230 Test unbinned pipeline with FITS file saving: .... ok 240 Test unbinned pipeline with FITS file saving: .... ok
231 Test unbinned in-memory pipeline: .... ok 241 Test unbinned in-memory pipeline: .... ok
232 PASS: test_python.py 242 PASS: test_python.py
@@ -307,9 +317,8 @@ GammaLib unit tests fail @@ -307,9 +317,8 @@ GammaLib unit tests fail
307 317
308 Some users have reported failure of a large fraction of the GammaLib unit 318 Some users have reported failure of a large fraction of the GammaLib unit
309 tests after after typing ``make check``. In all cases, this was related to 319 tests after after typing ``make check``. In all cases, this was related to
310 -the absence of the directory where the shared ``libcfitsio`` library  
311 -resides in the library load path. To solve the issue, locate the directory  
312 -where the shared ``libcfitsio`` library resides and then type 320 +not finding the ``libcfitsio`` library. To solve the issue, locate the
  321 +directory where the shared ``libcfitsio`` library resides and then type
313 322
314 .. code-block:: bash 323 .. code-block:: bash
315 324
doc/source/user_manual/getting_started/beyond_combine.rst
@@ -20,12 +20,12 @@ nebula, each offset by 0.5 deg from the nebula in opposite directions: @@ -20,12 +20,12 @@ nebula, each offset by 0.5 deg from the nebula in opposite directions:
20 RA of pointing (degrees) (0-360) [83.63] 20 RA of pointing (degrees) (0-360) [83.63]
21 Dec of pointing (degrees) (-90-90) [22.01] 21.51 21 Dec of pointing (degrees) (-90-90) [22.01] 21.51
22 Radius of FOV (degrees) (0-180) [5.0] 22 Radius of FOV (degrees) (0-180) [5.0]
23 - Start time (MET in s) (0) [0.0]  
24 - End time (MET in s) (0) [1800.0]  
25 - Lower energy limit (TeV) (0) [0.1]  
26 - Upper energy limit (TeV) (0) [100.0]  
27 - Calibration database [dummy]  
28 - Instrument response function [cta_dummy_irf] 23 + Start time (MET in s) [0.0]
  24 + End time (MET in s) [1800.0]
  25 + Lower energy limit (TeV) [0.1]
  26 + Upper energy limit (TeV) [100.0]
  27 + Calibration database [prod2]
  28 + Instrument response function [South_50h]
29 Model [$CTOOLS/share/models/crab.xml] 29 Model [$CTOOLS/share/models/crab.xml]
30 Output event data file or observation definition file [events.fits] events1.fits 30 Output event data file or observation definition file [events.fits] events1.fits
31 31
@@ -35,12 +35,12 @@ nebula, each offset by 0.5 deg from the nebula in opposite directions: @@ -35,12 +35,12 @@ nebula, each offset by 0.5 deg from the nebula in opposite directions:
35 RA of pointing (degrees) (0-360) [83.63] 35 RA of pointing (degrees) (0-360) [83.63]
36 Dec of pointing (degrees) (-90-90) [21.51] 22.51 36 Dec of pointing (degrees) (-90-90) [21.51] 22.51
37 Radius of FOV (degrees) (0-180) [5.0] 37 Radius of FOV (degrees) (0-180) [5.0]
38 - Start time (MET in s) (0) [0.0]  
39 - End time (MET in s) (0) [1800.0]  
40 - Lower energy limit (TeV) (0) [0.1]  
41 - Upper energy limit (TeV) (0) [100.0]  
42 - Calibration database [dummy]  
43 - Instrument response function [cta_dummy_irf] 38 + Start time (MET in s) [0.0]
  39 + End time (MET in s) [1800.0]
  40 + Lower energy limit (TeV) [0.1]
  41 + Upper energy limit (TeV) [100.0]
  42 + Calibration database [prod2]
  43 + Instrument response function [South_50h]
44 Model [$CTOOLS/share/models/crab.xml] 44 Model [$CTOOLS/share/models/crab.xml]
45 Output event data file or observation definition file [events1.fits] events2.fits 45 Output event data file or observation definition file [events1.fits] events2.fits
46 46
@@ -92,11 +92,11 @@ Now we are ready to do a joint maximum likelihood analysis using @@ -92,11 +92,11 @@ Now we are ready to do a joint maximum likelihood analysis using
92 .. code-block:: bash 92 .. code-block:: bash
93 93
94 $ ctlike 94 $ ctlike
95 - Event list, counts cube or observation definition file [events.fits] obs.xml  
96 - Calibration database [dummy]  
97 - Instrument response function [cta_dummy_irf] 95 + Event list, counts cube or observation definition file [selected_events.fits] obs.xml
  96 + Calibration database [prod2]
  97 + Instrument response function [South_50h]
98 Source model [$CTOOLS/share/models/crab.xml] 98 Source model [$CTOOLS/share/models/crab.xml]
99 - Source model output file [crab_results.xml] 99 + Source model output file [crab_results.xml]
100 100
101 Instead of providing an event list or a counts cube, we now provided the 101 Instead of providing an event list or a counts cube, we now provided the
102 filename of the observation definition XML file (here ``obs.xml``) as input 102 filename of the observation definition XML file (here ``obs.xml``) as input
@@ -106,102 +106,96 @@ joint analysis, as indicated in the log file: @@ -106,102 +106,96 @@ joint analysis, as indicated in the log file:
106 106
107 .. code-block:: xml 107 .. code-block:: xml
108 108
109 - 2015-02-04T20:33:26: +==============+  
110 - 2015-02-04T20:33:26: | Observations |  
111 - 2015-02-04T20:33:26: +==============+  
112 - 2015-02-04T20:33:26: === GObservations ===  
113 - 2015-02-04T20:33:26: Number of observations ....: 2  
114 - 2015-02-04T20:33:26: Number of predicted events : 0  
115 - 2015-02-04T20:33:26: === GCTAObservation ===  
116 - 2015-02-04T20:33:26: Name ......................: Crab  
117 - 2015-02-04T20:33:26: Identifier ................: 00001  
118 - 2015-02-04T20:33:26: Instrument ................: CTA  
119 - 2015-02-04T20:33:26: Event file ................: events1.fits  
120 - 2015-02-04T20:33:26: Event type ................: EventList  
121 - 2015-02-04T20:33:26: Statistics ................: Poisson  
122 - 2015-02-04T20:33:26: Ontime ....................: 1800 s  
123 - 2015-02-04T20:33:26: Livetime ..................: 1710 s  
124 - 2015-02-04T20:33:26: Deadtime correction .......: 0.95  
125 - 2015-02-04T20:33:26: User energy range .........: undefined  
126 - 2015-02-04T20:33:26: === GCTAPointing ===  
127 - 2015-02-04T20:33:26: Pointing direction ........: (RA,Dec)=(83.63,21.51) 109 + 2015-05-22T20:17:07: +==============+
  110 + 2015-05-22T20:17:07: | Observations |
  111 + 2015-05-22T20:17:07: +==============+
  112 + 2015-05-22T20:17:07: === GObservations ===
  113 + 2015-05-22T20:17:07: Number of observations ....: 2
  114 + 2015-05-22T20:17:07: Number of predicted events : 0
  115 + 2015-05-22T20:17:07: === GCTAObservation ===
  116 + 2015-05-22T20:17:07: Name ......................:
  117 + 2015-05-22T20:17:07: Identifier ................: 00001
  118 + 2015-05-22T20:17:07: Instrument ................: CTA
  119 + 2015-05-22T20:17:07: Event file ................: events1.fits
  120 + 2015-05-22T20:17:07: Event type ................: EventList
  121 + 2015-05-22T20:17:07: Statistics ................: Poisson
  122 + 2015-05-22T20:17:07: Ontime ....................: 1800 s
  123 + 2015-05-22T20:17:07: Livetime ..................: 1710 s
  124 + 2015-05-22T20:17:07: Deadtime correction .......: 0.95
  125 + 2015-05-22T20:17:07: User energy range .........: undefined
  126 + 2015-05-22T20:17:07: === GCTAPointing ===
  127 + 2015-05-22T20:17:07: Pointing direction ........: (RA,Dec)=(83.63,21.51)
128 ... 128 ...
129 - 2015-02-04T20:33:26: === GCTAObservation ===  
130 - 2015-02-04T20:33:26: Name ......................: Crab  
131 - 2015-02-04T20:33:26: Identifier ................: 00002  
132 - 2015-02-04T20:33:26: Instrument ................: CTA  
133 - 2015-02-04T20:33:26: Event file ................: events2.fits  
134 - 2015-02-04T20:33:26: Event type ................: EventList  
135 - 2015-02-04T20:33:26: Statistics ................: Poisson  
136 - 2015-02-04T20:33:26: Ontime ....................: 1800 s  
137 - 2015-02-04T20:33:26: Livetime ..................: 1710 s  
138 - 2015-02-04T20:33:26: Deadtime correction .......: 0.95  
139 - 2015-02-04T20:33:26: User energy range .........: undefined  
140 - 2015-02-04T20:33:26: === GCTAPointing ===  
141 - 2015-02-04T20:33:26: Pointing direction ........: (RA,Dec)=(83.63,22.51) 129 + 2015-05-22T20:17:07: === GCTAObservation ===
  130 + 2015-05-22T20:17:07: Name ......................:
  131 + 2015-05-22T20:17:07: Identifier ................: 00002
  132 + 2015-05-22T20:17:07: Instrument ................: CTA
  133 + 2015-05-22T20:17:07: Event file ................: events2.fits
  134 + 2015-05-22T20:17:07: Event type ................: EventList
  135 + 2015-05-22T20:17:07: Statistics ................: Poisson
  136 + 2015-05-22T20:17:07: Ontime ....................: 1800 s
  137 + 2015-05-22T20:17:07: Livetime ..................: 1710 s
  138 + 2015-05-22T20:17:07: Deadtime correction .......: 0.95
  139 + 2015-05-22T20:17:07: User energy range .........: undefined
  140 + 2015-05-22T20:17:07: === GCTAPointing ===
  141 + 2015-05-22T20:17:07: Pointing direction ........: (RA,Dec)=(83.63,22.51)
142 ... 142 ...
143 - 2015-02-04T20:33:26: +=================================+  
144 - 2015-02-04T20:33:26: | Maximum likelihood optimisation |  
145 - 2015-02-04T20:33:26: +=================================+  
146 - 2015-02-04T20:33:26: >Iteration 0: -logL=89099.788, Lambda=1.0e-03  
147 - 2015-02-04T20:33:26: >Iteration 1: -logL=89094.435, Lambda=1.0e-03, delta=5.353, max(|grad|)=-4.388872 [Normalization:7]  
148 - 2015-02-04T20:33:26: >Iteration 2: -logL=89094.420, Lambda=1.0e-04, delta=0.015, max(|grad|)=-0.116432 [Index:3]  
149 - 2015-02-04T20:33:26: >Iteration 3: -logL=89094.420, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.003989 [Index:3]  
150 - 2015-02-04T20:33:26:  
151 - 2015-02-04T20:33:26: +=========================================+  
152 - 2015-02-04T20:33:26: | Maximum likelihood optimization results |  
153 - 2015-02-04T20:33:26: +=========================================+  
154 - 2015-02-04T20:33:26: === GOptimizerLM ===  
155 - 2015-02-04T20:33:26: Optimized function value ..: 89094.420  
156 - 2015-02-04T20:33:26: Absolute precision ........: 0.005  
157 - 2015-02-04T20:33:26: Acceptable value decrease .: 2  
158 - 2015-02-04T20:33:26: Optimization status .......: converged  
159 - 2015-02-04T20:33:26: Number of parameters ......: 9  
160 - 2015-02-04T20:33:26: Number of free parameters .: 4  
161 - 2015-02-04T20:33:26: Number of iterations ......: 3  
162 - 2015-02-04T20:33:26: Lambda ....................: 1e-06  
163 - 2015-02-04T20:33:26: Maximum log likelihood ....: -89094.420  
164 - 2015-02-04T20:33:26: Observed events (Nobs) ...: 12260.000  
165 - 2015-02-04T20:33:26: Predicted events (Npred) ..: 12260.000 (Nobs - Npred = 6.95764e-06)  
166 - 2015-02-04T20:33:26: === GModels ===  
167 - 2015-02-04T20:33:26: Number of models ..........: 2  
168 - 2015-02-04T20:33:26: Number of parameters ......: 9  
169 - 2015-02-04T20:33:26: === GModelSky ===  
170 - 2015-02-04T20:33:26: Name ......................: Crab  
171 - 2015-02-04T20:33:26: Instruments ...............: all  
172 - 2015-02-04T20:33:26: Instrument scale factors ..: unity  
173 - 2015-02-04T20:33:26: Observation identifiers ...: all  
174 - 2015-02-04T20:33:26: Model type ................: PointSource  
175 - 2015-02-04T20:33:26: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
176 - 2015-02-04T20:33:26: Number of parameters ......: 6  
177 - 2015-02-04T20:33:26: Number of spatial par's ...: 2  
178 - 2015-02-04T20:33:26: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
179 - 2015-02-04T20:33:26: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
180 - 2015-02-04T20:33:26: Number of spectral par's ..: 3  
181 - 2015-02-04T20:33:26: Prefactor ................: 6.06322e-16 +/- 1.44948e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
182 - 2015-02-04T20:33:26: Index ....................: -2.49814 +/- 0.0178524 [-0,-5] (free,scale=-1,gradient)  
183 - 2015-02-04T20:33:26: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
184 - 2015-02-04T20:33:26: Number of temporal par's ..: 1  
185 - 2015-02-04T20:33:26: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
186 - 2015-02-04T20:33:26: === GCTAModelRadialAcceptance ===  
187 - 2015-02-04T20:33:26: Name ......................: Background  
188 - 2015-02-04T20:33:26: Instruments ...............: CTA  
189 - 2015-02-04T20:33:26: Instrument scale factors ..: unity  
190 - 2015-02-04T20:33:26: Observation identifiers ...: all  
191 - 2015-02-04T20:33:26: Model type ................: "Gaussian" * "FileFunction" * "Constant"  
192 - 2015-02-04T20:33:26: Number of parameters ......: 3  
193 - 2015-02-04T20:33:26: Number of radial par's ....: 1  
194 - 2015-02-04T20:33:26: Sigma ....................: 3.0356 +/- 0.0215259 [0.01,10] deg2 (free,scale=1,gradient)  
195 - 2015-02-04T20:33:26: Number of spectral par's ..: 1  
196 - 2015-02-04T20:33:26: Normalization ............: 0.99936 +/- 0.0122024 [0,1000] (free,scale=1,gradient)  
197 - 2015-02-04T20:33:26: Number of temporal par's ..: 1  
198 - 2015-02-04T20:33:26: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
199 - 2015-02-04T20:33:26:  
200 - 2015-02-04T20:33:26: +==============+  
201 - 2015-02-04T20:33:26: | Save results |  
202 - 2015-02-04T20:33:26: +==============+  
203 - 2015-02-04T20:33:26:  
204 - 2015-02-04T20:33:26: Application "ctlike" terminated after 10 wall clock seconds, consuming 0.385432 seconds of CPU time. 143 + 2015-05-22T20:17:07: +=================================+
  144 + 2015-05-22T20:17:07: | Maximum likelihood optimisation |
  145 + 2015-05-22T20:17:07: +=================================+
  146 + 2015-05-22T20:17:07: >Iteration 0: -logL=201836.657, Lambda=1.0e-03
  147 + 2015-05-22T20:17:07: >Iteration 1: -logL=201829.438, Lambda=1.0e-03, delta=7.220, max(|grad|)=22.756507 [Index:7]
  148 + 2015-05-22T20:17:07: >Iteration 2: -logL=201829.432, Lambda=1.0e-04, delta=0.005, max(|grad|)=0.086395 [Index:3]
  149 + 2015-05-22T20:17:07: >Iteration 3: -logL=201829.432, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.001287 [Index:3]
  150 + 2015-05-22T20:17:07:
  151 + 2015-05-22T20:17:07: +=========================================+
  152 + 2015-05-22T20:17:07: | Maximum likelihood optimization results |
  153 + 2015-05-22T20:17:07: +=========================================+
  154 + 2015-05-22T20:17:07: === GOptimizerLM ===
  155 + 2015-05-22T20:17:07: Optimized function value ..: 201829.432
  156 + 2015-05-22T20:17:07: Absolute precision ........: 0.005
  157 + 2015-05-22T20:17:07: Acceptable value decrease .: 2
  158 + 2015-05-22T20:17:07: Optimization status .......: converged
  159 + 2015-05-22T20:17:07: Number of parameters ......: 10
  160 + 2015-05-22T20:17:07: Number of free parameters .: 4
  161 + 2015-05-22T20:17:07: Number of iterations ......: 3
  162 + 2015-05-22T20:17:07: Lambda ....................: 1e-06
  163 + 2015-05-22T20:17:07: Maximum log likelihood ....: -201829.432
  164 + 2015-05-22T20:17:07: Observed events (Nobs) ...: 31799.000
  165 + 2015-05-22T20:17:07: Predicted events (Npred) ..: 31799.000 (Nobs - Npred = 2.67544e-06)
  166 + 2015-05-22T20:17:07: === GModels ===
  167 + 2015-05-22T20:17:07: Number of models ..........: 2
  168 + 2015-05-22T20:17:07: Number of parameters ......: 10
  169 + 2015-05-22T20:17:07: === GModelSky ===
  170 + 2015-05-22T20:17:07: Name ......................: Crab
  171 + 2015-05-22T20:17:07: Instruments ...............: all
  172 + 2015-05-22T20:17:07: Instrument scale factors ..: unity
  173 + 2015-05-22T20:17:07: Observation identifiers ...: all
  174 + 2015-05-22T20:17:07: Model type ................: PointSource
  175 + 2015-05-22T20:17:07: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  176 + 2015-05-22T20:17:07: Number of parameters ......: 6
  177 + 2015-05-22T20:17:07: Number of spatial par's ...: 2
  178 + 2015-05-22T20:17:07: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  179 + 2015-05-22T20:17:07: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  180 + 2015-05-22T20:17:07: Number of spectral par's ..: 3
  181 + 2015-05-22T20:17:07: Prefactor ................: 5.8727e-16 +/- 8.04314e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  182 + 2015-05-22T20:17:07: Index ....................: -2.49825 +/- 0.0118418 [-0,-5] (free,scale=-1,gradient)
  183 + 2015-05-22T20:17:07: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  184 + 2015-05-22T20:17:07: Number of temporal par's ..: 1
  185 + 2015-05-22T20:17:07: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  186 + 2015-05-22T20:17:07: === GCTAModelIrfBackground ===
  187 + 2015-05-22T20:17:07: Name ......................: CTABackgroundModel
  188 + 2015-05-22T20:17:07: Instruments ...............: CTA
  189 + 2015-05-22T20:17:07: Instrument scale factors ..: unity
  190 + 2015-05-22T20:17:07: Observation identifiers ...: all
  191 + 2015-05-22T20:17:07: Model type ................: "PowerLaw" * "Constant"
  192 + 2015-05-22T20:17:07: Number of parameters ......: 4
  193 + 2015-05-22T20:17:07: Number of spectral par's ..: 3
  194 + 2015-05-22T20:17:07: Prefactor ................: 1.01608 +/- 0.0152751 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  195 + 2015-05-22T20:17:07: Index ....................: 0.0226023 +/- 0.0086794 [-5,5] (free,scale=1,gradient)
  196 + 2015-05-22T20:17:07: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  197 + 2015-05-22T20:17:07: Number of temporal par's ..: 1
  198 + 2015-05-22T20:17:07: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
205 199
206 The log file indicates that the fit converged quickly, the spectral 200 The log file indicates that the fit converged quickly, the spectral
207 parameters of the Crab nebula have now been constrained using the events 201 parameters of the Crab nebula have now been constrained using the events
doc/source/user_manual/getting_started/beyond_irf.rst
@@ -3,33 +3,50 @@ @@ -3,33 +3,50 @@
3 Connecting observations to dedicated instrument response functions 3 Connecting observations to dedicated instrument response functions
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 -.. note::  
7 -  
8 - To execute the following examples on your machine you need to  
9 - install a specific calibration database. Download the file  
10 - :download:`caldb.tar.gz <caldb.tar.gz>` into a local working  
11 - directory, decompress and untar the folder, and set the calibration  
12 - database to this folder by typing:  
13 -  
14 - .. code-block:: bash  
15 -  
16 - $ export CALDB=$PWD/caldb  
17 -  
18 - Note that the response functions in the calibration database  
19 - are all identical to the ``cta_dummy_irf`` response, yet there  
20 - a multiple database and response entries so that the usage of  
21 - specific response functions can be emulated.  
22 -  
23 So far the same instrument response function has been used for all 6 So far the same instrument response function has been used for all
24 observations in our analysis examples. 7 observations in our analysis examples.
25 You may have recognised that we always specified the calibration database 8 You may have recognised that we always specified the calibration database
26 -``dummy`` and the instrument response function ``cta_dummy_irf`` that  
27 -are shipped with the ctools release. 9 +``prod2`` and the instrument response function ``South_50h`` that
  10 +are shipped with ctools.
28 When combining multiple observations in a joint analysis we may however 11 When combining multiple observations in a joint analysis we may however
29 need to specify dedicated instrument response functions for the 12 need to specify dedicated instrument response functions for the
30 different observations. 13 different observations.
31 -This can be done by adding the calibration information to the observation  
32 -definition XML file: 14 +
  15 +Let's simulate two observations of the Crab nebula, one done with
  16 +the northern array and the other with the southern array:
  17 +
  18 +.. code-block:: bash
  19 +
  20 + $ ctobssim
  21 + RA of pointing (degrees) (0-360) [83.63]
  22 + Dec of pointing (degrees) (-90-90) [22.01] 21.51
  23 + Radius of FOV (degrees) (0-180) [5.0]
  24 + Start time (MET in s) [0.0]
  25 + End time (MET in s) [1800.0]
  26 + Lower energy limit (TeV) [0.1]
  27 + Upper energy limit (TeV) [100.0]
  28 + Calibration database [prod2]
  29 + Instrument response function [South_50h] North_50h
  30 + Model [$CTOOLS/share/models/crab.xml]
  31 + Output event data file or observation definition file [events.fits] events1.fits
  32 +
  33 +.. code-block:: bash
  34 +
  35 + $ ctobssim
  36 + RA of pointing (degrees) (0-360) [83.63]
  37 + Dec of pointing (degrees) (-90-90) [22.01] 22.51
  38 + Radius of FOV (degrees) (0-180) [5.0]
  39 + Start time (MET in s) [0.0]
  40 + End time (MET in s) [1800.0]
  41 + Lower energy limit (TeV) [0.1]
  42 + Upper energy limit (TeV) [100.0]
  43 + Calibration database [prod2]
  44 + Instrument response function [North_50h] South_50h
  45 + Model [$CTOOLS/share/models/crab.xml]
  46 + Output event data file or observation definition file [events1.fits] events2.fits
  47 +
  48 +Now we combine the information about these two observations in an
  49 +observation definition XML file:
33 50
34 .. code-block:: xml 51 .. code-block:: xml
35 52
@@ -37,11 +54,11 @@ definition XML file: @@ -37,11 +54,11 @@ definition XML file:
37 <observation_list title="observation library"> 54 <observation_list title="observation library">
38 <observation name="Crab" id="00001" instrument="CTA"> 55 <observation name="Crab" id="00001" instrument="CTA">
39 <parameter name="EventList" file="events1.fits"/> 56 <parameter name="EventList" file="events1.fits"/>
40 - <parameter name="Calibration" database="north" response="cta_north_irf"/> 57 + <parameter name="Calibration" database="prod2" response="North_50h"/>
41 </observation> 58 </observation>
42 <observation name="Crab" id="00002" instrument="CTA"> 59 <observation name="Crab" id="00002" instrument="CTA">
43 <parameter name="EventList" file="events2.fits"/> 60 <parameter name="EventList" file="events2.fits"/>
44 - <parameter name="Calibration" database="south" response="cta_south_irf"/> 61 + <parameter name="Calibration" database="prod2" response="South_50h"/>
45 </observation> 62 </observation>
46 </observation_list> 63 </observation_list>
47 64
@@ -55,41 +72,39 @@ option to get the output of the script on the console): @@ -55,41 +72,39 @@ option to get the output of the script on the console):
55 72
56 $ cscaldb debug=yes 73 $ cscaldb debug=yes
57 Parfile cscaldb.par not found. Create default parfile. 74 Parfile cscaldb.par not found. Create default parfile.
58 - 2015-02-05T14:26:50: +============+  
59 - 2015-02-05T14:26:50: | Parameters |  
60 - 2015-02-05T14:26:50: +============+  
61 - 2015-02-05T14:26:50: chatter ...................: 2  
62 - 2015-02-05T14:26:50: clobber ...................: yes  
63 - 2015-02-05T14:26:50: debug .....................: yes  
64 - 2015-02-05T14:26:50: mode ......................: ql  
65 - 2015-02-05T14:26:50:  
66 - 2015-02-05T14:26:50: +==============+  
67 - 2015-02-05T14:26:50: | Mission: cta |  
68 - 2015-02-05T14:26:50: +==============+  
69 - 2015-02-05T14:26:50: === Response functions in database "dummy" ===  
70 - 2015-02-05T14:26:50: cta_dummy_irf  
71 - 2015-02-05T14:26:50: cta_prod1_irf  
72 - 2015-02-05T14:26:50: cta_prod2_irf  
73 - 2015-02-05T14:26:50:  
74 - 2015-02-05T14:26:50: === Response functions in database "north" ===  
75 - 2015-02-05T14:26:50: cta_north_irf  
76 - 2015-02-05T14:26:50:  
77 - 2015-02-05T14:26:50: === Response functions in database "south" ===  
78 - 2015-02-05T14:26:50: cta_south_irf  
79 -  
80 -You will see that for the CTA observatory three databases exist.  
81 -The ``dummy`` database contains three response functions  
82 -(``cta_dummy_irf``, ``cta_prod1_irf``, ``cta_prod2_irf``) while the  
83 -``north`` and ``south`` databases contain a single response function.  
84 -You may now do a :ref:`ctlike` fit using the XML file with the specific  
85 -response definitions: 75 + 2015-05-22T21:35:39: +============+
  76 + 2015-05-22T21:35:39: | Parameters |
  77 + 2015-05-22T21:35:39: +============+
  78 + 2015-05-22T21:35:39: chatter ...................: 2
  79 + 2015-05-22T21:35:39: clobber ...................: yes
  80 + 2015-05-22T21:35:39: debug .....................: yes
  81 + 2015-05-22T21:35:39: mode ......................: ql
  82 + 2015-05-22T21:35:39:
  83 + 2015-05-22T21:35:39: +==============+
  84 + 2015-05-22T21:35:39: | Mission: cta |
  85 + 2015-05-22T21:35:39: +==============+
  86 + 2015-05-22T21:35:40: === Response functions in database "prod2" ===
  87 + 2015-05-22T21:35:40: North_0.5h
  88 + 2015-05-22T21:35:40: North_50h
  89 + 2015-05-22T21:35:40: North_5h
  90 + 2015-05-22T21:35:40: South_0.5h
  91 + 2015-05-22T21:35:40: South_50h
  92 + 2015-05-22T21:35:40: South_5h
  93 +
  94 +You will see that ctools ships with one database for the CTA observatory.
  95 +This is the ``prod2`` database.
  96 +Within this database there are six response functions:
  97 +``North_0.5h``, ``North_5h``, ``North_50h``,
  98 +``South_0.5h``, ``South_5h``, and ``South_50h``.
  99 +
  100 +We now jointly fit both observations using :ref:`ctlike`:
86 101
87 .. code-block:: bash 102 .. code-block:: bash
88 103
89 $ ctlike 104 $ ctlike
90 - Event list, counts cube or observation definition file [events.fits] obs_irf.xml 105 + Event list, counts cube or observation definition file [obs.xml] obs_irf.xml
91 Source model [$CTOOLS/share/models/crab.xml] 106 Source model [$CTOOLS/share/models/crab.xml]
92 - Source model output file [crab_results.xml] 107 + Source model output file [crab_results.xml]
93 108
94 To see the usage of the individual response functions you may inspect the 109 To see the usage of the individual response functions you may inspect the
95 log file. You will notice that each observation now has a specific response 110 log file. You will notice that each observation now has a specific response
@@ -98,69 +113,110 @@ both observations. @@ -98,69 +113,110 @@ both observations.
98 113
99 .. code-block:: xml 114 .. code-block:: xml
100 115
101 - 2015-02-05T14:48:46: +==============+  
102 - 2015-02-05T14:48:46: | Observations |  
103 - 2015-02-05T14:48:46: +==============+  
104 - 2015-02-05T14:48:46: === GObservations ===  
105 - 2015-02-05T14:48:46: Number of observations ....: 2  
106 - 2015-02-05T14:48:46: Number of predicted events : 0  
107 - 2015-02-05T14:48:46: === GCTAObservation ===  
108 - 2015-02-05T14:48:46: Name ......................: Crab  
109 - 2015-02-05T14:48:46: Identifier ................: 00001  
110 - 2015-02-05T14:48:46: Instrument ................: CTA  
111 - 2015-02-05T14:48:46: Event file ................: events1.fits  
112 - 2015-02-05T14:48:46: Event type ................: EventList  
113 - 2015-02-05T14:48:46: Statistics ................: Poisson  
114 - 2015-02-05T14:48:46: Ontime ....................: 1800 s  
115 - 2015-02-05T14:48:46: Livetime ..................: 1710 s  
116 - 2015-02-05T14:48:46: Deadtime correction .......: 0.95  
117 - 2015-02-05T14:48:46: User energy range .........: undefined  
118 - 2015-02-05T14:48:46: === GCTAPointing ===  
119 - 2015-02-05T14:48:46: Pointing direction ........: (RA,Dec)=(83.63,21.51)  
120 - 2015-02-05T14:48:46: === GCTAResponseIrf ===  
121 - 2015-02-05T14:48:46: Response name .............: cta_north_irf  
122 - 2015-02-05T14:48:46: Energy dispersion .........: Not used  
123 - 2015-02-05T14:48:46: Save energy range .........: undefined  
124 - 2015-02-05T14:48:46: === GCaldb ===  
125 - 2015-02-05T14:48:46: Database root .............: /Users/jurgen/Desktop/tmp/beyond/caldb  
126 - 2015-02-05T14:48:46: Selected Mission ..........: CTA  
127 - 2015-02-05T14:48:46: Selected Instrument .......: NORTH  
128 - 2015-02-05T14:48:46: Calibration Index File ....: /Users/jurgen/Desktop/tmp/beyond/caldb/data/cta/north/caldb.indx  
129 - 2015-02-05T14:48:46: Number of entries .........: 4  
130 - 2015-02-05T14:48:46: === GCTAAeffPerfTable ===  
131 - 2015-02-05T14:48:46: Filename ..................: /Users/jurgen/Desktop/tmp/beyond/caldb/data/cta/north/bcf/cta_north_irf.dat  
132 - 2015-02-05T14:48:46: Number of energy bins .....: 20  
133 - 2015-02-05T14:48:46: Log10(Energy) range .......: 0.0199526 - 125.893 TeV  
134 - 2015-02-05T14:48:46: Offset angle dependence ...: Fixed sigma=3  
135 - ...  
136 - 2015-02-05T14:48:46: === GCTAObservation ===  
137 - 2015-02-05T14:48:46: Name ......................: Crab  
138 - 2015-02-05T14:48:46: Identifier ................: 00002  
139 - 2015-02-05T14:48:46: Instrument ................: CTA  
140 - 2015-02-05T14:48:46: Event file ................: events2.fits  
141 - 2015-02-05T14:48:46: Event type ................: EventList  
142 - 2015-02-05T14:48:46: Statistics ................: Poisson  
143 - 2015-02-05T14:48:46: Ontime ....................: 1800 s  
144 - 2015-02-05T14:48:46: Livetime ..................: 1710 s  
145 - 2015-02-05T14:48:46: Deadtime correction .......: 0.95  
146 - 2015-02-05T14:48:46: User energy range .........: undefined  
147 - 2015-02-05T14:48:46: === GCTAPointing ===  
148 - 2015-02-05T14:48:46: Pointing direction ........: (RA,Dec)=(83.63,22.51)  
149 - 2015-02-05T14:48:46: === GCTAResponseIrf ===  
150 - 2015-02-05T14:48:46: Response name .............: cta_south_irf  
151 - 2015-02-05T14:48:46: Energy dispersion .........: Not used  
152 - 2015-02-05T14:48:46: Save energy range .........: undefined  
153 - 2015-02-05T14:48:46: === GCaldb ===  
154 - 2015-02-05T14:48:46: Database root .............: /Users/jurgen/Desktop/tmp/beyond/caldb  
155 - 2015-02-05T14:48:46: Selected Mission ..........: CTA  
156 - 2015-02-05T14:48:46: Selected Instrument .......: SOUTH  
157 - 2015-02-05T14:48:46: Calibration Index File ....: /Users/jurgen/Desktop/tmp/beyond/caldb/data/cta/south/caldb.indx  
158 - 2015-02-05T14:48:46: Number of entries .........: 4  
159 - 2015-02-05T14:48:46: === GCTAAeffPerfTable ===  
160 - 2015-02-05T14:48:46: Filename ..................: /Users/jurgen/Desktop/tmp/beyond/caldb/data/cta/south/bcf/cta_south_irf.dat  
161 - 2015-02-05T14:48:46: Number of energy bins .....: 20  
162 - 2015-02-05T14:48:46: Log10(Energy) range .......: 0.0199526 - 125.893 TeV  
163 - 2015-02-05T14:48:46: Offset angle dependence ...: Fixed sigma=3 116 + 2015-05-22T22:06:43: +==============+
  117 + 2015-05-22T22:06:43: | Observations |
  118 + 2015-05-22T22:06:43: +==============+
  119 + 2015-05-22T22:06:43: === GObservations ===
  120 + 2015-05-22T22:06:43: Number of observations ....: 2
  121 + 2015-05-22T22:06:43: Number of predicted events : 0
  122 + 2015-05-22T22:06:43: === GCTAObservation ===
  123 + 2015-05-22T22:06:43: Name ......................:
  124 + 2015-05-22T22:06:43: Identifier ................: 00001
  125 + 2015-05-22T22:06:43: Instrument ................: CTA
  126 + 2015-05-22T22:06:43: Event file ................: events1.fits
  127 + 2015-05-22T22:06:43: Event type ................: EventList
  128 + 2015-05-22T22:06:43: Statistics ................: Poisson
  129 + 2015-05-22T22:06:43: Ontime ....................: 1800 s
  130 + 2015-05-22T22:06:43: Livetime ..................: 1710 s
  131 + 2015-05-22T22:06:43: Deadtime correction .......: 0.95
  132 + 2015-05-22T22:06:43: User energy range .........: undefined
  133 + 2015-05-22T22:06:43: === GCTAPointing ===
  134 + 2015-05-22T22:06:43: Pointing direction ........: (RA,Dec)=(83.63,21.51)
  135 + 2015-05-22T22:06:43: === GCTAResponseIrf ===
  136 + 2015-05-22T22:06:43: Caldb mission .............: cta
  137 + 2015-05-22T22:06:43: Caldb instrument ..........: prod2
  138 + 2015-05-22T22:06:43: Response name .............: North_50h
  139 + 2015-05-22T22:06:43: Energy dispersion .........: Not used
  140 + 2015-05-22T22:06:43: Save energy range .........: undefined
  141 + ...
  142 + 2015-05-22T22:06:43: === GCTAObservation ===
  143 + 2015-05-22T22:06:43: Name ......................:
  144 + 2015-05-22T22:06:43: Identifier ................: 00002
  145 + 2015-05-22T22:06:43: Instrument ................: CTA
  146 + 2015-05-22T22:06:43: Event file ................: events2.fits
  147 + 2015-05-22T22:06:43: Event type ................: EventList
  148 + 2015-05-22T22:06:43: Statistics ................: Poisson
  149 + 2015-05-22T22:06:43: Ontime ....................: 1800 s
  150 + 2015-05-22T22:06:43: Livetime ..................: 1710 s
  151 + 2015-05-22T22:06:43: Deadtime correction .......: 0.95
  152 + 2015-05-22T22:06:43: User energy range .........: undefined
  153 + 2015-05-22T22:06:43: === GCTAPointing ===
  154 + 2015-05-22T22:06:43: Pointing direction ........: (RA,Dec)=(83.63,22.51)
  155 + 2015-05-22T22:06:43: === GCTAResponseIrf ===
  156 + 2015-05-22T22:06:43: Caldb mission .............: cta
  157 + 2015-05-22T22:06:43: Caldb instrument ..........: prod2
  158 + 2015-05-22T22:06:43: Response name .............: South_50h
  159 + 2015-05-22T22:06:43: Energy dispersion .........: Not used
  160 + 2015-05-22T22:06:43: Save energy range .........: undefined
  161 + ...
  162 + 2015-05-22T22:06:43: +=================================+
  163 + 2015-05-22T22:06:43: | Maximum likelihood optimisation |
  164 + 2015-05-22T22:06:43: +=================================+
  165 + 2015-05-22T22:06:43: >Iteration 0: -logL=138039.472, Lambda=1.0e-03
  166 + 2015-05-22T22:06:43: >Iteration 1: -logL=138035.501, Lambda=1.0e-03, delta=3.971, max(|grad|)=16.203761 [Index:7]
  167 + 2015-05-22T22:06:43: >Iteration 2: -logL=138035.496, Lambda=1.0e-04, delta=0.005, max(|grad|)=-0.053284 [Index:7]
  168 + 2015-05-22T22:06:43: >Iteration 3: -logL=138035.496, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.001386 [Index:7]
  169 + 2015-05-22T22:06:44:
  170 + 2015-05-22T22:06:44: +=========================================+
  171 + 2015-05-22T22:06:44: | Maximum likelihood optimization results |
  172 + 2015-05-22T22:06:44: +=========================================+
  173 + 2015-05-22T22:06:44: === GOptimizerLM ===
  174 + 2015-05-22T22:06:44: Optimized function value ..: 138035.496
  175 + 2015-05-22T22:06:44: Absolute precision ........: 0.005
  176 + 2015-05-22T22:06:44: Acceptable value decrease .: 2
  177 + 2015-05-22T22:06:44: Optimization status .......: converged
  178 + 2015-05-22T22:06:44: Number of parameters ......: 10
  179 + 2015-05-22T22:06:44: Number of free parameters .: 4
  180 + 2015-05-22T22:06:44: Number of iterations ......: 3
  181 + 2015-05-22T22:06:44: Lambda ....................: 1e-06
  182 + 2015-05-22T22:06:44: Maximum log likelihood ....: -138035.496
  183 + 2015-05-22T22:06:44: Observed events (Nobs) ...: 20814.000
  184 + 2015-05-22T22:06:44: Predicted events (Npred) ..: 20814.000 (Nobs - Npred = 2.67698e-06)
  185 + 2015-05-22T22:06:44: === GModels ===
  186 + 2015-05-22T22:06:44: Number of models ..........: 2
  187 + 2015-05-22T22:06:44: Number of parameters ......: 10
  188 + 2015-05-22T22:06:44: === GModelSky ===
  189 + 2015-05-22T22:06:44: Name ......................: Crab
  190 + 2015-05-22T22:06:44: Instruments ...............: all
  191 + 2015-05-22T22:06:44: Instrument scale factors ..: unity
  192 + 2015-05-22T22:06:44: Observation identifiers ...: all
  193 + 2015-05-22T22:06:44: Model type ................: PointSource
  194 + 2015-05-22T22:06:44: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  195 + 2015-05-22T22:06:44: Number of parameters ......: 6
  196 + 2015-05-22T22:06:44: Number of spatial par's ...: 2
  197 + 2015-05-22T22:06:44: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  198 + 2015-05-22T22:06:44: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  199 + 2015-05-22T22:06:44: Number of spectral par's ..: 3
  200 + 2015-05-22T22:06:44: Prefactor ................: 5.9184e-16 +/- 9.68924e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  201 + 2015-05-22T22:06:44: Index ....................: -2.49569 +/- 0.0145376 [-0,-5] (free,scale=-1,gradient)
  202 + 2015-05-22T22:06:44: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  203 + 2015-05-22T22:06:44: Number of temporal par's ..: 1
  204 + 2015-05-22T22:06:44: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  205 + 2015-05-22T22:06:44: === GCTAModelIrfBackground ===
  206 + 2015-05-22T22:06:44: Name ......................: CTABackgroundModel
  207 + 2015-05-22T22:06:44: Instruments ...............: CTA
  208 + 2015-05-22T22:06:44: Instrument scale factors ..: unity
  209 + 2015-05-22T22:06:44: Observation identifiers ...: all
  210 + 2015-05-22T22:06:44: Model type ................: "PowerLaw" * "Constant"
  211 + 2015-05-22T22:06:44: Number of parameters ......: 4
  212 + 2015-05-22T22:06:44: Number of spectral par's ..: 3
  213 + 2015-05-22T22:06:44: Prefactor ................: 1.02524 +/- 0.0182054 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  214 + 2015-05-22T22:06:44: Index ....................: 0.0229728 +/- 0.0104713 [-5,5] (free,scale=1,gradient)
  215 + 2015-05-22T22:06:44: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  216 + 2015-05-22T22:06:44: Number of temporal par's ..: 1
  217 + 2015-05-22T22:06:44: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  218 +
  219 +
164 220
165 A more fine grained control over the response function can be achieved by 221 A more fine grained control over the response function can be achieved by
166 specifying individual filenames for the various response components. 222 specifying individual filenames for the various response components.
@@ -173,17 +229,17 @@ This is definitely expert mode, to be used with utmost care. @@ -173,17 +229,17 @@ This is definitely expert mode, to be used with utmost care.
173 <observation_list title="observation library"> 229 <observation_list title="observation library">
174 <observation name="Crab" id="00001" instrument="CTA"> 230 <observation name="Crab" id="00001" instrument="CTA">
175 <parameter name="EventList" file="events1.fits"/> 231 <parameter name="EventList" file="events1.fits"/>
176 - <parameter name="EffectiveArea" file="$(CALDB)/data/cta/dummy/bcf/cta_dummy_irf.dat"/>  
177 - <parameter name="PointSpreadFunction" file="$(CALDB)/data/cta/dummy/bcf/cta_prod1_irf.dat"/>  
178 - <parameter name="EnergyDispersion" file="$(CALDB)/data/cta/dummy/bcf/cta_prod2_irf.dat"/>  
179 - <parameter name="Background" file="$(CALDB)/data/cta/north/bcf/cta_north_irf.dat"/> 232 + <parameter name="EffectiveArea" file="$(CALDB)/data/cta/prod2/bcf/North_50h/irf_file.fits.gz"/>
  233 + <parameter name="PointSpreadFunction" file="$(CALDB)/data/cta/prod2/bcf/North_50h/irf_file.fits.gz"/>
  234 + <parameter name="EnergyDispersion" file="$(CALDB)/data/cta/prod2/bcf/North_50h/irf_file.fits.gz"/>
  235 + <parameter name="Background" file="$(CALDB)/data/cta/prod2/bcf/North_50h/irf_file.fits.gz"/>
180 </observation> 236 </observation>
181 <observation name="Crab" id="00002" instrument="CTA"> 237 <observation name="Crab" id="00002" instrument="CTA">
182 <parameter name="EventList" file="events2.fits"/> 238 <parameter name="EventList" file="events2.fits"/>
183 - <parameter name="EffectiveArea" file="$(CALDB)/data/cta/dummy/bcf/cta_dummy_irf.dat"/>  
184 - <parameter name="PointSpreadFunction" file="$(CALDB)/data/cta/dummy/bcf/cta_prod1_irf.dat"/>  
185 - <parameter name="EnergyDispersion" file="$(CALDB)/data/cta/dummy/bcf/cta_prod2_irf.dat"/>  
186 - <parameter name="Background" file="$(CALDB)/data/cta/south/bcf/cta_south_irf.dat"/> 239 + <parameter name="EffectiveArea" file="$(CALDB)/data/cta/prod2/bcf/South_50h/irf_file.fits.gz"/>
  240 + <parameter name="PointSpreadFunction" file="$(CALDB)/data/cta/prod2/bcf/South_50h/irf_file.fits.gz"/>
  241 + <parameter name="EnergyDispersion" file="$(CALDB)/data/cta/prod2/bcf/South_50h/irf_file.fits.gz"/>
  242 + <parameter name="Background" file="$(CALDB)/data/cta/prod2/bcf/South_50h/irf_file.fits.gz"/>
187 </observation> 243 </observation>
188 </observation_list> 244 </observation_list>
189 245
@@ -199,11 +255,13 @@ file is given below: @@ -199,11 +255,13 @@ file is given below:
199 <parameter name="CountsCube" file="cntcube1.fits"/> 255 <parameter name="CountsCube" file="cntcube1.fits"/>
200 <parameter name="ExposureCube" file="expcube1.fits"/> 256 <parameter name="ExposureCube" file="expcube1.fits"/>
201 <parameter name="PsfCube" file="psfcube1.fits"/> 257 <parameter name="PsfCube" file="psfcube1.fits"/>
  258 + <parameter name="BkgCube" file="bkgcube1.fits"/>
202 </observation> 259 </observation>
203 <observation name="Crab" id="00002" instrument="CTA"> 260 <observation name="Crab" id="00002" instrument="CTA">
204 <parameter name="CountsCube" file="cntcube2.fits"/> 261 <parameter name="CountsCube" file="cntcube2.fits"/>
205 <parameter name="ExposureCube" file="expcube2.fits"/> 262 <parameter name="ExposureCube" file="expcube2.fits"/>
206 <parameter name="PsfCube" file="psfcube2.fits"/> 263 <parameter name="PsfCube" file="psfcube2.fits"/>
  264 + <parameter name="BkgCube" file="bkgcube2.fits"/>
207 </observation> 265 </observation>
208 </observation_list> 266 </observation_list>
209 267
doc/source/user_manual/getting_started/beyond_model.rst
@@ -56,23 +56,21 @@ event list. @@ -56,23 +56,21 @@ event list.
56 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> 56 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/>
57 </spatialModel> 57 </spatialModel>
58 </source> 58 </source>
59 - <source name="Background_00001" type="RadialAcceptance" instrument="CTA" id="00001">  
60 - <spectrum type="FileFunction" file="$CTOOLS/share/models/bkg_dummy.txt">  
61 - <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> 59 + <source name="Background_00001" type="CTAIrfBackground" instrument="CTA" id="00001">
  60 + <spectrum type="PowerLaw">
  61 + <parameter name="Prefactor" scale="1.0" value="1.0" min="1e-3" max="1e+3" free="1"/>
  62 + <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/>
  63 + <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
62 </spectrum> 64 </spectrum>
63 - <radialModel type="Gaussian">  
64 - <parameter name="Sigma" scale="1.0" value="3.0" min="0.01" max="10.0" free="1"/>  
65 - </radialModel>  
66 </source> 65 </source>
67 - <source name="Background_00002" type="RadialAcceptance" instrument="CTA" id="00002">  
68 - <spectrum type="FileFunction" file="$CTOOLS/share/models/bkg_dummy.txt">  
69 - <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="10.0" free="1"/> 66 + <source name="Background_00002" type="CTAIrfBackground" instrument="CTA" id="00002">
  67 + <spectrum type="PowerLaw">
  68 + <parameter name="Prefactor" scale="1.0" value="10.0" min="1e-3" max="1e+3" free="1"/>
  69 + <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/>
  70 + <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
70 </spectrum> 71 </spectrum>
71 - <radialModel type="Gaussian">  
72 - <parameter name="Sigma" scale="1.0" value="3.0" min="0.01" max="10.0" free="1"/>  
73 - </radialModel>  
74 </source> 72 </source>
75 - </source_library> 73 + </source_library>
76 74
77 Note that both background model components distinguish in their event rate; 75 Note that both background model components distinguish in their event rate;
78 component ``Background_00002`` has a ten times larger background rate than 76 component ``Background_00002`` has a ten times larger background rate than
@@ -112,21 +110,19 @@ This is illustrated in the model definition file below where component @@ -112,21 +110,19 @@ This is illustrated in the model definition file below where component
112 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> 110 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/>
113 </spatialModel> 111 </spatialModel>
114 </source> 112 </source>
115 - <source name="Background_00001" type="RadialAcceptance" instrument="CTA" id="00001,00003,00004">  
116 - <spectrum type="FileFunction" file="$CTOOLS/share/models/bkg_dummy.txt">  
117 - <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> 113 + <source name="Background_00001" type="CTAIrfBackground" instrument="CTA" id="00001,00003,00004">
  114 + <spectrum type="PowerLaw">
  115 + <parameter name="Prefactor" scale="1.0" value="1.0" min="1e-3" max="1e+3" free="1"/>
  116 + <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/>
  117 + <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
118 </spectrum> 118 </spectrum>
119 - <radialModel type="Gaussian">  
120 - <parameter name="Sigma" scale="1.0" value="3.0" min="0.01" max="10.0" free="1"/>  
121 - </radialModel>  
122 </source> 119 </source>
123 - <source name="Background_00002" type="RadialAcceptance" instrument="CTA" id="00002">  
124 - <spectrum type="FileFunction" file="$CTOOLS/share/models/bkg_dummy.txt">  
125 - <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="10.0" free="1"/> 120 + <source name="Background_00002" type="CTAIrfBackground" instrument="CTA" id="00002">
  121 + <spectrum type="PowerLaw">
  122 + <parameter name="Prefactor" scale="1.0" value="10.0" min="1e-3" max="1e+3" free="1"/>
  123 + <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/>
  124 + <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
126 </spectrum> 125 </spectrum>
127 - <radialModel type="Gaussian">  
128 - <parameter name="Sigma" scale="1.0" value="3.0" min="0.01" max="10.0" free="1"/>  
129 - </radialModel>  
130 </source> 126 </source>
131 </source_library> 127 </source_library>
132 128
doc/source/user_manual/getting_started/beyond_residual.rst
@@ -16,15 +16,27 @@ the model value to obtained the fractional residuals @@ -16,15 +16,27 @@ the model value to obtained the fractional residuals
16 Residual = \frac{Counts-Model}{Model} 16 Residual = \frac{Counts-Model}{Model}
17 17
18 for all map pixels. 18 for all map pixels.
19 -The :ref:`csresmap` script is used as follows: 19 +
  20 +Suppose that you have done the following unbinned ``ctlike`` analysis:
  21 +
  22 +.. code-block:: bash
  23 +
  24 + $ ctlike
  25 + Event list, counts cube or observation definition file [events.fits] obs.xml
  26 + Calibration database [prod2]
  27 + Instrument response function [South_50h]
  28 + Source model [$CTOOLS/share/models/crab.xml]
  29 + Source model output file [crab_results.xml]
  30 +
  31 +The :ref:`csresmap` script is then used as follows:
20 32
21 .. code-block:: bash 33 .. code-block:: bash
22 34
23 $ csresmap 35 $ csresmap
24 Parfile csresmap.par not found. Create default parfile. 36 Parfile csresmap.par not found. Create default parfile.
25 Event list, counts cube, or observation definition file [events.fits] obs.xml 37 Event list, counts cube, or observation definition file [events.fits] obs.xml
26 - Calibration database [dummy]  
27 - Instrument response function [cta_dummy_irf] 38 + Calibration database [prod2]
  39 + Instrument response function [South_50h]
28 Source model [$CTOOLS/share/models/crab.xml] crab_results.xml 40 Source model [$CTOOLS/share/models/crab.xml] crab_results.xml
29 Output residual map [resmap.fits] 41 Output residual map [resmap.fits]
30 First coordinate of image center in degrees (RA or galactic l) [83.63] 42 First coordinate of image center in degrees (RA or galactic l) [83.63]
doc/source/user_manual/getting_started/beyond_stacked.rst
@@ -15,10 +15,10 @@ into a single counts cube: @@ -15,10 +15,10 @@ into a single counts cube:
15 .. code-block:: bash 15 .. code-block:: bash
16 16
17 $ ctbin 17 $ ctbin
18 - Event list or observation definition file [events2.fits] obs.xml  
19 - First coordinate of image center in degrees (RA or galactic l) [83.63]  
20 - Second coordinate of image center in degrees (DEC or galactic b) [22.01]  
21 - Projection method e.g. AIT|AZP|CAR|MER|STG|TAN (AIT|AZP|CAR|MER|STG|TAN) [CAR] 18 + Event list or observation definition file [events.fits] obs.xml
  19 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63]
  20 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01]
  21 + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR]
22 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] 22 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
23 Image scale (in degrees/pixel) [0.02] 23 Image scale (in degrees/pixel) [0.02]
24 Size of the X axis in pixels [200] 24 Size of the X axis in pixels [200]
@@ -27,15 +27,16 @@ into a single counts cube: @@ -27,15 +27,16 @@ into a single counts cube:
27 Start value for first energy bin in TeV [0.1] 27 Start value for first energy bin in TeV [0.1]
28 Stop value for last energy bin in TeV [100.0] 28 Stop value for last energy bin in TeV [100.0]
29 Number of energy bins [20] 29 Number of energy bins [20]
30 - Output counts cube [cntcube2.fits] cntcube.fits 30 + Output counts cube [cntcube.fits]
31 31
32 We now have a stacked counts cube ``cntcube.fits`` on disk. 32 We now have a stacked counts cube ``cntcube.fits`` on disk.
33 Before we can use that counts cube in a maximum likelihood 33 Before we can use that counts cube in a maximum likelihood
34 analysis, we have to compute the instrument response and the 34 analysis, we have to compute the instrument response and the
35 background model that are needed to describe the stacked data. 35 background model that are needed to describe the stacked data.
  36 +
36 For the former, we have to compute the total exposure for the stacked 37 For the former, we have to compute the total exposure for the stacked
37 cube (i.e. the sum of the effective areas for each observation multiplied 38 cube (i.e. the sum of the effective areas for each observation multiplied
38 -by the corresponding lifetimes) and an effective point spread function 39 +by the corresponding livetimes) and an effective point spread function
39 (i.e. the point spread function of the different observations weighted by 40 (i.e. the point spread function of the different observations weighted by
40 the corresponding exposures). 41 the corresponding exposures).
41 To get both informations we use the :ref:`ctexpcube` and 42 To get both informations we use the :ref:`ctexpcube` and
@@ -45,29 +46,29 @@ To get both informations we use the :ref:`ctexpcube` and @@ -45,29 +46,29 @@ To get both informations we use the :ref:`ctexpcube` and
45 46
46 $ ctexpcube 47 $ ctexpcube
47 Event list or observation definition file [NONE] obs.xml 48 Event list or observation definition file [NONE] obs.xml
48 - Calibration database [dummy]  
49 - Instrument response function [cta_dummy_irf] 49 + Calibration database [prod2]
  50 + Instrument response function [South_50h]
50 Counts cube for exposure cube definition [NONE] cntcube.fits 51 Counts cube for exposure cube definition [NONE] cntcube.fits
51 - Output exposure cube file [expcube.fits] 52 + Output exposure cube file [expcube.fits]
52 53
53 .. code-block:: bash 54 .. code-block:: bash
54 55
55 $ ctpsfcube 56 $ ctpsfcube
56 Event list or observation definition file [NONE] obs.xml 57 Event list or observation definition file [NONE] obs.xml
57 - Calibration database [dummy]  
58 - Instrument response function [cta_dummy_irf] 58 + Calibration database [prod2]
  59 + Instrument response function [South_50h]
59 Counts cube for psf cube definition [NONE] 60 Counts cube for psf cube definition [NONE]
60 - First coordinate of image center in degrees (RA or galactic l) [83.63]  
61 - Second coordinate of image center in degrees (DEC or galactic b) [22.01]  
62 - Projection method e.g. AIT|AZP|CAR|MER|MOL|STG|TAN (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR] 61 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63]
  62 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01]
  63 + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR]
63 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] 64 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
64 Image scale (in degrees/pixel) [1.0] 65 Image scale (in degrees/pixel) [1.0]
65 Size of the X axis in pixels [10] 66 Size of the X axis in pixels [10]
66 Size of the Y axis in pixels [10] 67 Size of the Y axis in pixels [10]
67 - Start value for first energy bin in TeV [0.1]  
68 - Stop value for last energy bin in TeV [100.0] 68 + Lower energy limit (TeV) [0.1]
  69 + Upper energy limit (TeV) [100.0]
69 Number of energy bins [20] 70 Number of energy bins [20]
70 - Output psf cube file [psfcube.fits] 71 + Output psf cube file [psfcube.fits]
71 72
72 We provide the ``obs.xml`` file on input to inform both tools which 73 We provide the ``obs.xml`` file on input to inform both tools which
73 observations have been combined. 74 observations have been combined.
@@ -93,17 +94,17 @@ background cube using the :ref:`ctbkgcube` tool: @@ -93,17 +94,17 @@ background cube using the :ref:`ctbkgcube` tool:
93 94
94 $ ctbkgcube 95 $ ctbkgcube
95 Input event list or observation definition file [NONE] obs.xml 96 Input event list or observation definition file [NONE] obs.xml
96 - Calibration database [dummy]  
97 - Instrument response function [cta_dummy_irf]  
98 - Input (background) model XML file [NONE] $CTOOLS/share/models/crab.xml 97 + Calibration database [prod2]
  98 + Instrument response function [South_50h]
99 Counts cube for background cube definition [NONE] cntcube.fits 99 Counts cube for background cube definition [NONE] cntcube.fits
  100 + Input model XML file [NONE] $CTOOLS/share/models/crab.xml
100 Output background cube file [bkgcube.fits] 101 Output background cube file [bkgcube.fits]
101 - Output (background) model XML file [NONE] model.xml 102 + Output model XML file [NONE] model.xml
102 103
103 The usage of :ref:`ctbkgcube` is very similar to that of :ref:`ctexpcube`, 104 The usage of :ref:`ctbkgcube` is very similar to that of :ref:`ctexpcube`,
104 yet it takes the model XML file as an additional input parameter. 105 yet it takes the model XML file as an additional input parameter.
105 -We here use the usual ``$CTOOLS/share/models/crab.xml`` Crab plus  
106 -background model file that is shipped with the ctools. 106 +We here use the usual ``$CTOOLS/share/models/crab.xml`` model
  107 +file that is shipped with the ctools.
107 :ref:`ctbkgcube` provides on output the background cube file 108 :ref:`ctbkgcube` provides on output the background cube file
108 ``bkgcube.fits`` and the model XML file ``model.xml`` that can 109 ``bkgcube.fits`` and the model XML file ``model.xml`` that can
109 be used for further analysis. 110 be used for further analysis.
@@ -125,25 +126,21 @@ modelling works: @@ -125,25 +126,21 @@ modelling works:
125 <parameter name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0" /> 126 <parameter name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0" />
126 </spatialModel> 127 </spatialModel>
127 </source> 128 </source>
128 - <source name="ctbkgcube default background model" type="CTACubeBackground"> 129 + <source name="BackgroundModel" type="CTACubeBackground" instrument="CTA,HESS,MAGIC,VERITAS">
129 <spectrum type="PowerLaw"> 130 <spectrum type="PowerLaw">
130 <parameter name="Prefactor" value="1" error="0" scale="1" min="0" free="1" /> 131 <parameter name="Prefactor" value="1" error="0" scale="1" min="0" free="1" />
131 <parameter name="Index" value="0" error="0" scale="1" min="-10" max="10" free="1" /> 132 <parameter name="Index" value="0" error="0" scale="1" min="-10" max="10" free="1" />
132 <parameter name="Scale" value="1" scale="1e+06" free="0" /> 133 <parameter name="Scale" value="1" scale="1e+06" free="0" />
133 </spectrum> 134 </spectrum>
134 - <spatialModel type="MapCubeFunction" file="bkgcube.fits">  
135 - <parameter name="Normalization" value="1" scale="1" min="0.001" max="1000" free="0" />  
136 - </spatialModel>  
137 </source> 135 </source>
138 </source_library> 136 </source_library>
139 137
140 The Crab source component is the same that is also present in 138 The Crab source component is the same that is also present in
141 ``$CTOOLS/share/models/crab.xml`` and is not modified. 139 ``$CTOOLS/share/models/crab.xml`` and is not modified.
142 -The background component, however, has been replaced and now is  
143 -the ``ctbkgcube default background model``.  
144 -This model is of type ``CTACubeBackground`` which is a 3-dimensional  
145 -data cube that describes the expected background rate as function  
146 -of spatial position and energy. 140 +The background component, however, has been replaced by a model of
  141 +type ``CTACubeBackground``.
  142 +This model is a 3-dimensional data cube that describes the expected
  143 +background rate as function of spatial position and energy.
147 The data cube is multiplied by a power law spectrum that allows to adjust 144 The data cube is multiplied by a power law spectrum that allows to adjust
148 the normalization and slope of the background spectrum in the fit. 145 the normalization and slope of the background spectrum in the fit.
149 This power law could be replaced by any spectral model that is found 146 This power law could be replaced by any spectral model that is found
@@ -166,87 +163,82 @@ analysis using the :ref:`ctlike` tool: @@ -166,87 +163,82 @@ analysis using the :ref:`ctlike` tool:
166 .. code-block:: bash 163 .. code-block:: bash
167 164
168 $ ctlike 165 $ ctlike
169 - Event list, counts cube or observation definition file [events.fits] cntcube.fits  
170 - Exposure cube file [NONE] expcube.fits  
171 - PSF cube file [NONE] psfcube.fits 166 + Event list, counts cube or observation definition file [obs.xml] cntcube.fits
  167 + Exposure cube file (only needed for stacked analysis) [NONE] expcube.fits
  168 + PSF cube file (only needed for stacked analysis) [NONE] psfcube.fits
  169 + Background cube file (only needed for stacked analysis) [NONE] bkgcube.fits
172 Source model [$CTOOLS/share/models/crab.xml] model.xml 170 Source model [$CTOOLS/share/models/crab.xml] model.xml
173 - Source model output file [crab_results.xml] 171 + Source model output file [crab_results.xml]
174 172
175 :ref:`ctlike` recognises that a counts cube should be analysed and queries 173 :ref:`ctlike` recognises that a counts cube should be analysed and queries
176 -for the exposure cube and PSF cube file names.  
177 -We specified the names of the files produced by the :ref:`ctexpcube` and  
178 -:ref:`ctpsfcube` tools and furthermore provided the ``model.xml`` file  
179 -that is generated by the :ref:`ctbkgcube` tool as source model. 174 +for the exposure cube, the PSF cube, and the background cube file names.
  175 +We specified the names of the files produced by the :ref:`ctexpcube`,
  176 +the :ref:`ctpsfcube` and the :ref:`ctbkgcube` tools.
  177 +Furthermore we provided as model the ``model.xml`` file that has been
  178 +generated by the :ref:`ctbkgcube` tool.
  179 +
180 The log file of the :ref:`ctlike` run is shown below. 180 The log file of the :ref:`ctlike` run is shown below.
181 Note that the spectral model that is multiplied with the background 181 Note that the spectral model that is multiplied with the background
182 -cube has a Prefactor of 1.06 +/- 0.02 and an Index of 0.004 +/- 0.009, 182 +cube has a Prefactor of 1.09 +/- 0.02 and an Index of 0.03 +/- 0.01,
183 indicating a very small correction to the actual spectrum of the background 183 indicating a very small correction to the actual spectrum of the background
184 cube. 184 cube.
185 Real life situations may of course require larger correction factors. 185 Real life situations may of course require larger correction factors.
186 186
187 .. code-block:: xml 187 .. code-block:: xml
188 188
189 - 2015-02-04T23:00:25: +=================================+  
190 - 2015-02-04T23:00:25: | Maximum likelihood optimisation |  
191 - 2015-02-04T23:00:25: +=================================+  
192 - 2015-02-04T23:00:29: >Iteration 0: -logL=36748.112, Lambda=1.0e-03  
193 - 2015-02-04T23:00:33: >Iteration 1: -logL=36734.170, Lambda=1.0e-03, delta=13.942, max(|grad|)=34.291911 [Index:8]  
194 - 2015-02-04T23:00:38: >Iteration 2: -logL=36734.127, Lambda=1.0e-04, delta=0.044, max(|grad|)=0.178088 [Index:8]  
195 - 2015-02-04T23:00:42: >Iteration 3: -logL=36734.127, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.001993 [Index:8]  
196 - 2015-02-04T23:00:46:  
197 - 2015-02-04T23:00:46: +=========================================+  
198 - 2015-02-04T23:00:46: | Maximum likelihood optimization results |  
199 - 2015-02-04T23:00:46: +=========================================+  
200 - 2015-02-04T23:00:46: === GOptimizerLM ===  
201 - 2015-02-04T23:00:46: Optimized function value ..: 36734.127  
202 - 2015-02-04T23:00:46: Absolute precision ........: 0.005  
203 - 2015-02-04T23:00:46: Acceptable value decrease .: 2  
204 - 2015-02-04T23:00:46: Optimization status .......: converged  
205 - 2015-02-04T23:00:46: Number of parameters ......: 11  
206 - 2015-02-04T23:00:46: Number of free parameters .: 4  
207 - 2015-02-04T23:00:46: Number of iterations ......: 3  
208 - 2015-02-04T23:00:46: Lambda ....................: 1e-06  
209 - 2015-02-04T23:00:46: Maximum log likelihood ....: -36734.127  
210 - 2015-02-04T23:00:46: Observed events (Nobs) ...: 10685.000  
211 - 2015-02-04T23:00:46: Predicted events (Npred) ..: 10685.000 (Nobs - Npred = 2.06522e-06)  
212 - 2015-02-04T23:00:46: === GModels ===  
213 - 2015-02-04T23:00:46: Number of models ..........: 2  
214 - 2015-02-04T23:00:46: Number of parameters ......: 11  
215 - 2015-02-04T23:00:46: === GModelSky ===  
216 - 2015-02-04T23:00:46: Name ......................: Crab  
217 - 2015-02-04T23:00:46: Instruments ...............: all  
218 - 2015-02-04T23:00:46: Instrument scale factors ..: unity  
219 - 2015-02-04T23:00:46: Observation identifiers ...: all  
220 - 2015-02-04T23:00:46: Model type ................: PointSource  
221 - 2015-02-04T23:00:46: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
222 - 2015-02-04T23:00:46: Number of parameters ......: 6  
223 - 2015-02-04T23:00:46: Number of spatial par's ...: 2  
224 - 2015-02-04T23:00:46: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
225 - 2015-02-04T23:00:46: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
226 - 2015-02-04T23:00:46: Number of spectral par's ..: 3  
227 - 2015-02-04T23:00:46: Prefactor ................: 6.01471e-16 +/- 1.44183e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
228 - 2015-02-04T23:00:46: Index ....................: -2.49533 +/- 0.0179769 [-0,-5] (free,scale=-1,gradient)  
229 - 2015-02-04T23:00:46: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
230 - 2015-02-04T23:00:46: Number of temporal par's ..: 1  
231 - 2015-02-04T23:00:46: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
232 - 2015-02-04T23:00:46: === GCTAModelCubeBackground ===  
233 - 2015-02-04T23:00:46: Name ......................: ctbkgcube default background model  
234 - 2015-02-04T23:00:46: Instruments ...............: all  
235 - 2015-02-04T23:00:46: Instrument scale factors ..: unity  
236 - 2015-02-04T23:00:46: Observation identifiers ...: all  
237 - 2015-02-04T23:00:46: Model type ................: "MapCubeFunction" * "PowerLaw" * "Constant"  
238 - 2015-02-04T23:00:46: Number of parameters ......: 5  
239 - 2015-02-04T23:00:46: Number of spatial par's ...: 1  
240 - 2015-02-04T23:00:46: Normalization ............: 1 [0.001,1000] (fixed,scale=1,gradient)  
241 - 2015-02-04T23:00:46: Number of spectral par's ..: 3  
242 - 2015-02-04T23:00:46: Prefactor ................: 1.05876 +/- 0.0178132 [0,infty[ ph/cm2/s/MeV (free,scale=1,gradient)  
243 - 2015-02-04T23:00:46: Index ....................: 0.00396962 +/- 0.00881842 [-10,10] (free,scale=1,gradient)  
244 - 2015-02-04T23:00:46: PivotEnergy ..............: 1e+06 MeV (fixed,scale=1e+06,gradient)  
245 - 2015-02-04T23:00:46: Number of temporal par's ..: 1  
246 - 2015-02-04T23:00:46: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
247 - 2015-02-04T23:00:46:  
248 - 2015-02-04T23:00:46: +==============+  
249 - 2015-02-04T23:00:46: | Save results |  
250 - 2015-02-04T23:00:46: +==============+  
251 - 2015-02-04T23:00:46:  
252 - 2015-02-04T23:00:46: Application "ctlike" terminated after 43 wall clock seconds, consuming 21.5624 seconds of CPU time. 189 + 2015-05-22T21:10:09: +=================================+
  190 + 2015-05-22T21:10:09: | Maximum likelihood optimisation |
  191 + 2015-05-22T21:10:09: +=================================+
  192 + 2015-05-22T21:10:10: >Iteration 0: -logL=60663.798, Lambda=1.0e-03
  193 + 2015-05-22T21:10:11: >Iteration 1: -logL=60642.413, Lambda=1.0e-03, delta=21.385, max(|grad|)=120.031102 [Index:7]
  194 + 2015-05-22T21:10:13: >Iteration 2: -logL=60642.233, Lambda=1.0e-04, delta=0.180, max(|grad|)=1.139187 [Index:7]
  195 + 2015-05-22T21:10:14: >Iteration 3: -logL=60642.233, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.001247 [Index:7]
  196 + 2015-05-22T21:10:16:
  197 + 2015-05-22T21:10:16: +=========================================+
  198 + 2015-05-22T21:10:16: | Maximum likelihood optimization results |
  199 + 2015-05-22T21:10:16: +=========================================+
  200 + 2015-05-22T21:10:16: === GOptimizerLM ===
  201 + 2015-05-22T21:10:16: Optimized function value ..: 60642.233
  202 + 2015-05-22T21:10:16: Absolute precision ........: 0.005
  203 + 2015-05-22T21:10:16: Acceptable value decrease .: 2
  204 + 2015-05-22T21:10:16: Optimization status .......: converged
  205 + 2015-05-22T21:10:16: Number of parameters ......: 10
  206 + 2015-05-22T21:10:16: Number of free parameters .: 4
  207 + 2015-05-22T21:10:16: Number of iterations ......: 3
  208 + 2015-05-22T21:10:16: Lambda ....................: 1e-06
  209 + 2015-05-22T21:10:16: Maximum log likelihood ....: -60642.233
  210 + 2015-05-22T21:10:16: Observed events (Nobs) ...: 25963.000
  211 + 2015-05-22T21:10:16: Predicted events (Npred) ..: 25963.000 (Nobs - Npred = 1.5749e-05)
  212 + 2015-05-22T21:10:16: === GModels ===
  213 + 2015-05-22T21:10:16: Number of models ..........: 2
  214 + 2015-05-22T21:10:16: Number of parameters ......: 10
  215 + 2015-05-22T21:10:16: === GModelSky ===
  216 + 2015-05-22T21:10:16: Name ......................: Crab
  217 + 2015-05-22T21:10:16: Instruments ...............: all
  218 + 2015-05-22T21:10:16: Instrument scale factors ..: unity
  219 + 2015-05-22T21:10:16: Observation identifiers ...: all
  220 + 2015-05-22T21:10:16: Model type ................: PointSource
  221 + 2015-05-22T21:10:16: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  222 + 2015-05-22T21:10:16: Number of parameters ......: 6
  223 + 2015-05-22T21:10:16: Number of spatial par's ...: 2
  224 + 2015-05-22T21:10:16: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  225 + 2015-05-22T21:10:16: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  226 + 2015-05-22T21:10:16: Number of spectral par's ..: 3
  227 + 2015-05-22T21:10:16: Prefactor ................: 5.8499e-16 +/- 8.02289e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  228 + 2015-05-22T21:10:16: Index ....................: -2.49909 +/- 0.0118976 [-0,-5] (free,scale=-1,gradient)
  229 + 2015-05-22T21:10:16: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  230 + 2015-05-22T21:10:16: Number of temporal par's ..: 1
  231 + 2015-05-22T21:10:16: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  232 + 2015-05-22T21:10:16: === GCTAModelCubeBackground ===
  233 + 2015-05-22T21:10:16: Name ......................: BackgroundModel
  234 + 2015-05-22T21:10:16: Instruments ...............: CTA, HESS, MAGIC, VERITAS
  235 + 2015-05-22T21:10:16: Instrument scale factors ..: unity
  236 + 2015-05-22T21:10:16: Observation identifiers ...: all
  237 + 2015-05-22T21:10:16: Model type ................: "PowerLaw" * "Constant"
  238 + 2015-05-22T21:10:16: Number of parameters ......: 4
  239 + 2015-05-22T21:10:16: Number of spectral par's ..: 3
  240 + 2015-05-22T21:10:16: Prefactor ................: 1.08781 +/- 0.0212678 [0,infty[ ph/cm2/s/MeV (free,scale=1,gradient)
  241 + 2015-05-22T21:10:16: Index ....................: 0.0269681 +/- 0.0111532 [-10,10] (free,scale=1,gradient)
  242 + 2015-05-22T21:10:16: PivotEnergy ..............: 1e+06 MeV (fixed,scale=1e+06,gradient)
  243 + 2015-05-22T21:10:16: Number of temporal par's ..: 1
  244 + 2015-05-22T21:10:16: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
doc/source/user_manual/getting_started/beyond_tsmap.rst
@@ -6,7 +6,7 @@ Generating a Test Statistic map @@ -6,7 +6,7 @@ Generating a Test Statistic map
6 In the above examples we were always considering that we knew exactly 6 In the above examples we were always considering that we knew exactly
7 where the source is located, but in real life situations this may not 7 where the source is located, but in real life situations this may not
8 necessarily be the case. 8 necessarily be the case.
9 -We thus need a mean to search for significant excess emission in our data. 9 +We thus need a means to search for significant excess emission in our data.
10 One possibility to accomplish this task is to compute the Test Statistic 10 One possibility to accomplish this task is to compute the Test Statistic
11 for a specific source at a grid of trial positions. 11 for a specific source at a grid of trial positions.
12 The :ref:`cttsmap` tool will exactly do that job. 12 The :ref:`cttsmap` tool will exactly do that job.
@@ -32,25 +32,25 @@ nominal position of the Crab nebula with a grid spacing of 0.02 degrees. @@ -32,25 +32,25 @@ nominal position of the Crab nebula with a grid spacing of 0.02 degrees.
32 32
33 $ cttsmap 33 $ cttsmap
34 Input event list, counts cube or observation definition file [events.fits] obs.xml 34 Input event list, counts cube or observation definition file [events.fits] obs.xml
35 - Calibration database [dummy]  
36 - Instrument response function [cta_dummy_irf] 35 + Calibration database [prod2]
  36 + Instrument response function [South_50h]
37 Source model [$CTOOLS/share/models/crab.xml] 37 Source model [$CTOOLS/share/models/crab.xml]
38 Test source [Crab] 38 Test source [Crab]
39 - First coordinate of image center in degrees (RA or galactic l) [83.63]  
40 - Second coordinate of image center in degrees (DEC or galactic b) [22.01]  
41 - Projection method e.g. AIT|AZP|CAR|MER|STG|TAN (AIT|AZP|CAR|MER|STG|TAN) [CAR] 39 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63]
  40 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01]
  41 + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR]
42 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] 42 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
43 Image scale (in degrees/pixel) [0.02] 43 Image scale (in degrees/pixel) [0.02]
44 Size of the X axis in pixels [200] 10 44 Size of the X axis in pixels [200] 10
45 Size of the Y axis in pixels [200] 10 45 Size of the Y axis in pixels [200] 10
46 - Output Test Statistic map [tsmap.fits] 46 + Output Test Statistic map [tsmap.fits]
47 47
48 :ref:`cttsmap` writes the Test Statistic map in the ``tsmap.fits`` file 48 :ref:`cttsmap` writes the Test Statistic map in the ``tsmap.fits`` file
49 that contains one extension for the Test Statistic value and further 49 that contains one extension for the Test Statistic value and further
50 extensions for the spectral parameters that have been fitted for the 50 extensions for the spectral parameters that have been fitted for the
51 source at each position of the grid. 51 source at each position of the grid.
52 The figure below show the Test Statistic map which reaches a maximum 52 The figure below show the Test Statistic map which reaches a maximum
53 -value of 13782 near the centre of the map. 53 +value of 37484 near the centre of the map.
54 54
55 .. figure:: tsmap-crab.png 55 .. figure:: tsmap-crab.png
56 :height: 400px 56 :height: 400px
doc/source/user_manual/getting_started/quickstart.rst
@@ -39,14 +39,14 @@ type :ref:`ctobssim` at the console prompt (which is denoted by ``$``). @@ -39,14 +39,14 @@ type :ref:`ctobssim` at the console prompt (which is denoted by ``$``).
39 RA of pointing (degrees) (0-360) [83.63] 39 RA of pointing (degrees) (0-360) [83.63]
40 Dec of pointing (degrees) (-90-90) [22.01] 40 Dec of pointing (degrees) (-90-90) [22.01]
41 Radius of FOV (degrees) (0-180) [5.0] 41 Radius of FOV (degrees) (0-180) [5.0]
42 - Start time (MET in s) (0) [0.0]  
43 - End time (MET in s) (0) [1800.0]  
44 - Lower energy limit (TeV) (0) [0.1]  
45 - Upper energy limit (TeV) (0) [100.0]  
46 - Calibration database [dummy]  
47 - Instrument response function [cta_dummy_irf] 42 + Start time (MET in s) [0.0]
  43 + End time (MET in s) [1800.0]
  44 + Lower energy limit (TeV) [0.1]
  45 + Upper energy limit (TeV) [100.0]
  46 + Calibration database [prod2]
  47 + Instrument response function [South_50h]
48 Model [$CTOOLS/share/models/crab.xml] 48 Model [$CTOOLS/share/models/crab.xml]
49 - Output event data file or observation definition file [events.fits] 49 + Output event data file or observation definition file [events.fits]
50 50
51 Each line represents a query for one parameter value. 51 Each line represents a query for one parameter value.
52 The line starts with a short description of the parameter, followed by 52 The line starts with a short description of the parameter, followed by
@@ -62,8 +62,18 @@ You may have recognised that the environment variable ``$CTOOLS`` has @@ -62,8 +62,18 @@ You may have recognised that the environment variable ``$CTOOLS`` has
62 been used in the path name of the model. ctools will automatically expand 62 been used in the path name of the model. ctools will automatically expand
63 the environment variables in parameter inputs. 63 the environment variables in parameter inputs.
64 64
65 -The CTA instrument properties (effective area, PSF width) are taken for  
66 -the moment from a dummy calibration database. 65 +The CTA instrument properties (effective area, PSF width) are taken from
  66 +the prod2 database. The response for the southern array using the cuts
  67 +optimised for 50 hours of observing time are used.
  68 +
  69 +.. note::
  70 +
  71 + ctools comes bundled with CTA response functions for the northern and
  72 + the southern array. The response functions are based on a Prod2
  73 + analysis with cuts optimised for 0.5 hours, 5 hours and 50 hours of
  74 + observing time. The following Instrument Response Functions
  75 + (IRFs) are available: ``North_0.5h``, ``North_5h``, ``North_50h``,
  76 + ``South_0.5h``, ``South_5h``, and ``South_50h``.
67 77
68 Events are simulated based on the instrument properties and based on a 78 Events are simulated based on the instrument properties and based on a
69 source and background model. Only events that fall within the specified 79 source and background model. Only events that fall within the specified
@@ -90,14 +100,13 @@ The source and background model is defined by the XML file @@ -90,14 +100,13 @@ The source and background model is defined by the XML file
90 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> 100 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/>
91 </spatialModel> 101 </spatialModel>
92 </source> 102 </source>
93 - <source name="Background" type="RadialAcceptance" instrument="CTA">  
94 - <spectrum type="FileFunction" file="$CTOOLS/share/models/bkg_dummy.txt">  
95 - <parameter scale="1.0" name="Normalization" min="0.0" max="1000.0" value="1.0" free="1"/> 103 + <source name="CTABackgroundModel" type="CTAIrfBackground" instrument="CTA">
  104 + <spectrum type="PowerLaw">
  105 + <parameter name="Prefactor" scale="1.0" value="1.0" min="1e-3" max="1e+3" free="1"/>
  106 + <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/>
  107 + <parameter name="Scale" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
96 </spectrum> 108 </spectrum>
97 - <radialModel type="Gaussian">  
98 - <parameter name="Sigma" scale="1.0" value="3.0" min="0.01" max="10.0" free="1"/>  
99 - </radialModel>  
100 - </source> 109 + </source>
101 </source_library> 110 </source_library>
102 111
103 The model consists of a source library that contains two components: 112 The model consists of a source library that contains two components:
@@ -107,14 +116,15 @@ The Crab nebula is modelled by a factorized sky model that has a spectral @@ -107,14 +116,15 @@ The Crab nebula is modelled by a factorized sky model that has a spectral
107 and a spatial component (tags ``<spectrum>`` and ``<spatialModel>``, 116 and a spatial component (tags ``<spectrum>`` and ``<spatialModel>``,
108 respectively). The spectrum is modelled by a power law, which is defined by 117 respectively). The spectrum is modelled by a power law, which is defined by
109 three parameters: the ``Prefactor``, the ``Index`` and the ``Scale``. 118 three parameters: the ``Prefactor``, the ``Index`` and the ``Scale``.
110 -The spatial model has two parameters: Right Ascension in degrees (RA), and  
111 -Declination in degrees (DEC). Each parameter has a value and a scale factor, 119 +The spatial model has two parameters: Right Ascension in degrees (``RA``), and
  120 +Declination in degrees (``DEC``). Each parameter has a value and a scale factor,
112 the real value of the parameter being the product ``value * scale``. Typically, 121 the real value of the parameter being the product ``value * scale``. Typically,
113 -scale is chosen so that value is of the order of 1 (this is relevant for  
114 -model fitting). In addition, value is bound by a minimum (min) and  
115 -maximum (max) value, and a parameter may be free (``free="1"``) or fixed  
116 -(``free="0"``). The min, max, and free attributes are not relevant here for  
117 -the simulations, but they will be important for the model fitting later. 122 +``scale`` is chosen so that ``value`` is of the order of 1 (this is relevant for
  123 +model fitting). In addition, ``value`` is bound by a minimum (``min``) and
  124 +maximum (``max``) value, and a parameter may be free (``free="1"``) or fixed
  125 +(``free="0"``). The ``min``, ``max``, and ``free`` attributes are not
  126 +relevant here for the simulations, but they will be important for the model
  127 +fitting later.
118 128
119 The spectral intensity I(E) (in units of photons/cm2/s/MeV) of the power 129 The spectral intensity I(E) (in units of photons/cm2/s/MeV) of the power
120 law is given by 130 law is given by
@@ -128,19 +138,20 @@ where the parameters in the XML definition have the following mappings: @@ -128,19 +138,20 @@ where the parameters in the XML definition have the following mappings:
128 * :math:`\gamma` = ``Index`` 138 * :math:`\gamma` = ``Index``
129 * :math:`E_0` = ``Scale`` 139 * :math:`E_0` = ``Scale``
130 140
131 -Note that energies are given in MeV. This is a GammaLib convention that  
132 -can not be modified. **So make sure you always use MeV as energy unit in  
133 -an XML file.** 141 +.. warning::
  142 +
  143 + Energies are given in the XML file in MeV units. This is a GammaLib
  144 + convention that can not be modified. **So make sure you always use
  145 + MeV as energy unit in an XML file.**
134 146
135 -The instrumental background of CTA is modelled by a factorized data model  
136 -that has a spectral and a radial component (tags ``<spectrum>`` and  
137 -``<radialModel>``, respectively). The spectral component describes the  
138 -on-axis background counting rate of CTA as function of energy in units of  
139 -counts/s/sr/MeV. The radial component describes the variation of the  
140 -background rate with offset angle squared, (i.e. square of the offset angle  
141 -with respect to the pointing direction) which is modelled here by a Gaussian.  
142 -The only parameter of the radial component is the width of the Gaussian Sigma,  
143 -which is here set to 3 degrees squared. 147 +The instrumental background of CTA is modelled using the background
  148 +information provided in the IRF (``CTAIrfBackground``) multipled
  149 +by a power law. As it is defined here, the power law represents a
  150 +constant of 1, hence the background IRF will be used without any
  151 +modification. The power law will become active when fitting the data
  152 +later and allows a spectral adjustment of the background model that
  153 +may account for uncertainties in the background information provided
  154 +in the IRF.
144 155
145 :ref:`ctobssim` has a couple of hidden parameters, the most important one being 156 :ref:`ctobssim` has a couple of hidden parameters, the most important one being
146 certainly ``seed``. ``seed`` is an integer that specifies the seed value 157 certainly ``seed``. ``seed`` is an integer that specifies the seed value
@@ -167,25 +178,25 @@ from this file are shown here: @@ -167,25 +178,25 @@ from this file are shown here:
167 178
168 .. code-block:: xml 179 .. code-block:: xml
169 180
170 - 2015-02-04T15:04:56: +======================+  
171 - 2015-02-04T15:04:56: | Simulate observation |  
172 - 2015-02-04T15:04:56: +======================+  
173 - 2015-02-04T15:04:56: === Observation ===  
174 - 2015-02-04T15:04:56: Simulation area ...........: 1.9635e+11 cm2  
175 - 2015-02-04T15:04:56: Simulation cone ...........: RA=83.63 deg, Dec=22.01 deg, r=5.5 deg  
176 - 2015-02-04T15:04:56: Time interval .............: 0 - 1800 s  
177 - 2015-02-04T15:04:56: Photon energy range .......: 100 GeV - 100 TeV  
178 - 2015-02-04T15:04:56: Event energy range ........: 100 GeV - 100 TeV  
179 - 2015-02-04T15:04:56: MC source photons .........: 207547 [Crab]  
180 - 2015-02-04T15:04:56: MC source events ..........: 995 [Crab]  
181 - 2015-02-04T15:04:56: MC source events ..........: 995 (all source models)  
182 - 2015-02-04T15:04:56: MC background events ......: 5146  
183 - 2015-02-04T15:04:56: MC events .................: 6141 (all models) 181 + 2015-05-22T19:24:53: +======================+
  182 + 2015-05-22T19:24:53: | Simulate observation |
  183 + 2015-05-22T19:24:53: +======================+
  184 + 2015-05-22T19:24:53: === Observation ===
  185 + 2015-05-22T19:24:53: Simulation area ...........: 1.9635e+11 cm2
  186 + 2015-05-22T19:24:53: Simulation cone ...........: RA=83.63 deg, Dec=22.01 deg, r=5.5 deg
  187 + 2015-05-22T19:24:53: Time interval .............: 0 - 1800 s
  188 + 2015-05-22T19:24:53: Photon energy range .......: 100 GeV - 100 TeV
  189 + 2015-05-22T19:24:53: Event energy range ........: 100 GeV - 100 TeV
  190 + 2015-05-22T19:24:53: MC source photons .........: 207547 [Crab]
  191 + 2015-05-22T19:24:53: MC source events ..........: 2961 [Crab]
  192 + 2015-05-22T19:24:53: MC source events ..........: 2961 (all source models)
  193 + 2015-05-22T19:24:55: MC background events ......: 13003
  194 + 2015-05-22T19:24:55: MC events .................: 15964 (all models)
184 195
185 Each line starts with the UTC time at which the line has been written. In 196 Each line starts with the UTC time at which the line has been written. In
186 this run, 207547 Crab photons have been thrown over an area of 19.6 square 197 this run, 207547 Crab photons have been thrown over an area of 19.6 square
187 -kilometres during a time interval of 1800 seconds. 995 of these photons have  
188 -been registered by CTA as events. In the same time interval, 5146 background 198 +kilometres during a time interval of 1800 seconds. 2961 of these photons have
  199 +been registered by CTA as events. In the same time interval, 13003 background
189 events have been registred by CTA. 200 events have been registred by CTA.
190 201
191 You may change the name of the log file using the hidden parameter 202 You may change the name of the log file using the hidden parameter
@@ -233,9 +244,9 @@ control). @@ -233,9 +244,9 @@ control).
233 244
234 $ ctbin 245 $ ctbin
235 Event list or observation definition file [events.fits] 246 Event list or observation definition file [events.fits]
236 - First coordinate of image center in degrees (RA or galactic l) [83.63]  
237 - Second coordinate of image center in degrees (DEC or galactic b) [22.01]  
238 - Projection method e.g. AIT|AZP|CAR|MER|STG|TAN (AIT|AZP|CAR|MER|STG|TAN) [CAR] 247 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63]
  248 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01]
  249 + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR]
239 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] 250 Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
240 Image scale (in degrees/pixel) [0.02] 251 Image scale (in degrees/pixel) [0.02]
241 Size of the X axis in pixels [200] 252 Size of the X axis in pixels [200]
@@ -244,7 +255,7 @@ control). @@ -244,7 +255,7 @@ control).
244 Start value for first energy bin in TeV [0.1] 255 Start value for first energy bin in TeV [0.1]
245 Stop value for last energy bin in TeV [100.0] 256 Stop value for last energy bin in TeV [100.0]
246 Number of energy bins [20] 257 Number of energy bins [20]
247 - Output counts cube [cntcube.fits] 258 + Output counts cube [cntcube.fits]
248 259
249 The counts cube will be centred on the location of the Crab (Right Ascension 260 The counts cube will be centred on the location of the Crab (Right Ascension
250 83.63 degrees, Declination 22.01 degrees) and will be aligned in celestial 261 83.63 degrees, Declination 22.01 degrees) and will be aligned in celestial
@@ -285,41 +296,18 @@ reproduced below: @@ -285,41 +296,18 @@ reproduced below:
285 296
286 .. code-block:: xml 297 .. code-block:: xml
287 298
288 - 2015-02-04T15:33:34: +====================+  
289 - 2015-02-04T15:33:34: | Binned observation |  
290 - 2015-02-04T15:33:34: +====================+  
291 - 2015-02-04T15:33:34: === GObservations ===  
292 - 2015-02-04T15:33:34: Number of observations ....: 1  
293 - 2015-02-04T15:33:34: Number of predicted events : 0  
294 - 2015-02-04T15:33:34: === GCTAObservation ===  
295 - 2015-02-04T15:33:34: Name ......................:  
296 - 2015-02-04T15:33:34: Identifier ................:  
297 - 2015-02-04T15:33:34: Instrument ................: CTA  
298 - 2015-02-04T15:33:34: Event file ................:  
299 - 2015-02-04T15:33:34: Event type ................: CountsCube  
300 - 2015-02-04T15:33:34: Statistics ................: Poisson  
301 - 2015-02-04T15:33:34: Ontime ....................: 1800 s  
302 - 2015-02-04T15:33:34: Livetime ..................: 1710 s  
303 - 2015-02-04T15:33:34: Deadtime correction .......: 0.95  
304 - 2015-02-04T15:33:34: User energy range .........: undefined  
305 - 2015-02-04T15:33:34: === GCTAPointing ===  
306 - 2015-02-04T15:33:34: Pointing direction ........: (RA,Dec)=(83.63,22.01)  
307 - 2015-02-04T15:33:34: Response function .........: undefined  
308 - 2015-02-04T15:33:34: === GCTAEventCube ===  
309 - 2015-02-04T15:33:34: Number of events ..........: 5542  
310 - 2015-02-04T15:33:34: Number of elements ........: 800000  
311 - 2015-02-04T15:33:34: Number of pixels ..........: 40000  
312 - 2015-02-04T15:33:34: Number of energy bins .....: 20  
313 - 2015-02-04T15:33:34: Time interval .............: 0 - 1800 sec  
314 - 2015-02-04T15:33:34:  
315 - 2015-02-04T15:33:34: +==================+  
316 - 2015-02-04T15:33:34: | Save observation |  
317 - 2015-02-04T15:33:34: +==================+  
318 - 2015-02-04T15:33:34:  
319 - 2015-02-04T15:33:34: Application "ctbin" terminated after 14 wall clock seconds, consuming 0.332675 seconds of CPU time.  
320 -  
321 -From the 6141 events that have been simulated and stored in the  
322 -``events.fits`` file, 5542 lie within the cube boundaries and are thus put 299 + 2015-05-22T19:40:30: +=================+
  300 + 2015-05-22T19:40:30: | Bin observation |
  301 + 2015-05-22T19:40:30: +=================+
  302 + 2015-05-22T19:40:30: === Observation ===
  303 + 2015-05-22T19:40:30: Events in list ............: 15964
  304 + 2015-05-22T19:40:30: Events in cube ............: 13360
  305 + 2015-05-22T19:40:30: Event bins outside RoI ....: 0
  306 + 2015-05-22T19:40:30: Events outside cube area ..: 2604
  307 + 2015-05-22T19:40:30: Events outside energy bins : 0
  308 +
  309 +From the 15964 events that have been simulated and stored in the
  310 +``events.fits`` file, 13360 lie within the cube boundaries and are thus put
323 into the resulting counts cube. The counts cube is stored in a cartesian 311 into the resulting counts cube. The counts cube is stored in a cartesian
324 projection in a World Coordinate System (WCS) compliant format. 312 projection in a World Coordinate System (WCS) compliant format.
325 313
@@ -340,12 +328,13 @@ and we do the fit by typing: @@ -340,12 +328,13 @@ and we do the fit by typing:
340 Event list, counts cube or observation definition file [events.fits] cntcube.fits 328 Event list, counts cube or observation definition file [events.fits] cntcube.fits
341 Exposure cube file (only needed for stacked analysis) [NONE] 329 Exposure cube file (only needed for stacked analysis) [NONE]
342 PSF cube file (only needed for stacked analysis) [NONE] 330 PSF cube file (only needed for stacked analysis) [NONE]
343 - Calibration database [dummy]  
344 - Instrument response function [cta_dummy_irf] 331 + Background cube file (only needed for stacked analysis) [NONE]
  332 + Calibration database [prod2]
  333 + Instrument response function [South_50h]
345 Source model [$CTOOLS/share/models/crab.xml] 334 Source model [$CTOOLS/share/models/crab.xml]
346 Source model output file [crab_results.xml] 335 Source model output file [crab_results.xml]
347 336
348 -Fitting of the data is done in *binned* mode, which means that the events 337 +The data are fitted in *binned* mode, which means that the events
349 have been binned into a counts cube and the fit computes the log-likelihood 338 have been binned into a counts cube and the fit computes the log-likelihood
350 function by summing over all 200 x 200 x 20 bins of the counts cube. There is 339 function by summing over all 200 x 200 x 20 bins of the counts cube. There is
351 an alternative method, the so called *unbinned* mode, where the events are 340 an alternative method, the so called *unbinned* mode, where the events are
@@ -356,8 +345,8 @@ One of the parameters of :ref:`ctlike` is a source model output file @@ -356,8 +345,8 @@ One of the parameters of :ref:`ctlike` is a source model output file
356 (we specified ``crab_results.xml`` in the example), and this file will be 345 (we specified ``crab_results.xml`` in the example), and this file will be
357 a copy of the source model input XML file where the parameter values have 346 a copy of the source model input XML file where the parameter values have
358 been replaced by the fit results. In addition, the statistical uncertainties 347 been replaced by the fit results. In addition, the statistical uncertainties
359 -are added for each fitted parameter using the attribute error. Below we show  
360 -the XML result file that has been produced by the run: 348 +are added for each fitted parameter using the attribute ``error``.
  349 +Below we show the XML result file that has been produced by the run:
361 350
362 .. code-block:: xml 351 .. code-block:: xml
363 352
@@ -365,8 +354,8 @@ the XML result file that has been produced by the run: @@ -365,8 +354,8 @@ the XML result file that has been produced by the run:
365 <source_library title="source library"> 354 <source_library title="source library">
366 <source name="Crab" type="PointSource"> 355 <source name="Crab" type="PointSource">
367 <spectrum type="PowerLaw"> 356 <spectrum type="PowerLaw">
368 - <parameter name="Prefactor" value="6.07928" error="0.204582" scale="1e-16" min="1e-07" max="1000" free="1" />  
369 - <parameter name="Index" value="2.5009" error="0.0252057" scale="-1" min="0" max="5" free="1" /> 357 + <parameter name="Prefactor" value="5.78197" error="0.110889" scale="1e-16" min="1e-07" max="1000" free="1" />
  358 + <parameter name="Index" value="2.49174" error="0.0164369" scale="-1" min="0" max="5" free="1" />
370 <parameter name="Scale" value="0.3" scale="1e+06" min="0.01" max="1000" free="0" /> 359 <parameter name="Scale" value="0.3" scale="1e+06" min="0.01" max="1000" free="0" />
371 </spectrum> 360 </spectrum>
372 <spatialModel type="SkyDirFunction"> 361 <spatialModel type="SkyDirFunction">
@@ -374,20 +363,31 @@ the XML result file that has been produced by the run: @@ -374,20 +363,31 @@ the XML result file that has been produced by the run:
374 <parameter name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0" /> 363 <parameter name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0" />
375 </spatialModel> 364 </spatialModel>
376 </source> 365 </source>
377 - <source name="Background" type="RadialAcceptance" instrument="CTA">  
378 - <spectrum type="FileFunction" file="$CTOOLS/share/models/bkg_dummy.txt">  
379 - <parameter name="Normalization" value="0.990708" error="0.0192887" scale="1" min="0" max="1000" free="1" /> 366 + <source name="CTABackgroundModel" type="CTAIrfBackground" instrument="CTA">
  367 + <spectrum type="PowerLaw">
  368 + <parameter name="Prefactor" value="1.02048" error="0.0280684" scale="1" min="0.001" max="1000" free="1" />
  369 + <parameter name="Index" value="0.0197856" error="0.0156686" scale="1" min="-5" max="5" free="1" />
  370 + <parameter name="Scale" value="1" scale="1e+06" min="0.01" max="1000" free="0" />
380 </spectrum> 371 </spectrum>
381 - <radialModel type="Gaussian">  
382 - <parameter name="Sigma" value="3.02523" error="0.0594117" scale="1" min="0.01" max="10" free="1" />  
383 - </radialModel>  
384 </source> 372 </source>
385 </source_library> 373 </source_library>
386 374
387 In this example, the ``Prefactor`` and ``Index`` of the spectral model for the 375 In this example, the ``Prefactor`` and ``Index`` of the spectral model for the
388 -Crab as well as the ``Normalization`` and ``Sigma`` parameter of the radial  
389 -acceptance model have been fitted (all parameters having the attribute  
390 -``free="1"`` are fitted). 376 +Crab as well as the ``Prefactor`` and ``Index`` of the background spectral
  377 +model have been fitted (all parameters having the attribute ``free="1"`` are
  378 +fitted). Now we see also the effect of having multiplied the background
  379 +model with a power law. In that way, the amplitude of the background as
  380 +well as it's spectral slope is adjusted by the fit. Obviously, in this
  381 +example the adjustment compensates only for the statistical fluctuations
  382 +of the background, but with real data, the adjustment may account also for
  383 +some of the systematic uncertainties.
  384 +
  385 +.. warning::
  386 +
  387 + As good practice, the amplitude of the background model should always be
  388 + left as a free parameter of the fit. Otherwise, any uncertainty in the
  389 + background rate will immediately propagate into the flux estimate of the
  390 + source.
391 391
392 To get more details about the model fitting you can inspect the log file. 392 To get more details about the model fitting you can inspect the log file.
393 Below the last lines of the ctlike.log log file that has been produced by 393 Below the last lines of the ctlike.log log file that has been produced by
@@ -395,70 +395,63 @@ this run: @@ -395,70 +395,63 @@ this run:
395 395
396 .. code-block:: xml 396 .. code-block:: xml
397 397
398 - 2015-02-04T15:50:43: +=================================+  
399 - 2015-02-04T15:50:43: | Maximum likelihood optimisation |  
400 - 2015-02-04T15:50:43: +=================================+  
401 - 2015-02-04T15:50:44: >Iteration 0: -logL=22752.553, Lambda=1.0e-03  
402 - 2015-02-04T15:50:46: >Iteration 1: -logL=22750.640, Lambda=1.0e-03, delta=1.913, max(|grad|)=-0.941594 [Index:3]  
403 - 2015-02-04T15:50:47: >Iteration 2: -logL=22750.632, Lambda=1.0e-04, delta=0.008, max(|grad|)=-0.079270 [Index:3]  
404 - 2015-02-04T15:50:48: >Iteration 3: -logL=22750.632, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.003073 [Index:3]  
405 - 2015-02-04T15:50:49:  
406 - 2015-02-04T15:50:49: +=========================================+  
407 - 2015-02-04T15:50:49: | Maximum likelihood optimization results |  
408 - 2015-02-04T15:50:49: +=========================================+  
409 - 2015-02-04T15:50:49: === GOptimizerLM ===  
410 - 2015-02-04T15:50:49: Optimized function value ..: 22750.632  
411 - 2015-02-04T15:50:49: Absolute precision ........: 0.005  
412 - 2015-02-04T15:50:49: Acceptable value decrease .: 2  
413 - 2015-02-04T15:50:49: Optimization status .......: converged  
414 - 2015-02-04T15:50:49: Number of parameters ......: 9  
415 - 2015-02-04T15:50:49: Number of free parameters .: 4  
416 - 2015-02-04T15:50:49: Number of iterations ......: 3  
417 - 2015-02-04T15:50:49: Lambda ....................: 1e-06  
418 - 2015-02-04T15:50:49: Maximum log likelihood ....: -22750.632  
419 - 2015-02-04T15:50:49: Observed events (Nobs) ...: 5542.000  
420 - 2015-02-04T15:50:49: Predicted events (Npred) ..: 5542.000 (Nobs - Npred = 3.3498e-06)  
421 - 2015-02-04T15:50:49: === GModels ===  
422 - 2015-02-04T15:50:49: Number of models ..........: 2  
423 - 2015-02-04T15:50:49: Number of parameters ......: 9  
424 - 2015-02-04T15:50:49: === GModelSky ===  
425 - 2015-02-04T15:50:49: Name ......................: Crab  
426 - 2015-02-04T15:50:49: Instruments ...............: all  
427 - 2015-02-04T15:50:49: Instrument scale factors ..: unity  
428 - 2015-02-04T15:50:49: Observation identifiers ...: all  
429 - 2015-02-04T15:50:49: Model type ................: PointSource  
430 - 2015-02-04T15:50:49: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
431 - 2015-02-04T15:50:49: Number of parameters ......: 6  
432 - 2015-02-04T15:50:49: Number of spatial par's ...: 2  
433 - 2015-02-04T15:50:49: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
434 - 2015-02-04T15:50:49: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
435 - 2015-02-04T15:50:49: Number of spectral par's ..: 3  
436 - 2015-02-04T15:50:49: Prefactor ................: 6.07928e-16 +/- 2.04582e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
437 - 2015-02-04T15:50:49: Index ....................: -2.5009 +/- 0.0252057 [-0,-5] (free,scale=-1,gradient)  
438 - 2015-02-04T15:50:49: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
439 - 2015-02-04T15:50:49: Number of temporal par's ..: 1  
440 - 2015-02-04T15:50:49: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
441 - 2015-02-04T15:50:49: === GCTAModelRadialAcceptance ===  
442 - 2015-02-04T15:50:49: Name ......................: Background  
443 - 2015-02-04T15:50:49: Instruments ...............: CTA  
444 - 2015-02-04T15:50:49: Instrument scale factors ..: unity  
445 - 2015-02-04T15:50:49: Observation identifiers ...: all  
446 - 2015-02-04T15:50:49: Model type ................: "Gaussian" * "FileFunction" * "Constant"  
447 - 2015-02-04T15:50:49: Number of parameters ......: 3  
448 - 2015-02-04T15:50:49: Number of radial par's ....: 1  
449 - 2015-02-04T15:50:49: Sigma ....................: 3.02523 +/- 0.0594117 [0.01,10] deg2 (free,scale=1,gradient)  
450 - 2015-02-04T15:50:49: Number of spectral par's ..: 1  
451 - 2015-02-04T15:50:49: Normalization ............: 0.990708 +/- 0.0192887 [0,1000] (free,scale=1,gradient)  
452 - 2015-02-04T15:50:49: Number of temporal par's ..: 1  
453 - 2015-02-04T15:50:49: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
454 - 2015-02-04T15:50:49:  
455 - 2015-02-04T15:50:49: +==============+  
456 - 2015-02-04T15:50:49: | Save results |  
457 - 2015-02-04T15:50:49: +==============+  
458 - 2015-02-04T15:50:49:  
459 - 2015-02-04T15:50:49: Application "ctlike" terminated after 15 wall clock seconds, consuming 5.92686 seconds of CPU time.  
460 -  
461 -The maximum likelihood optimizer required 3 iterations to converge. This 398 + 2015-05-22T19:45:15: +=================================+
  399 + 2015-05-22T19:45:15: | Maximum likelihood optimisation |
  400 + 2015-05-22T19:45:15: +=================================+
  401 + 2015-05-22T19:45:16: >Iteration 0: -logL=39910.748, Lambda=1.0e-03
  402 + 2015-05-22T19:45:18: >Iteration 1: -logL=39908.788, Lambda=1.0e-03, delta=1.960, max(|grad|)=6.701856 [Index:7]
  403 + 2015-05-22T19:45:19: >Iteration 2: -logL=39908.787, Lambda=1.0e-04, delta=0.001, max(|grad|)=-0.057041 [Index:3]
  404 + 2015-05-22T19:45:21:
  405 + 2015-05-22T19:45:21: +=========================================+
  406 + 2015-05-22T19:45:21: | Maximum likelihood optimization results |
  407 + 2015-05-22T19:45:21: +=========================================+
  408 + 2015-05-22T19:45:21: === GOptimizerLM ===
  409 + 2015-05-22T19:45:21: Optimized function value ..: 39908.787
  410 + 2015-05-22T19:45:21: Absolute precision ........: 0.005
  411 + 2015-05-22T19:45:21: Acceptable value decrease .: 2
  412 + 2015-05-22T19:45:21: Optimization status .......: converged
  413 + 2015-05-22T19:45:21: Number of parameters ......: 10
  414 + 2015-05-22T19:45:21: Number of free parameters .: 4
  415 + 2015-05-22T19:45:21: Number of iterations ......: 2
  416 + 2015-05-22T19:45:21: Lambda ....................: 1e-05
  417 + 2015-05-22T19:45:21: Maximum log likelihood ....: -39908.787
  418 + 2015-05-22T19:45:21: Observed events (Nobs) ...: 13360.000
  419 + 2015-05-22T19:45:21: Predicted events (Npred) ..: 13359.998 (Nobs - Npred = 0.00180799)
  420 + 2015-05-22T19:45:21: === GModels ===
  421 + 2015-05-22T19:45:21: Number of models ..........: 2
  422 + 2015-05-22T19:45:21: Number of parameters ......: 10
  423 + 2015-05-22T19:45:21: === GModelSky ===
  424 + 2015-05-22T19:45:21: Name ......................: Crab
  425 + 2015-05-22T19:45:21: Instruments ...............: all
  426 + 2015-05-22T19:45:21: Instrument scale factors ..: unity
  427 + 2015-05-22T19:45:21: Observation identifiers ...: all
  428 + 2015-05-22T19:45:21: Model type ................: PointSource
  429 + 2015-05-22T19:45:21: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  430 + 2015-05-22T19:45:21: Number of parameters ......: 6
  431 + 2015-05-22T19:45:21: Number of spatial par's ...: 2
  432 + 2015-05-22T19:45:21: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  433 + 2015-05-22T19:45:21: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  434 + 2015-05-22T19:45:21: Number of spectral par's ..: 3
  435 + 2015-05-22T19:45:21: Prefactor ................: 5.78197e-16 +/- 1.10889e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  436 + 2015-05-22T19:45:21: Index ....................: -2.49174 +/- 0.0164369 [-0,-5] (free,scale=-1,gradient)
  437 + 2015-05-22T19:45:21: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  438 + 2015-05-22T19:45:21: Number of temporal par's ..: 1
  439 + 2015-05-22T19:45:21: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  440 + 2015-05-22T19:45:21: === GCTAModelIrfBackground ===
  441 + 2015-05-22T19:45:21: Name ......................: CTABackgroundModel
  442 + 2015-05-22T19:45:21: Instruments ...............: CTA
  443 + 2015-05-22T19:45:21: Instrument scale factors ..: unity
  444 + 2015-05-22T19:45:21: Observation identifiers ...: all
  445 + 2015-05-22T19:45:21: Model type ................: "PowerLaw" * "Constant"
  446 + 2015-05-22T19:45:21: Number of parameters ......: 4
  447 + 2015-05-22T19:45:21: Number of spectral par's ..: 3
  448 + 2015-05-22T19:45:21: Prefactor ................: 1.02048 +/- 0.0280684 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  449 + 2015-05-22T19:45:21: Index ....................: 0.0197856 +/- 0.0156686 [-5,5] (free,scale=1,gradient)
  450 + 2015-05-22T19:45:21: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  451 + 2015-05-22T19:45:21: Number of temporal par's ..: 1
  452 + 2015-05-22T19:45:21: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  453 +
  454 +The maximum likelihood optimizer required 2 iterations to converge. This
462 is pretty fast, but recall that we used the same model file for the simulation 455 is pretty fast, but recall that we used the same model file for the simulation
463 and for fitting, hence the initial parameter values were already very close 456 and for fitting, hence the initial parameter values were already very close
464 to the best fitting values. To see the impact of the initial parameters on 457 to the best fitting values. To see the impact of the initial parameters on
@@ -466,7 +459,7 @@ the fit result, you may re-run :ref:`ctlike` using another copy of the model @@ -466,7 +459,7 @@ the fit result, you may re-run :ref:`ctlike` using another copy of the model
466 XML file where you change the value attributes of the parameters that should be 459 XML file where you change the value attributes of the parameters that should be
467 fitted. You will see that the optimizer requires a couple of more iterations, 460 fitted. You will see that the optimizer requires a couple of more iterations,
468 but it should converge to the same solution (provided that the initial values 461 but it should converge to the same solution (provided that the initial values
469 -are not too far of the best fitting values). 462 +are not too far from the best fitting values).
470 463
471 .. note:: 464 .. note::
472 465
@@ -502,17 +495,17 @@ are not too far of the best fitting values). @@ -502,17 +495,17 @@ are not too far of the best fitting values).
502 495
503 .. code-block:: xml 496 .. code-block:: xml
504 497
505 - 2015-02-05T08:29:07: === GModelSky ===  
506 - 2015-02-05T08:29:07: Name ......................: Crab  
507 - 2015-02-05T08:29:07: Instruments ...............: all  
508 - 2015-02-05T08:29:07: Test Statistic ............: 6875.35 498 + 2015-05-22T19:58:43: === GModelSky ===
  499 + 2015-05-22T19:58:43: Name ......................: Crab
  500 + 2015-05-22T19:58:43: Instruments ...............: all
  501 + 2015-05-22T19:58:43: Test Statistic ............: 18662.6
509 502
510 The Test Statistic value will also be added as new attribute 503 The Test Statistic value will also be added as new attribute
511 ``ts`` to the XML result file: 504 ``ts`` to the XML result file:
512 505
513 .. code-block:: xml 506 .. code-block:: xml
514 507
515 - <source name="Crab" type="PointSource" ts="6875.350" tscalc="1"> 508 + <source name="Crab" type="PointSource" ts="18662.576" tscalc="1">
516 509
517 510
518 .. _sec_unbinned_cta: 511 .. _sec_unbinned_cta:
@@ -521,8 +514,8 @@ Doing an unbinned analysis @@ -521,8 +514,8 @@ Doing an unbinned analysis
521 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 514 ~~~~~~~~~~~~~~~~~~~~~~~~~~
522 515
523 As gamma-ray events are rare, the counts cubes generated by :ref:`ctbin` 516 As gamma-ray events are rare, the counts cubes generated by :ref:`ctbin`
524 -will in general be sparse, having many empty pixels, in particular at  
525 -high energies. 517 +will in general be sparsly populated, having many empty pixels, in
  518 +particular at high energies.
526 An alternative analysis technique consists of working directly on the event 519 An alternative analysis technique consists of working directly on the event
527 list without binning the events in a counts cube. We will see the benefit of 520 list without binning the events in a counts cube. We will see the benefit of
528 such an analysis later once you re-run :ref:`ctlike` in unbinned mode. 521 such an analysis later once you re-run :ref:`ctlike` in unbinned mode.
@@ -553,10 +546,10 @@ following example shows how to run ctselect: @@ -553,10 +546,10 @@ following example shows how to run ctselect:
553 RA for ROI centre (degrees) (0-360) [83.63] 546 RA for ROI centre (degrees) (0-360) [83.63]
554 Dec for ROI centre (degrees) (-90-90) [22.01] 547 Dec for ROI centre (degrees) (-90-90) [22.01]
555 Radius of ROI (degrees) (0-180) [3.0] 548 Radius of ROI (degrees) (0-180) [3.0]
556 - Start time (CTA MET in seconds) (0) [0.0]  
557 - End time (CTA MET in seconds) (0) [0.0]  
558 - Lower energy limit (TeV) (0) [0.1]  
559 - Upper energy limit (TeV) (0) [100.0] 549 + Start time (CTA MET in seconds) [0.0]
  550 + End time (CTA MET in seconds) [0.0]
  551 + Lower energy limit (TeV) [0.1]
  552 + Upper energy limit (TeV) [100.0]
560 Output event list or observation definition file [selected_events.fits] 553 Output event list or observation definition file [selected_events.fits]
561 554
562 :ref:`ctselect` takes the input event list ``events.fits``, performs an 555 :ref:`ctselect` takes the input event list ``events.fits``, performs an
@@ -585,16 +578,16 @@ part: @@ -585,16 +578,16 @@ part:
585 578
586 .. code-block:: xml 579 .. code-block:: xml
587 580
588 - 2015-02-04T17:21:41: +=================+  
589 - 2015-02-04T17:21:41: | Event selection |  
590 - 2015-02-04T17:21:41: +=================+  
591 - 2015-02-04T17:21:41: === Observation ===  
592 - 2015-02-04T17:21:41: Selected energy range .....: 0.1 - 100 TeV  
593 - 2015-02-04T17:21:41: Requested ROI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg  
594 - 2015-02-04T17:21:41: ROI of data ...............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=5 deg  
595 - 2015-02-04T17:21:41: Selected ROI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg  
596 - 2015-02-04T17:21:41: cfitsio selection .........: ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000  
597 - 2015-02-04T17:21:41: FITS filename .............: /var/tmp/tmp.0.pTIaTL[EVENTS][ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000] 581 + 2015-05-22T20:01:46: +=================+
  582 + 2015-05-22T20:01:46: | Event selection |
  583 + 2015-05-22T20:01:46: +=================+
  584 + 2015-05-22T20:01:46: === Observation ===
  585 + 2015-05-22T20:01:47: Selected energy range .....: 0.1 - 100 TeV
  586 + 2015-05-22T20:01:47: Requested ROI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
  587 + 2015-05-22T20:01:47: ROI of data ...............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=5 deg
  588 + 2015-05-22T20:01:47: Selected ROI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
  589 + 2015-05-22T20:01:47: cfitsio selection .........: ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000
  590 + 2015-05-22T20:01:47: FITS filename .............: /var/tmp/tmp.0.rRgLpO[EVENTS][ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000]
598 591
599 .. note:: 592 .. note::
600 593
@@ -608,10 +601,10 @@ part: @@ -608,10 +601,10 @@ part:
608 :ref:`ctselect` will automatically adjust 601 :ref:`ctselect` will automatically adjust
609 the selection parameters to guarantee full enclosure. To keep track of 602 the selection parameters to guarantee full enclosure. To keep track of
610 this adjustment, the :ref:`ctselect` log file quotes the requested 603 this adjustment, the :ref:`ctselect` log file quotes the requested
611 - selection, and existing selections, and the selection that was finally 604 + selection, any existing selections, and the selection that was finally
612 applied. 605 applied.
613 606
614 -.. note:: 607 +.. warning::
615 608
616 :ref:`ctselect` may of course also be used for event selection prior to 609 :ref:`ctselect` may of course also be used for event selection prior to
617 binned analysis, for example to select events for a given period in 610 binned analysis, for example to select events for a given period in
@@ -627,24 +620,25 @@ instead of the counts cube: @@ -627,24 +620,25 @@ instead of the counts cube:
627 620
628 .. code-block:: bash 621 .. code-block:: bash
629 622
630 - $ ctlike  
631 - Event list, counts cube or observation definition file [cntmap.fits] selected_events.fits  
632 - Calibration database [dummy]  
633 - Instrument response function [cta_dummy_irf]  
634 - Source model [$CTOOLS/share/models/crab.xml]  
635 - Source model output file [crab_results.xml] 623 + $ ctlike
  624 + Event list, counts cube or observation definition file [cntcube.fits] selected_events.fits
  625 + Calibration database [prod2]
  626 + Instrument response function [South_50h]
  627 + Source model [$CTOOLS/share/models/crab.xml]
  628 + Source model output file [crab_results.xml]
636 629
637 You will recognise that :ref:`ctlike` runs much faster in unbinned mode 630 You will recognise that :ref:`ctlike` runs much faster in unbinned mode
638 compared to binned mode. 631 compared to binned mode.
639 This is understandable as the selected event list contains 632 This is understandable as the selected event list contains
640 -only 6127 events, while the binned counts cube we used before had 633 +only 15312 events, while the binned counts cube we used before had
641 200 x 200 x 20 = 800000 pixels. As unbinned maximum likelihood fitting loops 634 200 x 200 x 20 = 800000 pixels. As unbinned maximum likelihood fitting loops
642 over the events (while binned maximum likelihood loops over the pixels), 635 over the events (while binned maximum likelihood loops over the pixels),
643 there are much less operations to perform in unbinned than in binned mode 636 there are much less operations to perform in unbinned than in binned mode
644 (there is some additional overhead in unbinned mode that comes from 637 (there is some additional overhead in unbinned mode that comes from
645 integrating the models over the region of interest, yet this is negligible 638 integrating the models over the region of interest, yet this is negligible
646 -compared to the operations needed when looping over the pixels). So as long  
647 -as you work with short event lists, unbinned mode is faster. 639 +compared to the operations needed when looping over all pixels). So as long
  640 +as you work with small event lists, unbinned mode is faster (this
  641 +typically holds up to 100 hours of observing time).
648 Unbinned :ref:`ctlike` should also be more precise as no binning is performed, 642 Unbinned :ref:`ctlike` should also be more precise as no binning is performed,
649 hence there is no loss of information due to histogramming. 643 hence there is no loss of information due to histogramming.
650 644
@@ -658,68 +652,62 @@ the same events for both analyses. @@ -658,68 +652,62 @@ the same events for both analyses.
658 652
659 .. code-block:: xml 653 .. code-block:: xml
660 654
661 - 2015-02-04T17:31:58: +=================================+  
662 - 2015-02-04T17:31:58: | Maximum likelihood optimisation |  
663 - 2015-02-04T17:31:58: +=================================+  
664 - 2015-02-04T17:31:58: >Iteration 0: -logL=44395.244, Lambda=1.0e-03  
665 - 2015-02-04T17:31:58: Iteration 1: -logL=44396.223, Lambda=1.0e-03, delta=-0.979, max(|grad|)=9.644743 [Sigma:6] (stalled)  
666 - 2015-02-04T17:31:58: >Iteration 2: -logL=44396.162, Lambda=1.0e-02, delta=0.061, max(|grad|)=-0.309683 [Normalization:7]  
667 - 2015-02-04T17:31:59: >Iteration 3: -logL=44396.162, Lambda=1.0e-03, delta=0.000, max(|grad|)=-0.008931 [Index:3]  
668 - 2015-02-04T17:31:59:  
669 - 2015-02-04T17:31:59: +=========================================+  
670 - 2015-02-04T17:31:59: | Maximum likelihood optimization results |  
671 - 2015-02-04T17:31:59: +=========================================+  
672 - 2015-02-04T17:31:59: === GOptimizerLM ===  
673 - 2015-02-04T17:31:59: Optimized function value ..: 44396.162  
674 - 2015-02-04T17:31:59: Absolute precision ........: 0.005  
675 - 2015-02-04T17:31:59: Acceptable value decrease .: 2  
676 - 2015-02-04T17:31:59: Optimization status .......: converged  
677 - 2015-02-04T17:31:59: Number of parameters ......: 9  
678 - 2015-02-04T17:31:59: Number of free parameters .: 4  
679 - 2015-02-04T17:31:59: Number of iterations ......: 3  
680 - 2015-02-04T17:31:59: Lambda ....................: 0.0001  
681 - 2015-02-04T17:31:59: Maximum log likelihood ....: -44396.162  
682 - 2015-02-04T17:31:59: Observed events (Nobs) ...: 6127.000  
683 - 2015-02-04T17:31:59: Predicted events (Npred) ..: 6127.000 (Nobs - Npred = 0.000303534)  
684 - 2015-02-04T17:31:59: === GModels ===  
685 - 2015-02-04T17:31:59: Number of models ..........: 2  
686 - 2015-02-04T17:31:59: Number of parameters ......: 9  
687 - 2015-02-04T17:31:59: === GModelSky ===  
688 - 2015-02-04T17:31:59: Name ......................: Crab  
689 - 2015-02-04T17:31:59: Instruments ...............: all  
690 - 2015-02-04T17:31:59: Instrument scale factors ..: unity  
691 - 2015-02-04T17:31:59: Observation identifiers ...: all  
692 - 2015-02-04T17:31:59: Model type ................: PointSource  
693 - 2015-02-04T17:31:59: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
694 - 2015-02-04T17:31:59: Number of parameters ......: 6  
695 - 2015-02-04T17:31:59: Number of spatial par's ...: 2  
696 - 2015-02-04T17:31:59: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
697 - 2015-02-04T17:31:59: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
698 - 2015-02-04T17:31:59: Number of spectral par's ..: 3  
699 - 2015-02-04T17:31:59: Prefactor ................: 6.13325e-16 +/- 2.05738e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
700 - 2015-02-04T17:31:59: Index ....................: -2.5057 +/- 0.0250818 [-0,-5] (free,scale=-1,gradient)  
701 - 2015-02-04T17:31:59: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
702 - 2015-02-04T17:31:59: Number of temporal par's ..: 1  
703 - 2015-02-04T17:31:59: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
704 - 2015-02-04T17:31:59: === GCTAModelRadialAcceptance ===  
705 - 2015-02-04T17:31:59: Name ......................: Background  
706 - 2015-02-04T17:31:59: Instruments ...............: CTA  
707 - 2015-02-04T17:31:59: Instrument scale factors ..: unity  
708 - 2015-02-04T17:31:59: Observation identifiers ...: all  
709 - 2015-02-04T17:31:59: Model type ................: "Gaussian" * "FileFunction" * "Constant"  
710 - 2015-02-04T17:31:59: Number of parameters ......: 3  
711 - 2015-02-04T17:31:59: Number of radial par's ....: 1  
712 - 2015-02-04T17:31:59: Sigma ....................: 3.04429 +/- 0.0330227 [0.01,10] deg2 (free,scale=1,gradient)  
713 - 2015-02-04T17:31:59: Number of spectral par's ..: 1  
714 - 2015-02-04T17:31:59: Normalization ............: 0.996767 +/- 0.0175227 [0,1000] (free,scale=1,gradient)  
715 - 2015-02-04T17:31:59: Number of temporal par's ..: 1  
716 - 2015-02-04T17:31:59: Constant .................: 1 (relative value) (fixed,scale=1,gradient)  
717 - 2015-02-04T17:31:59:  
718 - 2015-02-04T17:31:59: +==============+  
719 - 2015-02-04T17:31:59: | Save results |  
720 - 2015-02-04T17:31:59: +==============+  
721 - 2015-02-04T17:31:59:  
722 - 2015-02-04T17:31:59: Application "ctlike" terminated after 8 wall clock seconds, consuming 0.21275 seconds of CPU time. 655 + 2015-05-22T20:05:54: +=================================+
  656 + 2015-05-22T20:05:54: | Maximum likelihood optimisation |
  657 + 2015-05-22T20:05:54: +=================================+
  658 + 2015-05-22T20:05:54: >Iteration 0: -logL=93854.543, Lambda=1.0e-03
  659 + 2015-05-22T20:05:54: >Iteration 1: -logL=93848.595, Lambda=1.0e-03, delta=5.948, max(|grad|)=22.480581 [Index:7]
  660 + 2015-05-22T20:05:54: >Iteration 2: -logL=93848.587, Lambda=1.0e-04, delta=0.008, max(|grad|)=-0.081846 [Index:3]
  661 + 2015-05-22T20:05:54: >Iteration 3: -logL=93848.587, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.003485 [Index:3]
  662 + 2015-05-22T20:05:54:
  663 + 2015-05-22T20:05:54: +=========================================+
  664 + 2015-05-22T20:05:54: | Maximum likelihood optimization results |
  665 + 2015-05-22T20:05:54: +=========================================+
  666 + 2015-05-22T20:05:54: === GOptimizerLM ===
  667 + 2015-05-22T20:05:54: Optimized function value ..: 93848.587
  668 + 2015-05-22T20:05:54: Absolute precision ........: 0.005
  669 + 2015-05-22T20:05:54: Acceptable value decrease .: 2
  670 + 2015-05-22T20:05:54: Optimization status .......: converged
  671 + 2015-05-22T20:05:54: Number of parameters ......: 10
  672 + 2015-05-22T20:05:54: Number of free parameters .: 4
  673 + 2015-05-22T20:05:54: Number of iterations ......: 3
  674 + 2015-05-22T20:05:54: Lambda ....................: 1e-06
  675 + 2015-05-22T20:05:54: Maximum log likelihood ....: -93848.587
  676 + 2015-05-22T20:05:54: Observed events (Nobs) ...: 15312.000
  677 + 2015-05-22T20:05:54: Predicted events (Npred) ..: 15312.000 (Nobs - Npred = 3.03823e-06)
  678 + 2015-05-22T20:05:54: === GModels ===
  679 + 2015-05-22T20:05:54: Number of models ..........: 2
  680 + 2015-05-22T20:05:54: Number of parameters ......: 10
  681 + 2015-05-22T20:05:54: === GModelSky ===
  682 + 2015-05-22T20:05:54: Name ......................: Crab
  683 + 2015-05-22T20:05:54: Instruments ...............: all
  684 + 2015-05-22T20:05:54: Instrument scale factors ..: unity
  685 + 2015-05-22T20:05:54: Observation identifiers ...: all
  686 + 2015-05-22T20:05:54: Model type ................: PointSource
  687 + 2015-05-22T20:05:54: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  688 + 2015-05-22T20:05:54: Number of parameters ......: 6
  689 + 2015-05-22T20:05:54: Number of spatial par's ...: 2
  690 + 2015-05-22T20:05:54: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  691 + 2015-05-22T20:05:54: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  692 + 2015-05-22T20:05:54: Number of spectral par's ..: 3
  693 + 2015-05-22T20:05:54: Prefactor ................: 5.80619e-16 +/- 1.11149e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  694 + 2015-05-22T20:05:54: Index ....................: -2.49282 +/- 0.0163467 [-0,-5] (free,scale=-1,gradient)
  695 + 2015-05-22T20:05:54: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  696 + 2015-05-22T20:05:54: Number of temporal par's ..: 1
  697 + 2015-05-22T20:05:54: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  698 + 2015-05-22T20:05:54: === GCTAModelIrfBackground ===
  699 + 2015-05-22T20:05:54: Name ......................: CTABackgroundModel
  700 + 2015-05-22T20:05:54: Instruments ...............: CTA
  701 + 2015-05-22T20:05:54: Instrument scale factors ..: unity
  702 + 2015-05-22T20:05:54: Observation identifiers ...: all
  703 + 2015-05-22T20:05:54: Model type ................: "PowerLaw" * "Constant"
  704 + 2015-05-22T20:05:54: Number of parameters ......: 4
  705 + 2015-05-22T20:05:54: Number of spectral par's ..: 3
  706 + 2015-05-22T20:05:54: Prefactor ................: 1.03511 +/- 0.024311 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  707 + 2015-05-22T20:05:54: Index ....................: 0.0333176 +/- 0.0134386 [-5,5] (free,scale=1,gradient)
  708 + 2015-05-22T20:05:54: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  709 + 2015-05-22T20:05:54: Number of temporal par's ..: 1
  710 + 2015-05-22T20:05:54: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
723 711
724 712
725 .. _sec_butterfly_cta: 713 .. _sec_butterfly_cta:
@@ -739,14 +727,14 @@ line. @@ -739,14 +727,14 @@ line.
739 .. code-block:: bash 727 .. code-block:: bash
740 728
741 $ ctbutterfly 729 $ ctbutterfly
742 - Input event list, cube or observation definition file [events.fits]  
743 - Calibration database [dummy]  
744 - Instrument response function [cta_dummy_irf]  
745 - Source model [$CTOOLS/share/models/crab.xml] crab_results.xml 730 + Input event list, counts cube or observation definition file [events.fits]
  731 + Calibration database [prod2]
  732 + Instrument response function [South_50h]
  733 + Source model [$CTOOLS/share/models/crab.xml]
746 Source of interest [Crab] 734 Source of interest [Crab]
747 Start value for first energy bin in TeV [0.1] 735 Start value for first energy bin in TeV [0.1]
748 Stop value for last energy bin in TeV [100.0] 736 Stop value for last energy bin in TeV [100.0]
749 - Output ascii file [butterfly.txt] 737 + Output ascii file [butterfly.txt]
750 738
751 Now that you have computed the confidence band of the spectral fit and 739 Now that you have computed the confidence band of the spectral fit and
752 that you will have an ASCII file named ``butterfly.txt`` on disk you can 740 that you will have an ASCII file named ``butterfly.txt`` on disk you can
doc/source/user_manual/getting_started/tsmap-crab.png

75.2 KB | W: | H:

70.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin