Commit d8bfe7c2c0f01861a4f1bd37c05c8d43ebd2834d

Authored by Jürgen Knödlseder
1 parent 2c9b9195

Update the Getting Started section of the User documentation

doc/source/develop/git/index.rst
@@ -33,14 +33,14 @@ Before you start @@ -33,14 +33,14 @@ Before you start
33 Make sure you configured your `Git <https://git-scm.com/>`_ using your user 33 Make sure you configured your `Git <https://git-scm.com/>`_ using your user
34 name and e-mail address (you only need to do this once on your machine): 34 name and e-mail address (you only need to do this once on your machine):
35 35
36 -.. code-block:: sh 36 +.. code-block:: bash
37 37
38 $ git config --global user.name "John Doe" 38 $ git config --global user.name "John Doe"
39 $ git config --global user.email johndoe@example.com 39 $ git config --global user.email johndoe@example.com
40 40
41 In addition, you may need to add 41 In addition, you may need to add
42 42
43 -.. code-block:: sh 43 +.. code-block:: bash
44 44
45 $ git config --global http.sslverify "false" 45 $ git config --global http.sslverify "false"
46 46
@@ -95,7 +95,7 @@ ownership. @@ -95,7 +95,7 @@ ownership.
95 95
96 Now you can clone this fork using 96 Now you can clone this fork using
97 97
98 -.. code-block:: sh 98 +.. code-block:: bash
99 99
100 $ git clone https://cta-gitlab.irap.omp.eu/[user]/ctools.git 100 $ git clone https://cta-gitlab.irap.omp.eu/[user]/ctools.git
101 101
@@ -106,13 +106,13 @@ user name. @@ -106,13 +106,13 @@ user name.
106 To keep in sync with the ctools repository you should add it as 106 To keep in sync with the ctools repository you should add it as
107 a remote repository using 107 a remote repository using
108 108
109 -.. code-block:: sh 109 +.. code-block:: bash
110 110
111 $ git remote add upstream https://cta-gitlab.irap.omp.eu/ctools/ctools.git 111 $ git remote add upstream https://cta-gitlab.irap.omp.eu/ctools/ctools.git
112 112
113 You can then type 113 You can then type
114 114
115 -.. code-block:: sh 115 +.. code-block:: bash
116 116
117 $ git pull upstream devel 117 $ git pull upstream devel
118 118
@@ -127,7 +127,7 @@ To work on a new feature or to correct a bug you should always create a new @@ -127,7 +127,7 @@ To work on a new feature or to correct a bug you should always create a new
127 branch. 127 branch.
128 You do this by typing 128 You do this by typing
129 129
130 -.. code-block:: sh 130 +.. code-block:: bash
131 131
132 $ git checkout devel 132 $ git checkout devel
133 $ git pull upstream devel 133 $ git pull upstream devel
@@ -150,13 +150,13 @@ Once you have verified that the bug is correct you should commit your changes. @@ -150,13 +150,13 @@ Once you have verified that the bug is correct you should commit your changes.
150 150
151 First stage the files you want to commit: 151 First stage the files you want to commit:
152 152
153 -.. code-block:: sh 153 +.. code-block:: bash
154 154
155 $ git add src/ctselect/ctselect.cpp 155 $ git add src/ctselect/ctselect.cpp
156 156
157 and then commit your change: 157 and then commit your change:
158 158
159 -.. code-block:: sh 159 +.. code-block:: bash
160 160
161 $ git commit -m "Corrected event selection in ctselect (#5783) 161 $ git commit -m "Corrected event selection in ctselect (#5783)
162 > 162 >
@@ -176,7 +176,7 @@ changes into your @@ -176,7 +176,7 @@ changes into your
176 repository. 176 repository.
177 You do this by typing 177 You do this by typing
178 178
179 -.. code-block:: sh 179 +.. code-block:: bash
180 180
181 $ git push origin 5783-correct-event-selection 181 $ git push origin 5783-correct-event-selection
182 182
doc/source/users/user_manual/getting.rst
@@ -63,7 +63,7 @@ in an appropriate location (for example ``$HOME/builds``), and type @@ -63,7 +63,7 @@ in an appropriate location (for example ``$HOME/builds``), and type
63 63
64 .. code-block:: bash 64 .. code-block:: bash
65 65
66 - $ tar xvfz gammalib-1.0.0.tar.gz 66 + $ tar xvfz gammalib-1.1.0.tar.gz
67 67
68 (the ``$`` symbol indicates the console prompt and is not part of the 68 (the ``$`` symbol indicates the console prompt and is not part of the
69 command that you should type in). 69 command that you should type in).
@@ -73,7 +73,7 @@ typing @@ -73,7 +73,7 @@ typing
73 73
74 .. code-block:: bash 74 .. code-block:: bash
75 75
76 - $ cd gammalib-1.0.0 76 + $ cd gammalib-1.1.0
77 $ ./configure 77 $ ./configure
78 $ make 78 $ make
79 $ make check 79 $ make check
@@ -135,7 +135,7 @@ an appropriate location (for example ``$HOME/builds``), and type @@ -135,7 +135,7 @@ an appropriate location (for example ``$HOME/builds``), and type
135 135
136 .. code-block:: bash 136 .. code-block:: bash
137 137
138 - $ tar xvfz ctools-1.0.0.tar.gz 138 + $ tar xvfz ctools-1.1.0.tar.gz
139 139
140 (the ``$`` symbol indicates the console prompt and is not part of the 140 (the ``$`` symbol indicates the console prompt and is not part of the
141 command that you should type in). 141 command that you should type in).
@@ -144,7 +144,7 @@ Step in the directory and build the ctools by typing @@ -144,7 +144,7 @@ Step in the directory and build the ctools by typing
144 144
145 .. code-block:: bash 145 .. code-block:: bash
146 146
147 - $ cd ctools-1.0.0 147 + $ cd ctools-1.1.0
148 $ ./configure 148 $ ./configure
149 $ make 149 $ make
150 150
@@ -178,95 +178,61 @@ following output at the end of the unit testing: @@ -178,95 +178,61 @@ following output at the end of the unit testing:
178 178
179 .. code-block:: bash 179 .. code-block:: bash
180 180
181 - PASS: test_ctools.sh  
182 - PASS: test_cscripts.sh  
183 - PASS: test_python.py  
184 - make[4]: Nothing to be done for `all'.  
185 - ============================================================================  
186 - Testsuite summary for ctools 1.0.0  
187 - ============================================================================  
188 - # TOTAL: 3  
189 - # PASS: 3  
190 - # SKIP: 0  
191 - # XFAIL: 0  
192 - # FAIL: 0  
193 - # XPASS: 0  
194 - # ERROR: 0  
195 - ============================================================================ 181 + PASS: test_python_ctools.sh
  182 + PASS: test_python_cscripts.sh
  183 + PASS: test_examples.py
  184 + ============================================================================
  185 + Testsuite summary for ctools 1.1.0
  186 + ============================================================================
  187 + # TOTAL: 3
  188 + # PASS: 3
  189 + # SKIP: 0
  190 + # XFAIL: 0
  191 + # FAIL: 0
  192 + # XPASS: 0
  193 + # ERROR: 0
  194 + ============================================================================
196 195
197 For older automake version, you should see 196 For older automake version, you should see
198 197
199 .. code-block:: bash 198 .. code-block:: bash
200 199
201 - ***************  
202 - * Test ctools *  
203 - ***************  
204 - Test ctobssim: .. ok  
205 - Test ctskymap: .. ok  
206 - Test ctbin: .... ok  
207 - Test ctexpcube: .... ok  
208 - Test ctpsfcube: .... ok  
209 - Test ctbkgcube: ...... ok  
210 - Test ctmodel: ...... ok  
211 - Test ctselect: .. ok  
212 - Test ctlike: ...... ok  
213 - Test cttsmap: .. ok  
214 - Test ctcubemask: .. ok  
215 - Test ctbutterfly: .. ok  
216 - Test ctulimit: .. ok  
217 - Test cterror: .. ok  
218 - PASS: test_ctools.sh  
219 -  
220 - *****************  
221 - * Test cscripts *  
222 - *****************  
223 - Test csobsdef: .. ok  
224 - Test csobs2caldb: .. ok  
225 - Test csobsinfo: .. ok  
226 - Test csiactobs: .. ok  
227 - Test csmodelinfo: .. ok  
228 - Test csmodelmerge (space-separated): .. ok  
229 - Test csmodelmerge (comma-separated): .. ok  
230 - Test csmodelmerge (wildcard string): .. ok  
231 - Test csmodelmerge (ascii-file): .. ok  
232 - Test cstsmapmerge (comma-separated): .. ok  
233 - Test cstsmapmerge (space-separated): .. ok  
234 - Test cstsmapmerge (wildcard string): .. ok  
235 - Test cstsmapmerge (ascii-file): .. ok  
236 - Test cspull: .. ok  
237 - Test cssens: .. ok  
238 - Test cstsdist: .. ok  
239 - Test csresmap: .. ok  
240 - Test csspec (unbinned): .. ok  
241 - Test csspec (binned): .. ok  
242 - Test cslightcrv (unbinned): .. ok  
243 - Test cslightcrv (binned): .. ok  
244 - PASS: test_cscripts.sh  
245 -  
246 - ***********************  
247 - * ctools unit testing *  
248 - ***********************  
249 - Test ctobssim functionality: .......... ok  
250 - Test ctobssim on observation container: .... ok  
251 - Test ctselect functionality: ... ok  
252 - Test ctbin functionality: ... ok  
253 - Test ctlike functionality: ... ok  
254 - Test cttsmap functionality: ... ok  
255 - Test ctmodel functionality: ... ok  
256 - Test ctskymap functionality: ... ok  
257 - Test ctexpcube functionality: ... ok  
258 - Test ctpsfcube functionality: ... ok  
259 - Test ctbkgcube functionality: ... ok  
260 - Test ctcubemask functionality: ... ok  
261 - Test ctbutterfly functionality: ... ok  
262 - Test ctulimit functionality: ... ok  
263 - Test cterror functionality: ... ok  
264 - Test unbinned pipeline with FITS file saving: .... ok  
265 - Test unbinned in-memory pipeline: .... ok  
266 - PASS: test_python.py  
267 - ==================  
268 - All 3 tests passed  
269 - ================== 200 + ***********************
  201 + * ctools unit testing *
  202 + ***********************
  203 + Test ctobssim on command line: ..... ok
  204 + Test ctobssim from Python: ................................................. ok
  205 + Test ctselect on command line: ....... ok
  206 + Test ctselect from Python: ..... ok
  207 + Test ctbin on command line: ..... ok
  208 + Test ctbin from Python: ............................................. ok
  209 + ...
  210 + PASS test_python_ctools.sh
  211 +
  212 + *************************
  213 + * cscripts unit testing *
  214 + *************************
  215 + Test cscaldb on command line: .. ok
  216 + Test cscaldb from Python: . ok
  217 + Test cslightcrv on command line: ............... ok
  218 + Test cslightcrv from Python: ................................................. ok
  219 + Test csmodelinfo on command line: ..... ok
  220 + Test csmodelinfo from Python: ..... ok
  221 + ...
  222 + PASS test_python_cscripts.sh
  223 +
  224 + ********************
  225 + * Examples testing *
  226 + ********************
  227 + Test generate_prod3_irfs.py: .. ok
  228 + Test make_pointings.py: ....... ok
  229 + Test make_spectrum.py: .. ok
  230 + Test make_ts_distributions.py: .. ok
  231 + ...
  232 + PASS test_examples.py
  233 + ==================
  234 + All 3 tests passed
  235 + ==================
270 236
271 The same detailed information is also available for the newer automake 237 The same detailed information is also available for the newer automake
272 versions, but there it is written in log files that you can find in the 238 versions, but there it is written in log files that you can find in the
@@ -274,9 +240,9 @@ versions, but there it is written in log files that you can find in the @@ -274,9 +240,9 @@ versions, but there it is written in log files that you can find in the
274 240
275 .. code-block:: bash 241 .. code-block:: bash
276 242
277 - test_ctools.sh.log  
278 - test_cscripts.sh.log  
279 - test_python.py.log 243 + test_python_ctools.sh.log
  244 + test_python_cscripts.sh.log
  245 + test_examples.py.log
280 246
281 If you do not see the same output, but a failure message, please check 247 If you do not see the same output, but a failure message, please check
282 first the :ref:`issues` section. If you cannot fix the problem, please 248 first the :ref:`issues` section. If you cannot fix the problem, please
doc/source/users/user_manual/getting_started/beyond_combine.rst
@@ -12,7 +12,7 @@ in a single shot. @@ -12,7 +12,7 @@ in a single shot.
12 Here is an example that illustrates how to do that. 12 Here is an example that illustrates how to do that.
13 13
14 Let's start with the simulation of two 30 min long observations of the Crab 14 Let's start with the simulation of two 30 min long observations of the Crab
15 -nebula, each offset by 0.5 deg from the nebula in opposite directions: 15 +nebula, each offset by 0.5° from the nebula in opposite directions:
16 16
17 .. code-block:: bash 17 .. code-block:: bash
18 18
@@ -79,11 +79,10 @@ ctools knows which instrument specific functions need to be called.** @@ -79,11 +79,10 @@ ctools knows which instrument specific functions need to be called.**
79 .. note:: 79 .. note::
80 80
81 The instrument string for a CTA observation is obviously ``CTA``. 81 The instrument string for a CTA observation is obviously ``CTA``.
82 - In case that data from any existing Imaging Air Cherenkov Telescope  
83 - are provided in the correct format, the instrument strings  
84 - ``HESS``, ``MAGIC`` and ``VERITAS`` are also recognised. This opens  
85 - the obvious possibility to combine data from different  
86 - Imaging Air Cherenkov Telescope in a joint analysis. 82 + In case that you want to analyse data from an existing Imaging Air
  83 + Cherenkov Telescope you can also set the instrument string to ``HESS``,
  84 + ``MAGIC``, or ``VERITAS``. You may also combine observations from different
  85 + telescopes for a joint analysis in an observation definition file.
87 **Please recall that instrument strings are case sensitive.** 86 **Please recall that instrument strings are case sensitive.**
88 87
89 Now you are ready to do a joint maximum likelihood analysis using 88 Now you are ready to do a joint maximum likelihood analysis using
@@ -98,128 +97,127 @@ Now you are ready to do a joint maximum likelihood analysis using @@ -98,128 +97,127 @@ Now you are ready to do a joint maximum likelihood analysis using
98 Input model XML file [$CTOOLS/share/models/crab.xml] 97 Input model XML file [$CTOOLS/share/models/crab.xml]
99 Output model XML file [crab_results.xml] 98 Output model XML file [crab_results.xml]
100 99
101 -Instead of providing an event list or a counts cube, you now provided the 100 +Instead of providing an event list or a counts cube, you now provide the
102 filename of the observation definition XML file (here ``obs.xml``) as input 101 filename of the observation definition XML file (here ``obs.xml``) as input
103 parameter. :ref:`ctlike` recognises this format and automatically performs a 102 parameter. :ref:`ctlike` recognises this format and automatically performs a
104 -joint analysis. To see the result of this you needed to specify the  
105 -``chatter=3`` parameter so that the chattiness is increased in the log  
106 -file: 103 +joint maximum likelihood analysis. To see the result of this you needed to
  104 +specify the ``chatter=3`` parameter so that the chattiness is increased in
  105 +the log file:
107 106
108 -.. code-block:: xml 107 +.. code-block:: none
109 108
110 - 2015-12-07T21:23:07: +==============+  
111 - 2015-12-07T21:23:07: | Observations |  
112 - 2015-12-07T21:23:07: +==============+  
113 - 2015-12-07T21:23:07: === GObservations ===  
114 - 2015-12-07T21:23:07: Number of observations ....: 2  
115 - 2015-12-07T21:23:07: Number of models ..........: 2  
116 - 2015-12-07T21:23:07: Number of predicted events : 0  
117 - 2015-12-07T21:23:07: === GCTAObservation ===  
118 - 2015-12-07T21:23:07: Name ......................: Crab  
119 - 2015-12-07T21:23:07: Identifier ................: 00001  
120 - 2015-12-07T21:23:07: Instrument ................: CTA  
121 - 2015-12-07T21:23:07: Event file ................: events1.fits  
122 - 2015-12-07T21:23:07: Event type ................: EventList  
123 - 2015-12-07T21:23:07: Statistics ................: Poisson  
124 - 2015-12-07T21:23:07: Ontime ....................: 1800 s  
125 - 2015-12-07T21:23:07: Livetime ..................: 1710 s  
126 - 2015-12-07T21:23:07: Deadtime correction .......: 0.95  
127 - 2015-12-07T21:23:07: User energy range .........: undefined  
128 - 2015-12-07T21:23:07: === GCTAPointing ===  
129 - 2015-12-07T21:23:07: Pointing direction ........: (RA,Dec)=(83.63,21.51)  
130 - 2015-12-07T21:23:07: === GCTAResponseIrf ===  
131 - 2015-12-07T21:23:07: Caldb mission .............: cta  
132 - 2015-12-07T21:23:07: Caldb instrument ..........: prod2  
133 - 2015-12-07T21:23:07: Response name .............: South_0.5h  
134 - 2015-12-07T21:23:07: Energy dispersion .........: Not used  
135 - 2015-12-07T21:23:07: Save energy range .........: undefined  
136 - 2015-12-07T21:23:07: === GCTAEventList ===  
137 - 2015-12-07T21:23:07: Number of events ..........: 22593  
138 - 2015-12-07T21:23:07: Time interval .............: 51544.5 - 51544.5 days  
139 - 2015-12-07T21:23:07: Energy interval ...........: 0.1 - 100 TeV  
140 - 2015-12-07T21:23:07: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg  
141 - 2015-12-07T21:23:07: === GCTAObservation ===  
142 - 2015-12-07T21:23:07: Name ......................: Crab  
143 - 2015-12-07T21:23:07: Identifier ................: 00002  
144 - 2015-12-07T21:23:07: Instrument ................: CTA  
145 - 2015-12-07T21:23:07: Event file ................: events2.fits  
146 - 2015-12-07T21:23:07: Event type ................: EventList  
147 - 2015-12-07T21:23:07: Statistics ................: Poisson  
148 - 2015-12-07T21:23:07: Ontime ....................: 1800 s  
149 - 2015-12-07T21:23:07: Livetime ..................: 1710 s  
150 - 2015-12-07T21:23:07: Deadtime correction .......: 0.95  
151 - 2015-12-07T21:23:07: User energy range .........: undefined  
152 - 2015-12-07T21:23:07: === GCTAPointing ===  
153 - 2015-12-07T21:23:07: Pointing direction ........: (RA,Dec)=(83.63,22.51)  
154 - 2015-12-07T21:23:07: === GCTAResponseIrf ===  
155 - 2015-12-07T21:23:07: Caldb mission .............: cta  
156 - 2015-12-07T21:23:07: Caldb instrument ..........: prod2  
157 - 2015-12-07T21:23:07: Response name .............: South_0.5h  
158 - 2015-12-07T21:23:07: Energy dispersion .........: Not used  
159 - 2015-12-07T21:23:07: Save energy range .........: undefined  
160 - 2015-12-07T21:23:07: === GCTAEventList ===  
161 - 2015-12-07T21:23:07: Number of events ..........: 22529  
162 - 2015-12-07T21:23:07: Time interval .............: 51544.5 - 51544.5 days  
163 - 2015-12-07T21:23:07: Energy interval ...........: 0.1 - 100 TeV  
164 - 2015-12-07T21:23:07: Region of interest ........: RA=83.63, DEC=22.51 [0,0] Radius=5 deg  
165 - ...  
166 - 2015-12-07T21:23:07: +=================================+  
167 - 2015-12-07T21:23:07: | Maximum likelihood optimisation |  
168 - 2015-12-07T21:23:07: +=================================+  
169 - 2015-12-07T21:23:07: >Iteration 0: -logL=304176.886, Lambda=1.0e-03  
170 - 2015-12-07T21:23:08: >Iteration 1: -logL=304161.799, Lambda=1.0e-03, delta=15.088, max(|grad|)=12.922804 [Index:3]  
171 - 2015-12-07T21:23:08: >Iteration 2: -logL=304161.783, Lambda=1.0e-04, delta=0.015, max(|grad|)=0.098155 [Index:3]  
172 - 2015-12-07T21:23:08: >Iteration 3: -logL=304161.783, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.000598 [Index:3] 109 + 2016-06-29T19:14:38: +==============+
  110 + 2016-06-29T19:14:38: | Observations |
  111 + 2016-06-29T19:14:38: +==============+
  112 + 2016-06-29T19:14:38: === GObservations ===
  113 + 2016-06-29T19:14:38: Number of observations ....: 2
  114 + 2016-06-29T19:14:38: Number of models ..........: 2
  115 + 2016-06-29T19:14:38: Number of observed events .: 46028
  116 + 2016-06-29T19:14:38: Number of predicted events : 0
  117 + 2016-06-29T19:14:38: === GCTAObservation ===
  118 + 2016-06-29T19:14:38: Name ......................: Crab
  119 + 2016-06-29T19:14:38: Identifier ................: 00001
  120 + 2016-06-29T19:14:38: Instrument ................: CTA
  121 + 2016-06-29T19:14:38: Event file ................: events1.fits
  122 + 2016-06-29T19:14:38: Event type ................: EventList
  123 + 2016-06-29T19:14:38: Statistics ................: Poisson
  124 + 2016-06-29T19:14:38: Ontime ....................: 1800 s
  125 + 2016-06-29T19:14:38: Livetime ..................: 1710 s
  126 + 2016-06-29T19:14:38: Deadtime correction .......: 0.95
  127 + 2016-06-29T19:14:38: User energy range .........: undefined
  128 + 2016-06-29T19:14:38: === GCTAPointing ===
  129 + 2016-06-29T19:14:38: Pointing direction ........: (RA,Dec)=(83.63,21.51)
  130 + 2016-06-29T19:14:38: === GCTAResponseIrf ===
  131 + 2016-06-29T19:14:38: Caldb mission .............: cta
  132 + 2016-06-29T19:14:38: Caldb instrument ..........: prod2
  133 + 2016-06-29T19:14:38: Response name .............: South_0.5h
  134 + 2016-06-29T19:14:38: Energy dispersion .........: Not used
  135 + 2016-06-29T19:14:38: Save energy range .........: undefined
  136 + 2016-06-29T19:14:38: === GCTAEventList ===
  137 + 2016-06-29T19:14:38: Number of events ..........: 23014 (disposed in "events1.fits")
  138 + 2016-06-29T19:14:38: Time interval .............: 51544.5 - 51544.5 days
  139 + 2016-06-29T19:14:38: Energy interval ...........: 0.1 - 100 TeV
  140 + 2016-06-29T19:14:38: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg
  141 + 2016-06-29T19:14:38: === GCTAObservation ===
  142 + 2016-06-29T19:14:38: Name ......................: Crab
  143 + 2016-06-29T19:14:38: Identifier ................: 00002
  144 + 2016-06-29T19:14:38: Instrument ................: CTA
  145 + 2016-06-29T19:14:38: Event file ................: events2.fits
  146 + 2016-06-29T19:14:38: Event type ................: EventList
  147 + 2016-06-29T19:14:38: Statistics ................: Poisson
  148 + 2016-06-29T19:14:38: Ontime ....................: 1800 s
  149 + 2016-06-29T19:14:38: Livetime ..................: 1710 s
  150 + 2016-06-29T19:14:38: Deadtime correction .......: 0.95
  151 + 2016-06-29T19:14:38: User energy range .........: undefined
  152 + 2016-06-29T19:14:38: === GCTAPointing ===
  153 + 2016-06-29T19:14:38: Pointing direction ........: (RA,Dec)=(83.63,21.51)
  154 + 2016-06-29T19:14:38: === GCTAResponseIrf ===
  155 + 2016-06-29T19:14:38: Caldb mission .............: cta
  156 + 2016-06-29T19:14:38: Caldb instrument ..........: prod2
  157 + 2016-06-29T19:14:38: Response name .............: South_0.5h
  158 + 2016-06-29T19:14:38: Energy dispersion .........: Not used
  159 + 2016-06-29T19:14:38: Save energy range .........: undefined
  160 + 2016-06-29T19:14:38: === GCTAEventList ===
  161 + 2016-06-29T19:14:38: Number of events ..........: 23014 (disposed in "events2.fits")
  162 + 2016-06-29T19:14:38: Time interval .............: 51544.5 - 51544.5 days
  163 + 2016-06-29T19:14:38: Energy interval ...........: 0.1 - 100 TeV
  164 + 2016-06-29T19:14:38: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg
  165 + 2016-06-29T19:14:38:
  166 + 2016-06-29T19:14:38: +=================================+
  167 + 2016-06-29T19:14:38: | Maximum likelihood optimisation |
  168 + 2016-06-29T19:14:38: +=================================+
  169 + 2016-06-29T19:14:38: >Iteration 0: -logL=309355.758, Lambda=1.0e-03
  170 + 2016-06-29T19:14:38: >Iteration 1: -logL=309352.158, Lambda=1.0e-03, delta=3.600, max(|grad|)=7.976081 [Index:7]
  171 + 2016-06-29T19:14:38: >Iteration 2: -logL=309352.157, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.033525 [Index:3]
173 ... 172 ...
174 -  
175 - 2015-12-07T21:23:08: +=========================================+  
176 - 2015-12-07T21:23:08: | Maximum likelihood optimisation results |  
177 - 2015-12-07T21:23:08: +=========================================+  
178 - 2015-12-07T21:23:08: === GOptimizerLM ===  
179 - 2015-12-07T21:23:08: Optimized function value ..: 304161.783  
180 - 2015-12-07T21:23:08: Absolute precision ........: 0.005  
181 - 2015-12-07T21:23:08: Acceptable value decrease .: 2  
182 - 2015-12-07T21:23:08: Optimization status .......: converged  
183 - 2015-12-07T21:23:08: Number of parameters ......: 10  
184 - 2015-12-07T21:23:08: Number of free parameters .: 4  
185 - 2015-12-07T21:23:08: Number of iterations ......: 3  
186 - 2015-12-07T21:23:08: Lambda ....................: 1e-06  
187 - 2015-12-07T21:23:08: Maximum log likelihood ....: -304161.783  
188 - 2015-12-07T21:23:08: Observed events (Nobs) ...: 45122.000  
189 - 2015-12-07T21:23:08: Predicted events (Npred) ..: 45122.000 (Nobs - Npred = 1.04131e-06)  
190 - 2015-12-07T21:23:08: === GModels ===  
191 - 2015-12-07T21:23:08: Number of models ..........: 2  
192 - 2015-12-07T21:23:08: Number of parameters ......: 10  
193 - 2015-12-07T21:23:08: === GModelSky ===  
194 - 2015-12-07T21:23:08: Name ......................: Crab  
195 - 2015-12-07T21:23:08: Instruments ...............: all  
196 - 2015-12-07T21:23:08: Instrument scale factors ..: unity  
197 - 2015-12-07T21:23:08: Observation identifiers ...: all  
198 - 2015-12-07T21:23:08: Model type ................: PointSource  
199 - 2015-12-07T21:23:08: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
200 - 2015-12-07T21:23:08: Number of parameters ......: 6  
201 - 2015-12-07T21:23:08: Number of spatial par's ...: 2  
202 - 2015-12-07T21:23:08: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
203 - 2015-12-07T21:23:08: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
204 - 2015-12-07T21:23:08: Number of spectral par's ..: 3  
205 - 2015-12-07T21:23:08: Prefactor ................: 5.78382e-16 +/- 7.27218e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
206 - 2015-12-07T21:23:08: Index ....................: -2.5314 +/- 0.0112546 [-0,-5] (free,scale=-1,gradient)  
207 - 2015-12-07T21:23:08: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
208 - 2015-12-07T21:23:08: Number of temporal par's ..: 1  
209 - 2015-12-07T21:23:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)  
210 - 2015-12-07T21:23:08: === GCTAModelIrfBackground ===  
211 - 2015-12-07T21:23:08: Name ......................: CTABackgroundModel  
212 - 2015-12-07T21:23:08: Instruments ...............: CTA  
213 - 2015-12-07T21:23:08: Instrument scale factors ..: unity  
214 - 2015-12-07T21:23:08: Observation identifiers ...: all  
215 - 2015-12-07T21:23:08: Model type ................: "PowerLaw" * "Constant"  
216 - 2015-12-07T21:23:08: Number of parameters ......: 4  
217 - 2015-12-07T21:23:08: Number of spectral par's ..: 3  
218 - 2015-12-07T21:23:08: Prefactor ................: 1.0008 +/- 0.00839192 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)  
219 - 2015-12-07T21:23:08: Index ....................: 0.0102998 +/- 0.0051965 [-5,5] (free,scale=1,gradient)  
220 - 2015-12-07T21:23:08: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
221 - 2015-12-07T21:23:08: Number of temporal par's ..: 1  
222 - 2015-12-07T21:23:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 173 + 2016-06-29T19:14:38: +=========================================+
  174 + 2016-06-29T19:14:38: | Maximum likelihood optimisation results |
  175 + 2016-06-29T19:14:38: +=========================================+
  176 + 2016-06-29T19:14:38: === GOptimizerLM ===
  177 + 2016-06-29T19:14:38: Optimized function value ..: 309352.157
  178 + 2016-06-29T19:14:38: Absolute precision ........: 0.005
  179 + 2016-06-29T19:14:38: Acceptable value decrease .: 2
  180 + 2016-06-29T19:14:38: Optimization status .......: converged
  181 + 2016-06-29T19:14:38: Number of parameters ......: 10
  182 + 2016-06-29T19:14:38: Number of free parameters .: 4
  183 + 2016-06-29T19:14:38: Number of iterations ......: 2
  184 + 2016-06-29T19:14:38: Lambda ....................: 1e-05
  185 + 2016-06-29T19:14:38: Maximum log likelihood ....: -309352.157
  186 + 2016-06-29T19:14:38: Observed events (Nobs) ...: 46028.000
  187 + 2016-06-29T19:14:38: Predicted events (Npred) ..: 46027.996 (Nobs - Npred = 0.00423575)
  188 + 2016-06-29T19:14:38: === GModels ===
  189 + 2016-06-29T19:14:38: Number of models ..........: 2
  190 + 2016-06-29T19:14:38: Number of parameters ......: 10
  191 + 2016-06-29T19:14:38: === GModelSky ===
  192 + 2016-06-29T19:14:38: Name ......................: Crab
  193 + 2016-06-29T19:14:38: Instruments ...............: all
  194 + 2016-06-29T19:14:38: Instrument scale factors ..: unity
  195 + 2016-06-29T19:14:38: Observation identifiers ...: all
  196 + 2016-06-29T19:14:38: Model type ................: PointSource
  197 + 2016-06-29T19:14:38: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  198 + 2016-06-29T19:14:38: Number of parameters ......: 6
  199 + 2016-06-29T19:14:38: Number of spatial par's ...: 2
  200 + 2016-06-29T19:14:38: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  201 + 2016-06-29T19:14:38: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  202 + 2016-06-29T19:14:38: Number of spectral par's ..: 3
  203 + 2016-06-29T19:14:38: Prefactor ................: 5.7909e-16 +/- 7.3315e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  204 + 2016-06-29T19:14:38: Index ....................: -2.47181 +/- 0.0109973 [-0,-5] (free,scale=-1,gradient)
  205 + 2016-06-29T19:14:38: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  206 + 2016-06-29T19:14:38: Number of temporal par's ..: 1
  207 + 2016-06-29T19:14:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  208 + 2016-06-29T19:14:38: === GCTAModelIrfBackground ===
  209 + 2016-06-29T19:14:38: Name ......................: CTABackgroundModel
  210 + 2016-06-29T19:14:38: Instruments ...............: CTA
  211 + 2016-06-29T19:14:38: Instrument scale factors ..: unity
  212 + 2016-06-29T19:14:38: Observation identifiers ...: all
  213 + 2016-06-29T19:14:38: Model type ................: "PowerLaw" * "Constant"
  214 + 2016-06-29T19:14:38: Number of parameters ......: 4
  215 + 2016-06-29T19:14:38: Number of spectral par's ..: 3
  216 + 2016-06-29T19:14:38: Prefactor ................: 1.01608 +/- 0.0084739 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  217 + 2016-06-29T19:14:38: Index ....................: 0.00524546 +/- 0.00516392 [-5,5] (free,scale=1,gradient)
  218 + 2016-06-29T19:14:38: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  219 + 2016-06-29T19:14:38: Number of temporal par's ..: 1
  220 + 2016-06-29T19:14:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
223 221
224 The log file indicates that the fit converged quickly, the spectral 222 The log file indicates that the fit converged quickly, the spectral
225 parameters of the Crab nebula have now been constrained using the events 223 parameters of the Crab nebula have now been constrained using the events
@@ -233,7 +231,7 @@ data from multiple observations should be combined.** @@ -233,7 +231,7 @@ data from multiple observations should be combined.**
233 231
234 Combining observations is not limited to unbinned data (i.e. event lists) 232 Combining observations is not limited to unbinned data (i.e. event lists)
235 but may also be applied to binned data (i.e. counts cubes). 233 but may also be applied to binned data (i.e. counts cubes).
236 -Using :ref:`ctbin` we can create counts cubes from both event lists which 234 +Using :ref:`ctbin` you can create counts cubes from both event lists which
237 may then be combined in an observation definition XML file: 235 may then be combined in an observation definition XML file:
238 236
239 .. code-block:: xml 237 .. code-block:: xml
doc/source/users/user_manual/getting_started/beyond_irf.rst
@@ -3,17 +3,17 @@ @@ -3,17 +3,17 @@
3 Connecting observations to dedicated instrument response functions 3 Connecting observations to dedicated instrument response functions
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 -So far the same instrument response function has been used for all  
7 -observations in our analysis examples.  
8 -You may have recognised that we always specified the calibration database  
9 -``prod2`` and the instrument response function ``South_0.5h`` that  
10 -are shipped with ctools. 6 +So far you used the same instrument response function for all observations.
  7 +You always specified the calibration database ``prod2`` and the instrument
  8 +response function ``South_0.5h`` that are shipped with ctools in all
  9 +examples.
11 When combining multiple observations in a joint analysis you may however 10 When combining multiple observations in a joint analysis you may however
12 need to specify dedicated instrument response functions for the 11 need to specify dedicated instrument response functions for the
13 different observations. 12 different observations.
14 13
15 -Let's simulate two observations of the Crab nebula, one done with  
16 -the northern array and the other with the southern array: 14 +To illustrate how you can do this, let's simulate two observations of the
  15 +Crab nebula, one done with the northern array and the other with the southern
  16 +array:
17 17
18 .. code-block:: bash 18 .. code-block:: bash
19 19
@@ -70,26 +70,26 @@ option to get the output of the script on the console): @@ -70,26 +70,26 @@ option to get the output of the script on the console):
70 70
71 .. code-block:: bash 71 .. code-block:: bash
72 72
73 - $ cscaldb debug=yes  
74 - Parfile cscaldb.par not found. Create default parfile.  
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 73 + $ cscaldb debug=yes
  74 + 2016-06-29T20:09:44: +============+
  75 + 2016-06-29T20:09:44: | Parameters |
  76 + 2016-06-29T20:09:44: +============+
  77 + 2016-06-29T20:09:44: chatter ...................: 2
  78 + 2016-06-29T20:09:44: clobber ...................: yes
  79 + 2016-06-29T20:09:44: debug .....................: yes
  80 + 2016-06-29T20:09:44: mode ......................: ql
  81 + 2016-06-29T20:09:44: logfile ...................: cscaldb.log
  82 + 2016-06-29T20:09:44:
  83 + 2016-06-29T20:09:44: +==============+
  84 + 2016-06-29T20:09:44: | Mission: cta |
  85 + 2016-06-29T20:09:44: +==============+
  86 + 2016-06-29T20:09:44: === Response functions in database "prod2" ===
  87 + 2016-06-29T20:09:44: North_0.5h
  88 + 2016-06-29T20:09:44: North_50h
  89 + 2016-06-29T20:09:44: North_5h
  90 + 2016-06-29T20:09:44: South_0.5h
  91 + 2016-06-29T20:09:44: South_50h
  92 + 2016-06-29T20:09:44: South_5h
93 93
94 You will see that ctools ships with one database for the CTA observatory. 94 You will see that ctools ships with one database for the CTA observatory.
95 This is the ``prod2`` database. 95 This is the ``prod2`` database.
@@ -101,7 +101,7 @@ You now jointly fit both observations using :ref:`ctlike`: @@ -101,7 +101,7 @@ You now jointly fit both observations using :ref:`ctlike`:
101 101
102 .. code-block:: bash 102 .. code-block:: bash
103 103
104 - $ ctlike chatter=3 104 + $ ctlike chatter=3
105 Input event list, counts cube or observation definition XML file [events.fits] obs_irf.xml 105 Input event list, counts cube or observation definition XML file [events.fits] obs_irf.xml
106 Input model XML file [$CTOOLS/share/models/crab.xml] 106 Input model XML file [$CTOOLS/share/models/crab.xml]
107 Output model XML file [crab_results.xml] 107 Output model XML file [crab_results.xml]
@@ -113,122 +113,95 @@ You will notice that each observation now has a specific response @@ -113,122 +113,95 @@ You will notice that each observation now has a specific response
113 function and that the filename of the response information differs for 113 function and that the filename of the response information differs for
114 both observations. 114 both observations.
115 115
116 -.. code-block:: xml  
117 -  
118 - 2015-12-07T22:22:18: +==============+  
119 - 2015-12-07T22:22:18: | Observations |  
120 - 2015-12-07T22:22:18: +==============+  
121 - 2015-12-07T22:22:18: === GObservations ===  
122 - 2015-12-07T22:22:18: Number of observations ....: 2  
123 - 2015-12-07T22:22:18: Number of models ..........: 2  
124 - 2015-12-07T22:22:18: Number of predicted events : 0  
125 - 2015-12-07T22:22:18: === GCTAObservation ===  
126 - 2015-12-07T22:22:18: Name ......................: Crab  
127 - 2015-12-07T22:22:18: Identifier ................: 00001  
128 - 2015-12-07T22:22:18: Instrument ................: CTA  
129 - 2015-12-07T22:22:18: Event file ................: north.fits  
130 - 2015-12-07T22:22:18: Event type ................: EventList  
131 - 2015-12-07T22:22:18: Statistics ................: Poisson  
132 - 2015-12-07T22:22:18: Ontime ....................: 1800 s  
133 - 2015-12-07T22:22:18: Livetime ..................: 1710 s  
134 - 2015-12-07T22:22:18: Deadtime correction .......: 0.95  
135 - 2015-12-07T22:22:18: User energy range .........: undefined  
136 - 2015-12-07T22:22:18: === GCTAPointing ===  
137 - 2015-12-07T22:22:18: Pointing direction ........: (RA,Dec)=(83.63,21.51)  
138 - 2015-12-07T22:22:18: === GCTAResponseIrf ===  
139 - 2015-12-07T22:22:18: Caldb mission .............: cta  
140 - 2015-12-07T22:22:18: Caldb instrument ..........: prod2  
141 - 2015-12-07T22:22:18: Response name .............: North_0.5h  
142 - 2015-12-07T22:22:18: Energy dispersion .........: Not used  
143 - 2015-12-07T22:22:18: Save energy range .........: undefined  
144 - 2015-12-07T22:22:18: === GCTAEventList ===  
145 - 2015-12-07T22:22:18: Number of events ..........: 8469  
146 - 2015-12-07T22:22:18: Time interval .............: 51544.5 - 51544.5 days  
147 - 2015-12-07T22:22:18: Energy interval ...........: 0.1 - 100 TeV  
148 - 2015-12-07T22:22:18: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg  
149 - 2015-12-07T22:22:18: === GCTAObservation ===  
150 - 2015-12-07T22:22:18: Name ......................: Crab  
151 - 2015-12-07T22:22:18: Identifier ................: 00002  
152 - 2015-12-07T22:22:18: Instrument ................: CTA  
153 - 2015-12-07T22:22:18: Event file ................: south.fits  
154 - 2015-12-07T22:22:18: Event type ................: EventList  
155 - 2015-12-07T22:22:18: Statistics ................: Poisson  
156 - 2015-12-07T22:22:18: Ontime ....................: 1800 s  
157 - 2015-12-07T22:22:18: Livetime ..................: 1710 s  
158 - 2015-12-07T22:22:18: Deadtime correction .......: 0.95  
159 - 2015-12-07T22:22:18: User energy range .........: undefined  
160 - 2015-12-07T22:22:18: === GCTAPointing ===  
161 - 2015-12-07T22:22:18: Pointing direction ........: (RA,Dec)=(83.63,22.51)  
162 - 2015-12-07T22:22:18: === GCTAResponseIrf ===  
163 - 2015-12-07T22:22:18: Caldb mission .............: cta  
164 - 2015-12-07T22:22:18: Caldb instrument ..........: prod2  
165 - 2015-12-07T22:22:18: Response name .............: South_0.5h  
166 - 2015-12-07T22:22:18: Energy dispersion .........: Not used  
167 - 2015-12-07T22:22:18: Save energy range .........: undefined  
168 - 2015-12-07T22:22:18: === GCTAEventList ===  
169 - 2015-12-07T22:22:18: Number of events ..........: 22529  
170 - 2015-12-07T22:22:18: Time interval .............: 51544.5 - 51544.5 days  
171 - 2015-12-07T22:22:18: Energy interval ...........: 0.1 - 100 TeV  
172 - 2015-12-07T22:22:18: Region of interest ........: RA=83.63, DEC=22.51 [0,0] Radius=5 deg 116 +.. code-block:: none
  117 +
  118 + 2016-06-29T20:10:29: +==============+
  119 + 2016-06-29T20:10:29: | Observations |
  120 + 2016-06-29T20:10:29: +==============+
  121 + 2016-06-29T20:10:29: === GObservations ===
  122 + 2016-06-29T20:10:29: Number of observations ....: 2
  123 + 2016-06-29T20:10:29: Number of models ..........: 2
  124 + 2016-06-29T20:10:29: Number of observed events .: 31270
  125 + 2016-06-29T20:10:29: Number of predicted events : 0
  126 + 2016-06-29T20:10:29: === GCTAObservation ===
  127 + 2016-06-29T20:10:29: Name ......................: Crab
  128 + 2016-06-29T20:10:29: Identifier ................: 00001
173 ... 129 ...
174 - 2015-12-07T22:22:18: +=================================+  
175 - 2015-12-07T22:22:18: | Maximum likelihood optimisation |  
176 - 2015-12-07T22:22:18: +=================================+  
177 - 2015-12-07T22:22:18: >Iteration 0: -logL=214691.468, Lambda=1.0e-03  
178 - 2015-12-07T22:22:18: >Iteration 1: -logL=214679.380, Lambda=1.0e-03, delta=12.088, max(|grad|)=9.713100 [Index:3]  
179 - 2015-12-07T22:22:18: >Iteration 2: -logL=214679.365, Lambda=1.0e-04, delta=0.015, max(|grad|)=0.092975 [Index:3]  
180 - 2015-12-07T22:22:18: >Iteration 3: -logL=214679.365, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.000749 [Index:3] 130 + 2016-06-29T20:10:29: === GCTAResponseIrf ===
  131 + 2016-06-29T20:10:29: Caldb mission .............: cta
  132 + 2016-06-29T20:10:29: Caldb instrument ..........: prod2
  133 + 2016-06-29T20:10:29: Response name .............: North_0.5h
  134 + 2016-06-29T20:10:29: Energy dispersion .........: Not used
  135 + 2016-06-29T20:10:29: Save energy range .........: undefined
181 ... 136 ...
182 - 2015-12-07T22:22:18: +=========================================+  
183 - 2015-12-07T22:22:18: | Maximum likelihood optimisation results |  
184 - 2015-12-07T22:22:18: +=========================================+  
185 - 2015-12-07T22:22:18: === GOptimizerLM ===  
186 - 2015-12-07T22:22:18: Optimized function value ..: 214679.365  
187 - 2015-12-07T22:22:18: Absolute precision ........: 0.005  
188 - 2015-12-07T22:22:18: Acceptable value decrease .: 2  
189 - 2015-12-07T22:22:18: Optimization status .......: converged  
190 - 2015-12-07T22:22:18: Number of parameters ......: 10  
191 - 2015-12-07T22:22:18: Number of free parameters .: 4  
192 - 2015-12-07T22:22:18: Number of iterations ......: 3  
193 - 2015-12-07T22:22:18: Lambda ....................: 1e-06  
194 - 2015-12-07T22:22:18: Maximum log likelihood ....: -214679.365  
195 - 2015-12-07T22:22:18: Observed events (Nobs) ...: 30998.000  
196 - 2015-12-07T22:22:18: Predicted events (Npred) ..: 30998.000 (Nobs - Npred = 1.02755e-06)  
197 - 2015-12-07T22:22:18: === GModels ===  
198 - 2015-12-07T22:22:18: Number of models ..........: 2  
199 - 2015-12-07T22:22:18: Number of parameters ......: 10  
200 - 2015-12-07T22:22:18: === GModelSky ===  
201 - 2015-12-07T22:22:18: Name ......................: Crab  
202 - 2015-12-07T22:22:18: Instruments ...............: all  
203 - 2015-12-07T22:22:18: Instrument scale factors ..: unity  
204 - 2015-12-07T22:22:18: Observation identifiers ...: all  
205 - 2015-12-07T22:22:18: Model type ................: PointSource  
206 - 2015-12-07T22:22:18: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
207 - 2015-12-07T22:22:18: Number of parameters ......: 6  
208 - 2015-12-07T22:22:18: Number of spatial par's ...: 2  
209 - 2015-12-07T22:22:18: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
210 - 2015-12-07T22:22:18: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
211 - 2015-12-07T22:22:18: Number of spectral par's ..: 3  
212 - 2015-12-07T22:22:18: Prefactor ................: 5.81237e-16 +/- 8.63534e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
213 - 2015-12-07T22:22:18: Index ....................: -2.53954 +/- 0.0137432 [-0,-5] (free,scale=-1,gradient)  
214 - 2015-12-07T22:22:18: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
215 - 2015-12-07T22:22:18: Number of temporal par's ..: 1  
216 - 2015-12-07T22:22:18: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)  
217 - 2015-12-07T22:22:18: === GCTAModelIrfBackground ===  
218 - 2015-12-07T22:22:18: Name ......................: CTABackgroundModel  
219 - 2015-12-07T22:22:18: Instruments ...............: CTA  
220 - 2015-12-07T22:22:18: Instrument scale factors ..: unity  
221 - 2015-12-07T22:22:18: Observation identifiers ...: all  
222 - 2015-12-07T22:22:18: Model type ................: "PowerLaw" * "Constant"  
223 - 2015-12-07T22:22:18: Number of parameters ......: 4  
224 - 2015-12-07T22:22:18: Number of spectral par's ..: 3  
225 - 2015-12-07T22:22:18: Prefactor ................: 1.01067 +/- 0.0103997 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)  
226 - 2015-12-07T22:22:18: Index ....................: 0.0135414 +/- 0.0064452 [-5,5] (free,scale=1,gradient)  
227 - 2015-12-07T22:22:18: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
228 - 2015-12-07T22:22:18: Number of temporal par's ..: 1  
229 - 2015-12-07T22:22:18: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)  
230 -  
231 -A more fine grained control over the response function can be achieved by 137 + 2016-06-29T20:10:29: === GCTAObservation ===
  138 + 2016-06-29T20:10:29: Name ......................: Crab
  139 + 2016-06-29T20:10:29: Identifier ................: 00002
  140 + ...
  141 + 2016-06-29T20:10:29: === GCTAResponseIrf ===
  142 + 2016-06-29T20:10:29: Caldb mission .............: cta
  143 + 2016-06-29T20:10:29: Caldb instrument ..........: prod2
  144 + 2016-06-29T20:10:29: Response name .............: South_0.5h
  145 + 2016-06-29T20:10:29: Energy dispersion .........: Not used
  146 + 2016-06-29T20:10:29: Save energy range .........: undefined
  147 + ...
  148 + 2016-06-29T20:10:29: +=================================+
  149 + 2016-06-29T20:10:29: | Maximum likelihood optimisation |
  150 + 2016-06-29T20:10:29: +=================================+
  151 + 2016-06-29T20:10:30: >Iteration 0: -logL=216208.923, Lambda=1.0e-03
  152 + 2016-06-29T20:10:30: >Iteration 1: -logL=216207.021, Lambda=1.0e-03, delta=1.902, max(|grad|)=4.436064 [Index:7]
  153 + 2016-06-29T20:10:30: >Iteration 2: -logL=216207.021, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.012146 [Index:7]
  154 + ...
  155 + 2016-06-29T20:10:30: +=========================================+
  156 + 2016-06-29T20:10:30: | Maximum likelihood optimisation results |
  157 + 2016-06-29T20:10:30: +=========================================+
  158 + 2016-06-29T20:10:30: === GOptimizerLM ===
  159 + 2016-06-29T20:10:30: Optimized function value ..: 216207.021
  160 + 2016-06-29T20:10:30: Absolute precision ........: 0.005
  161 + 2016-06-29T20:10:30: Acceptable value decrease .: 2
  162 + 2016-06-29T20:10:30: Optimization status .......: converged
  163 + 2016-06-29T20:10:30: Number of parameters ......: 10
  164 + 2016-06-29T20:10:30: Number of free parameters .: 4
  165 + 2016-06-29T20:10:30: Number of iterations ......: 2
  166 + 2016-06-29T20:10:30: Lambda ....................: 1e-05
  167 + 2016-06-29T20:10:30: Maximum log likelihood ....: -216207.021
  168 + 2016-06-29T20:10:30: Observed events (Nobs) ...: 31270.000
  169 + 2016-06-29T20:10:30: Predicted events (Npred) ..: 31269.998 (Nobs - Npred = 0.00190254)
  170 + 2016-06-29T20:10:30: === GModels ===
  171 + 2016-06-29T20:10:30: Number of models ..........: 2
  172 + 2016-06-29T20:10:30: Number of parameters ......: 10
  173 + 2016-06-29T20:10:30: === GModelSky ===
  174 + 2016-06-29T20:10:30: Name ......................: Crab
  175 + 2016-06-29T20:10:30: Instruments ...............: all
  176 + 2016-06-29T20:10:30: Instrument scale factors ..: unity
  177 + 2016-06-29T20:10:30: Observation identifiers ...: all
  178 + 2016-06-29T20:10:30: Model type ................: PointSource
  179 + 2016-06-29T20:10:30: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  180 + 2016-06-29T20:10:30: Number of parameters ......: 6
  181 + 2016-06-29T20:10:30: Number of spatial par's ...: 2
  182 + 2016-06-29T20:10:30: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  183 + 2016-06-29T20:10:30: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  184 + 2016-06-29T20:10:30: Number of spectral par's ..: 3
  185 + 2016-06-29T20:10:30: Prefactor ................: 5.7247e-16 +/- 8.64521e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  186 + 2016-06-29T20:10:30: Index ....................: -2.46519 +/- 0.013273 [-0,-5] (free,scale=-1,gradient)
  187 + 2016-06-29T20:10:30: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  188 + 2016-06-29T20:10:30: Number of temporal par's ..: 1
  189 + 2016-06-29T20:10:30: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  190 + 2016-06-29T20:10:30: === GCTAModelIrfBackground ===
  191 + 2016-06-29T20:10:30: Name ......................: CTABackgroundModel
  192 + 2016-06-29T20:10:30: Instruments ...............: CTA
  193 + 2016-06-29T20:10:30: Instrument scale factors ..: unity
  194 + 2016-06-29T20:10:30: Observation identifiers ...: all
  195 + 2016-06-29T20:10:30: Model type ................: "PowerLaw" * "Constant"
  196 + 2016-06-29T20:10:30: Number of parameters ......: 4
  197 + 2016-06-29T20:10:30: Number of spectral par's ..: 3
  198 + 2016-06-29T20:10:30: Prefactor ................: 1.01522 +/- 0.0104442 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  199 + 2016-06-29T20:10:30: Index ....................: 0.00802507 +/- 0.00643391 [-5,5] (free,scale=1,gradient)
  200 + 2016-06-29T20:10:30: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  201 + 2016-06-29T20:10:30: Number of temporal par's ..: 1
  202 + 2016-06-29T20:10:30: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  203 +
  204 +You can have a more fine grained control over the response function by
232 specifying individual filenames for the various response components. 205 specifying individual filenames for the various response components.
233 An example for an observation definition XML file is shown below. 206 An example for an observation definition XML file is shown below.
234 This is definitely expert mode, to be used with utmost care. 207 This is definitely expert mode, to be used with utmost care.
@@ -265,12 +238,14 @@ file is given below: @@ -265,12 +238,14 @@ file is given below:
265 <parameter name="CountsCube" file="cntcube1.fits"/> 238 <parameter name="CountsCube" file="cntcube1.fits"/>
266 <parameter name="ExposureCube" file="expcube1.fits"/> 239 <parameter name="ExposureCube" file="expcube1.fits"/>
267 <parameter name="PsfCube" file="psfcube1.fits"/> 240 <parameter name="PsfCube" file="psfcube1.fits"/>
  241 + <parameter name="EdispCube" file="edispcube1.fits"/>
268 <parameter name="BkgCube" file="bkgcube1.fits"/> 242 <parameter name="BkgCube" file="bkgcube1.fits"/>
269 </observation> 243 </observation>
270 <observation name="Crab" id="00002" instrument="CTA"> 244 <observation name="Crab" id="00002" instrument="CTA">
271 <parameter name="CountsCube" file="cntcube2.fits"/> 245 <parameter name="CountsCube" file="cntcube2.fits"/>
272 <parameter name="ExposureCube" file="expcube2.fits"/> 246 <parameter name="ExposureCube" file="expcube2.fits"/>
273 <parameter name="PsfCube" file="psfcube2.fits"/> 247 <parameter name="PsfCube" file="psfcube2.fits"/>
  248 + <parameter name="EdispCube" file="edispcube2.fits"/>
274 <parameter name="BkgCube" file="bkgcube2.fits"/> 249 <parameter name="BkgCube" file="bkgcube2.fits"/>
275 </observation> 250 </observation>
276 </observation_list> 251 </observation_list>
doc/source/users/user_manual/getting_started/beyond_residual.rst
@@ -48,8 +48,8 @@ The :ref:`csresmap` script is then used as follows: @@ -48,8 +48,8 @@ The :ref:`csresmap` script is then used as follows:
48 Output residual map file [resmap.fits] 48 Output residual map file [resmap.fits]
49 Residual map computation algorithm (SUB|SUBDIV|SUBDIVSQRT) [SUBDIV] 49 Residual map computation algorithm (SUB|SUBDIV|SUBDIVSQRT) [SUBDIV]
50 50
51 -In our example, the map will cover a field of 4 x 4 degrees centred on the  
52 -Crab nebula at a pixel scale of 0.02 degrees per pixel. 51 +In our example, the map will cover a field of 4° x 4° centred on the
  52 +Crab nebula at a pixel scale of 0.02° per pixel.
53 The resulting residual map ``resmap.fits``, smoothed with a Gaussian 53 The resulting residual map ``resmap.fits``, smoothed with a Gaussian
54 kernel of 3 pixels to enhance features, is shown in the following figure. 54 kernel of 3 pixels to enhance features, is shown in the following figure.
55 Obviously, the map is free from any significant residuals. 55 Obviously, the map is free from any significant residuals.
@@ -58,5 +58,5 @@ Obviously, the map is free from any significant residuals. @@ -58,5 +58,5 @@ Obviously, the map is free from any significant residuals.
58 :height: 400px 58 :height: 400px
59 :align: center 59 :align: center
60 60
61 - *Residual map of the Crab region* 61 + *Residual map of the Crab nebula region*
62 62
doc/source/users/user_manual/getting_started/beyond_stacked.rst
@@ -29,17 +29,20 @@ into a single counts cube: @@ -29,17 +29,20 @@ into a single counts cube:
29 Output counts cube file [cntcube.fits] 29 Output counts cube file [cntcube.fits]
30 30
31 You now have a stacked counts cube ``cntcube.fits`` on disk. 31 You now have a stacked counts cube ``cntcube.fits`` on disk.
32 -Before you can use that counts cube in a maximum likelihood  
33 -analysis, you have to compute the instrument response and the  
34 -background model that are needed to describe the stacked data.  
35 -  
36 -For the former, you have to compute the total exposure for the stacked  
37 -cube (i.e. the sum of the effective areas for each observation multiplied  
38 -by the corresponding livetimes) and an effective point spread function  
39 -(i.e. the point spread function of the different observations weighted by  
40 -the corresponding exposures).  
41 -To get both informations you use the :ref:`ctexpcube` and  
42 -:ref:`ctpsfcube` tools: 32 +Before you can use that counts cube in a maximum likelihood analysis, you have
  33 +to compute the instrument response function and the background model that is
  34 +needed for the analysis.
  35 +
  36 +For the instrument response function, you have to compute the total exposure
  37 +for the stacked cube (i.e. the sum of the effective areas for each observation
  38 +multiplied by the corresponding livetimes) and an effective point spread
  39 +function (i.e. the point spread function of the different observations
  40 +weighted by the corresponding exposures).
  41 +Optionally, you can also compute an effective energy dispersion (i.e. the
  42 +energy dispersion of the different observations weighted by the corresponding
  43 +exposures).
  44 +To get these informations you use the :ref:`ctexpcube`, :ref:`ctpsfcube` and
  45 +:ref:`ctedispcube` tools:
43 46
44 .. code-block:: bash 47 .. code-block:: bash
45 48
@@ -69,22 +72,47 @@ To get both informations you use the :ref:`ctexpcube` and @@ -69,22 +72,47 @@ To get both informations you use the :ref:`ctexpcube` and
69 Number of energy bins [20] 72 Number of energy bins [20]
70 Output PSF cube file [psfcube.fits] 73 Output PSF cube file [psfcube.fits]
71 74
72 -The ``obs.xml`` file has been provided on input to specify for both tools  
73 -which observations have been combined.  
74 -You further provided the counts cube on input so that :ref:`ctexpcube` can  
75 -read the cub definition from that file and apply it to the exposure cube.  
76 -This is a trick to reduce the number of user parameters that you need to  
77 -provide.  
78 -  
79 -You do not apply this trick when using :ref:`ctpsfcube` as this  
80 -would lead to a hugh output file owing to the fine spatial  
81 -pixelisation of the counts cube.  
82 -Such a fine binning is not needed for the PSF cube, as the PSF evolves  
83 -only slowly over the field of view.  
84 -It is thus sufficient to compute a PSF cube with a rather coarse spatial  
85 -binning; here you used a spatial binning of 1 degree covering a grid of  
86 -10 x 10 degrees. 75 +.. code-block:: bash
  76 +
  77 + $ ctedispcube
  78 + Input event list or observation definition XML file [NONE] obs.xml
  79 + Calibration database [prod2]
  80 + Instrument response function [South_0.5h]
  81 + Input counts cube file to extract energy dispersion cube definition [NONE]
  82 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63]
  83 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01]
  84 + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR]
  85 + Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
  86 + Image scale (in degrees/pixel) [1.0]
  87 + Size of the X axis in pixels [10]
  88 + Size of the Y axis in pixels [10]
  89 + Lower energy limit (TeV) [0.1]
  90 + Upper energy limit (TeV) [100.0]
  91 + Number of energy bins [20]
  92 + Output energy dispersion cube file [edispcube.fits]
  93 +
  94 +.. note::
  95 +
  96 + You may have noticed that for :ref:`ctexpcube` you provided an input counts
  97 + cube, while for the other tools you specified ``NONE``.
  98 + By providing an input counts cube you instructed :ref:`ctexpcube` to
  99 + extract the definition of the exposure cube from the counts cube. This is
  100 + a convenient trick to reduce the number of user parameters that you need
  101 + to specify. You did however not apply this trick for
  102 + :ref:`ctpsfcube` and :ref:`ctedispcube`. In fact, the point spread function
  103 + and energy dispersion do not vary significantly on spatial scales of 0.02°,
  104 + and using the counts cube definition for these cubes would lead to large
  105 + response cube files with a spatial precision that is actually not needed
  106 + (the point spread function and energy dispersion cubes are actually
  107 + 4-dimensional data cubes, hence their size increases quickly for a large
  108 + number of spatial pixels). Therefore, you have specified a larger image
  109 + scale of 1° for both cubes and only a small number of 10x10 spatial pixels,
  110 + leading to point spread function and energy dispersion cubes of modest size
  111 + (a few MB).
87 112
  113 +You provided the ``obs.xml`` file that defines all observations on input
  114 +so that the tools know which observations were combined in the :ref:`ctbin`
  115 +run.
88 As final step of the analysis preparation, you need to generate a 116 As final step of the analysis preparation, you need to generate a
89 background cube using the :ref:`ctbkgcube` tool: 117 background cube using the :ref:`ctbkgcube` tool:
90 118
@@ -100,13 +128,13 @@ background cube using the :ref:`ctbkgcube` tool: @@ -100,13 +128,13 @@ background cube using the :ref:`ctbkgcube` tool:
100 Output model XML file [NONE] model.xml 128 Output model XML file [NONE] model.xml
101 129
102 The usage of :ref:`ctbkgcube` is very similar to that of :ref:`ctexpcube`, 130 The usage of :ref:`ctbkgcube` is very similar to that of :ref:`ctexpcube`,
103 -yet it takes the model XML file as an additional input parameter. 131 +yet it takes the model definition XML file as an additional input parameter.
104 You used here the usual ``$CTOOLS/share/models/crab.xml`` model 132 You used here the usual ``$CTOOLS/share/models/crab.xml`` model
105 file that is shipped with the ctools. 133 file that is shipped with the ctools.
106 :ref:`ctbkgcube` provides on output the background cube file 134 :ref:`ctbkgcube` provides on output the background cube file
107 -``bkgcube.fits`` and the model XML file ``model.xml`` that can 135 +``bkgcube.fits`` and the model definition XML file ``model.xml`` that can
108 be used for further analysis. 136 be used for further analysis.
109 -Having a look at ``model.xml`` illustrates how the background 137 +Having a look at the ``model.xml`` file illustrates how the background
110 modelling works: 138 modelling works:
111 139
112 .. code-block:: xml 140 .. code-block:: xml
@@ -147,11 +175,10 @@ as an appropriate multiplicator to the background cube. @@ -147,11 +175,10 @@ as an appropriate multiplicator to the background cube.
147 .. note:: 175 .. note::
148 176
149 There is no constraint on providing the same spatial binning or 177 There is no constraint on providing the same spatial binning or
150 - the same energy binning for an exposure cube, a PSF cube,  
151 - a background cube and a counts cube.  
152 - ctools interpolates internally the exposure cube, PSF cube and  
153 - background cube values, hence any arbitrary appropriate binning may  
154 - be used. 178 + the same energy binning for an exposure cube, a PSF cube, an energy
  179 + dispersion cube, a background cube and a counts cube.
  180 + ctools interpolates internally all response cubes hence any arbitrary
  181 + appropriate binning may be used.
155 Using the same binning for the exposure cube, the background cube and 182 Using the same binning for the exposure cube, the background cube and
156 the counts cube is only a convenience. 183 the counts cube is only a convenience.
157 184
@@ -170,73 +197,86 @@ analysis using the :ref:`ctlike` tool: @@ -170,73 +197,86 @@ analysis using the :ref:`ctlike` tool:
170 197
171 :ref:`ctlike` recognises that a counts cube should be analysed and queries 198 :ref:`ctlike` recognises that a counts cube should be analysed and queries
172 for the exposure cube, the PSF cube, and the background cube file names. 199 for the exposure cube, the PSF cube, and the background cube file names.
173 -You specified here the names of the files produced by the :ref:`ctexpcube`,  
174 -the :ref:`ctpsfcube` and the :ref:`ctbkgcube` tools.  
175 -Furthermore you provided as model the ``model.xml`` file that has been  
176 -generated by the :ref:`ctbkgcube` tool.  
177 -  
178 -The log file of the :ref:`ctlike` run is shown below.  
179 -Note that the spectral model that is multiplied with the background  
180 -cube has a Prefactor of 0.998 +/- 0.011 and an Index of 0.006 +/- 0.007,  
181 -indicating a very small correction to the actual spectrum of the background  
182 -cube.  
183 -Real life situations may of course require larger correction factors. 200 +If you want to consider also the energy dispersion during the maximum likelihood
  201 +fitting you should pass the hidden ``edisp`` parameter to ctlike, and the tool
  202 +will also query of the energy dispersion cube:
184 203
185 -.. code-block:: xml 204 +.. code-block:: bash
  205 +
  206 + $ ctlike edisp=yes
  207 + Input event list, counts cube or observation definition XML file [cntcube.fits]
  208 + Input exposure cube file (only needed for stacked analysis) [expcube.fits]
  209 + Input PSF cube file (only needed for stacked analysis) [psfcube.fits]
  210 + Input background cube file (only needed for stacked analysis) [bkgcube.fits]
  211 + Input energy dispersion cube file (only needed for stacked analysis) [NONE] edispcube.fits
  212 + Input model XML file [model.xml]
  213 + Output model XML file [crab_results.xml]
  214 +
  215 +.. warning::
  216 +
  217 + The maximum likelihood computations including energy dispersion are
  218 + relatively time consuming, and in many situations the impact of the
  219 + energy dispersion on the analysis results will be very small. So make
  220 + sure that you really need energy dispersion before you are using it.
  221 +
  222 +The log file of the :ref:`ctlike` run (without energy dispersion) is shown
  223 +below.
  224 +
  225 +.. code-block:: none
186 226
187 - 2015-12-07T21:37:45: +=================================+  
188 - 2015-12-07T21:37:45: | Maximum likelihood optimisation |  
189 - 2015-12-07T21:37:45: +=================================+  
190 - 2015-12-07T21:37:46: >Iteration 0: -logL=83748.453, Lambda=1.0e-03  
191 - 2015-12-07T21:37:47: >Iteration 1: -logL=83736.039, Lambda=1.0e-03, delta=12.413, max(|grad|)=15.134616 [Index:3]  
192 - 2015-12-07T21:37:48: >Iteration 2: -logL=83736.021, Lambda=1.0e-04, delta=0.018, max(|grad|)=0.108613 [Index:3]  
193 - 2015-12-07T21:37:49: >Iteration 3: -logL=83736.021, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.000570 [Index:3] 227 + 2016-06-29T19:54:14: +=================================+
  228 + 2016-06-29T19:54:14: | Maximum likelihood optimisation |
  229 + 2016-06-29T19:54:14: +=================================+
  230 + 2016-06-29T19:54:15: >Iteration 0: -logL=83633.454, Lambda=1.0e-03
  231 + 2016-06-29T19:54:15: >Iteration 1: -logL=83561.979, Lambda=1.0e-03, delta=71.475, max(|grad|)=153.136163 [Index:7]
  232 + 2016-06-29T19:54:16: >Iteration 2: -logL=83561.823, Lambda=1.0e-04, delta=0.156, max(|grad|)=-0.183495 [Prefactor:6]
  233 + 2016-06-29T19:54:16: >Iteration 3: -logL=83561.823, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.003347 [Index:3]
194 ... 234 ...
195 - 2015-12-07T21:37:51: +=========================================+  
196 - 2015-12-07T21:37:51: | Maximum likelihood optimisation results |  
197 - 2015-12-07T21:37:51: +=========================================+  
198 - 2015-12-07T21:37:51: === GOptimizerLM ===  
199 - 2015-12-07T21:37:51: Optimized function value ..: 83736.021  
200 - 2015-12-07T21:37:51: Absolute precision ........: 0.005  
201 - 2015-12-07T21:37:51: Acceptable value decrease .: 2  
202 - 2015-12-07T21:37:51: Optimization status .......: converged  
203 - 2015-12-07T21:37:51: Number of parameters ......: 10  
204 - 2015-12-07T21:37:51: Number of free parameters .: 4  
205 - 2015-12-07T21:37:51: Number of iterations ......: 3  
206 - 2015-12-07T21:37:51: Lambda ....................: 1e-06  
207 - 2015-12-07T21:37:51: Maximum log likelihood ....: -83736.021  
208 - 2015-12-07T21:37:51: Observed events (Nobs) ...: 35198.000  
209 - 2015-12-07T21:37:51: Predicted events (Npred) ..: 35198.000 (Nobs - Npred = 7.6773e-07)  
210 - 2015-12-07T21:37:51: === GModels ===  
211 - 2015-12-07T21:37:51: Number of models ..........: 2  
212 - 2015-12-07T21:37:51: Number of parameters ......: 10  
213 - 2015-12-07T21:37:51: === GModelSky ===  
214 - 2015-12-07T21:37:51: Name ......................: Crab  
215 - 2015-12-07T21:37:51: Instruments ...............: all  
216 - 2015-12-07T21:37:51: Instrument scale factors ..: unity  
217 - 2015-12-07T21:37:51: Observation identifiers ...: all  
218 - 2015-12-07T21:37:51: Model type ................: PointSource  
219 - 2015-12-07T21:37:51: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
220 - 2015-12-07T21:37:51: Number of parameters ......: 6  
221 - 2015-12-07T21:37:51: Number of spatial par's ...: 2  
222 - 2015-12-07T21:37:51: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
223 - 2015-12-07T21:37:51: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
224 - 2015-12-07T21:37:51: Number of spectral par's ..: 3  
225 - 2015-12-07T21:37:51: Prefactor ................: 5.75289e-16 +/- 7.24749e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
226 - 2015-12-07T21:37:51: Index ....................: -2.53122 +/- 0.0113068 [-0,-5] (free,scale=-1,gradient)  
227 - 2015-12-07T21:37:51: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
228 - 2015-12-07T21:37:51: Number of temporal par's ..: 1  
229 - 2015-12-07T21:37:51: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)  
230 - 2015-12-07T21:37:51: === GCTAModelCubeBackground ===  
231 - 2015-12-07T21:37:51: Name ......................: BackgroundModel  
232 - 2015-12-07T21:37:51: Instruments ...............: CTA, HESS, MAGIC, VERITAS  
233 - 2015-12-07T21:37:51: Instrument scale factors ..: unity  
234 - 2015-12-07T21:37:51: Observation identifiers ...: all  
235 - 2015-12-07T21:37:51: Model type ................: "PowerLaw" * "Constant"  
236 - 2015-12-07T21:37:51: Number of parameters ......: 4  
237 - 2015-12-07T21:37:51: Number of spectral par's ..: 3  
238 - 2015-12-07T21:37:51: Prefactor ................: 0.998055 +/- 0.0114979 [0.01,100] ph/cm2/s/MeV (free,scale=1,gradient)  
239 - 2015-12-07T21:37:51: Index ....................: 0.00648796 +/- 0.00697365 [-5,5] (free,scale=1,gradient)  
240 - 2015-12-07T21:37:51: PivotEnergy ..............: 1e+06 MeV (fixed,scale=1e+06,gradient)  
241 - 2015-12-07T21:37:51: Number of temporal par's ..: 1  
242 - 2015-12-07T21:37:51: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 235 + 2016-06-29T19:54:17: +=========================================+
  236 + 2016-06-29T19:54:17: | Maximum likelihood optimisation results |
  237 + 2016-06-29T19:54:17: +=========================================+
  238 + 2016-06-29T19:54:17: === GOptimizerLM ===
  239 + 2016-06-29T19:54:17: Optimized function value ..: 83561.823
  240 + 2016-06-29T19:54:17: Absolute precision ........: 0.005
  241 + 2016-06-29T19:54:17: Acceptable value decrease .: 2
  242 + 2016-06-29T19:54:17: Optimization status .......: converged
  243 + 2016-06-29T19:54:17: Number of parameters ......: 10
  244 + 2016-06-29T19:54:17: Number of free parameters .: 4
  245 + 2016-06-29T19:54:17: Number of iterations ......: 3
  246 + 2016-06-29T19:54:17: Lambda ....................: 1e-06
  247 + 2016-06-29T19:54:17: Maximum log likelihood ....: -83561.823
  248 + 2016-06-29T19:54:17: Observed events (Nobs) ...: 35946.000
  249 + 2016-06-29T19:54:17: Predicted events (Npred) ..: 35946.000 (Nobs - Npred = 1.56502e-05)
  250 + 2016-06-29T19:54:17: === GModels ===
  251 + 2016-06-29T19:54:17: Number of models ..........: 2
  252 + 2016-06-29T19:54:17: Number of parameters ......: 10
  253 + 2016-06-29T19:54:17: === GModelSky ===
  254 + 2016-06-29T19:54:17: Name ......................: Crab
  255 + 2016-06-29T19:54:17: Instruments ...............: all
  256 + 2016-06-29T19:54:17: Instrument scale factors ..: unity
  257 + 2016-06-29T19:54:17: Observation identifiers ...: all
  258 + 2016-06-29T19:54:17: Model type ................: PointSource
  259 + 2016-06-29T19:54:17: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  260 + 2016-06-29T19:54:17: Number of parameters ......: 6
  261 + 2016-06-29T19:54:17: Number of spatial par's ...: 2
  262 + 2016-06-29T19:54:17: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  263 + 2016-06-29T19:54:17: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  264 + 2016-06-29T19:54:17: Number of spectral par's ..: 3
  265 + 2016-06-29T19:54:17: Prefactor ................: 5.70255e-16 +/- 7.24185e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  266 + 2016-06-29T19:54:17: Index ....................: -2.46568 +/- 0.0110458 [-0,-5] (free,scale=-1,gradient)
  267 + 2016-06-29T19:54:17: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  268 + 2016-06-29T19:54:17: Number of temporal par's ..: 1
  269 + 2016-06-29T19:54:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  270 + 2016-06-29T19:54:17: === GCTAModelCubeBackground ===
  271 + 2016-06-29T19:54:17: Name ......................: BackgroundModel
  272 + 2016-06-29T19:54:17: Instruments ...............: CTA, HESS, MAGIC, VERITAS
  273 + 2016-06-29T19:54:17: Instrument scale factors ..: unity
  274 + 2016-06-29T19:54:17: Observation identifiers ...: all
  275 + 2016-06-29T19:54:17: Model type ................: "PowerLaw" * "Constant"
  276 + 2016-06-29T19:54:17: Number of parameters ......: 4
  277 + 2016-06-29T19:54:17: Number of spectral par's ..: 3
  278 + 2016-06-29T19:54:17: Prefactor ................: 0.964885 +/- 0.0109395 [0.01,100] ph/cm2/s/MeV (free,scale=1,gradient)
  279 + 2016-06-29T19:54:17: Index ....................: 0.0220427 +/- 0.00686292 [-5,5] (free,scale=1,gradient)
  280 + 2016-06-29T19:54:17: PivotEnergy ..............: 1e+06 MeV (fixed,scale=1e+06,gradient)
  281 + 2016-06-29T19:54:17: Number of temporal par's ..: 1
  282 + 2016-06-29T19:54:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
doc/source/users/user_manual/getting_started/beyond_tsmap.rst
@@ -9,7 +9,7 @@ necessarily be the case. @@ -9,7 +9,7 @@ necessarily be the case.
9 You thus need a means to search for significant excess emission in your data. 9 You thus need a means to search for significant excess emission in your 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 do exactly that job.
13 13
14 The Test Statistic is defined as twice the log-likelihood difference 14 The Test Statistic is defined as twice the log-likelihood difference
15 between fitting a source at a given position on top of a model or fitting 15 between fitting a source at a given position on top of a model or fitting
@@ -20,14 +20,14 @@ exact relation depends somewhat on the formulation of the statistical @@ -20,14 +20,14 @@ exact relation depends somewhat on the formulation of the statistical
20 problem. 20 problem.
21 21
22 Here an example of how to apply the :ref:`cttsmap` tool to the two 22 Here an example of how to apply the :ref:`cttsmap` tool to the two
23 -simulated observations of the Crab in unbinned mode.  
24 -On input we provide a source model XML file and the name of the source 23 +simulated observations of the Crab nebula in unbinned mode.
  24 +On input you provide a source model XML file and the name of the source
25 in the XML file that should be moved on a grid of test positions. 25 in the XML file that should be moved on a grid of test positions.
26 This means that the position of the source given in the XML file is 26 This means that the position of the source given in the XML file is
27 in fact ignored and replaced by the grid positions that are defined by 27 in fact ignored and replaced by the grid positions that are defined by
28 the user parameters. 28 the user parameters.
29 -In the example we defined a grid of 10 x 10 positions around the  
30 -nominal position of the Crab nebula with a grid spacing of 0.02 degrees. 29 +In the example you defined a grid of 10 x 10 positions around the
  30 +nominal position of the Crab nebula with a grid spacing of 0.02°.
31 31
32 .. code-block:: bash 32 .. code-block:: bash
33 33
@@ -51,7 +51,7 @@ that contains one extension for the Test Statistic value and further @@ -51,7 +51,7 @@ that contains one extension for the Test Statistic value and further
51 extensions for the spectral parameters that have been fitted for the 51 extensions for the spectral parameters that have been fitted for the
52 source at each position of the grid. 52 source at each position of the grid.
53 The figure below show the Test Statistic map which reaches a maximum 53 The figure below show the Test Statistic map which reaches a maximum
54 -value of 40733 near the centre of the map. 54 +value of 42622 near the centre of the map.
55 55
56 .. figure:: tsmap-crab.png 56 .. figure:: tsmap-crab.png
57 :height: 400px 57 :height: 400px
@@ -61,7 +61,7 @@ value of 40733 near the centre of the map. @@ -61,7 +61,7 @@ value of 40733 near the centre of the map.
61 61
62 .. note:: 62 .. note::
63 63
64 - Alike :ref:`ctlike`, the :ref:`cttsmap` tool works either for unbinned, 64 + Similar to :ref:`ctlike` the :ref:`cttsmap` tool works either for unbinned,
65 binned or stacked analysis. On input it takes either a single event 65 binned or stacked analysis. On input it takes either a single event
66 list, a single counts cube, or an observation definition XML file that 66 list, a single counts cube, or an observation definition XML file that
67 allows a joint analysis of multiple observations. 67 allows a joint analysis of multiple observations.
doc/source/users/user_manual/getting_started/binning.rst
@@ -3,12 +3,11 @@ @@ -3,12 +3,11 @@
3 Binning CTA data 3 Binning CTA data
4 ~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~
5 5
6 -As next analysis step you will bin the data in a counts cube using 6 +As next analysis step you will bin the data into a counts cube using
7 :ref:`ctbin`. 7 :ref:`ctbin`.
8 -A counts cube is a 3 dimensional data cube, spanned by 8 +A counts cube is a 3-dimensional data cube, spanned by
9 Right Ascension (or Galactic longitude), Declination (or Galactic latitude), 9 Right Ascension (or Galactic longitude), Declination (or Galactic latitude),
10 -and energy (typically logarithmically spaced, but this is under user  
11 -control). 10 +and energy (by default logarithmically spaced, but this is under your control).
12 11
13 :ref:`ctbin` is executed by typing: 12 :ref:`ctbin` is executed by typing:
14 13
@@ -29,28 +28,37 @@ control). @@ -29,28 +28,37 @@ control).
29 Number of energy bins [20] 28 Number of energy bins [20]
30 Output counts cube file [cntcube.fits] 29 Output counts cube file [cntcube.fits]
31 30
32 -The counts cube will be centred on the location of the Crab (Right Ascension  
33 -83.63 degrees, Declination 22.01 degrees) and will be aligned in celestial  
34 -coordinates. A cartesian projection has been selected. The counts cube has  
35 -200 x 200 spatial pixels of 0.02 x 0.02 degrees in size, hence it covers a  
36 -total area of 4 x 4 degrees.  
37 -  
38 -The counts cube will contain 20 maps, which are logarithmically spaced  
39 -in energy, and which cover the energy range from 0.1 TeV to 100 TeV. In this  
40 -example, the counts cube will be saved as ``cntcube.fits`` in the working  
41 -directory. In addition to the counts cube, that is stored as the primary  
42 -image extension, the FITS file also contains an extension named ``EBOUNDS``  
43 -that defines the energy boundaries that were used, and an extension ``GTI``  
44 -that defines the Good Time Intervals that have been used. The following  
45 -image shows the resulting FITS file. The ``EBOUNDS`` table has 20 rows, one  
46 -for each energy bin, while the ``GTI`` table has just a single row, indicating  
47 -the start and stop time of the simulated data. 31 +In this example the events from file ``events.fits`` will be binned into
  32 +a counts cube stored into the file ``cntcube.fits``. The counts cube
  33 +is centred on the location of the Crab nebula (Right Ascension 83.63°,
  34 +Declination 22.01°). A cartesian projection aligned in celestial
  35 +coordinates is used and the counts cube has
  36 +200 x 200 spatial pixels of 0.02 x 0.02 degrees in size, covering
  37 +an area of 4° x 4°, and 20 logarithmically spaced energy bins, covering
  38 +an energy range from 0.1 TeV to 100 TeV.
  39 +
  40 +The ``cntcube.fits`` file produced by :ref:`ctbin` contains four extensions:
  41 +
  42 +* A primary 3-dimensional image extension providing the number of events
  43 + per counts cube bin,
  44 +* a 3-dimensional image extension ``WEIGHT`` where each bin gives the
  45 + fractional overlap between a counts cube bin and the Region of Interest
  46 + covered by the event list,
  47 +* a table extension ``EBOUNDS`` that defines the energy boundaries of the
  48 + counts cube, and
  49 +* a table extension ``GTI`` that defines the Good Time Intervals of the counts
  50 + cube.
  51 +
  52 +The following image shows the ``cntcube.fits`` file produced in the example
  53 +above. The ``EBOUNDS`` table has 20 rows, one for each energy bin, while the
  54 +``GTI`` table has just a single row, indicating the start and stop time of the
  55 +simulated data.
48 56
49 .. figure:: cntmap-fits.jpg 57 .. figure:: cntmap-fits.jpg
50 :width: 600px 58 :width: 600px
51 :align: center 59 :align: center
52 60
53 - *Counts cube FITS file* 61 + *Extensions of a counts cube FITS file*
54 62
55 63
56 An image of the first bin, covering the energy range 100 - 141 GeV, is 64 An image of the first bin, covering the energy range 100 - 141 GeV, is
@@ -60,24 +68,23 @@ shown below: @@ -60,24 +68,23 @@ shown below:
60 :height: 400px 68 :height: 400px
61 :align: center 69 :align: center
62 70
63 - *Counts cube for first energy bin* 71 + *Image of first energy bin of a counts cube*
64 72
65 For illustration, the last few lines of the log file ``ctbin.log`` are 73 For illustration, the last few lines of the log file ``ctbin.log`` are
66 reproduced below: 74 reproduced below:
67 75
68 -.. code-block:: xml  
69 -  
70 - 2015-12-07T20:52:41: +=================+  
71 - 2015-12-07T20:52:41: | Bin observation |  
72 - 2015-12-07T20:52:41: +=================+  
73 - 2015-12-07T20:52:41: === CTA observation ===  
74 - 2015-12-07T20:52:41: Events in list ............: 22685  
75 - 2015-12-07T20:52:41: Events in cube ............: 18195  
76 - 2015-12-07T20:52:41: Event bins outside RoI ....: 0  
77 - 2015-12-07T20:52:41: Events outside cube area ..: 4490  
78 - 2015-12-07T20:52:41: Events outside energy bins : 0  
79 -  
80 -From the 22685 events that have been simulated and stored in the  
81 -``events.fits`` file, 18195 lie within the cube boundaries and are thus put  
82 -into the resulting counts cube. The counts cube is stored in a cartesian  
83 -projection in a World Coordinate System (WCS) compliant format. 76 +.. code-block:: none
  77 +
  78 + 2016-06-29T10:33:23: +=================+
  79 + 2016-06-29T10:33:23: | Bin observation |
  80 + 2016-06-29T10:33:23: +=================+
  81 + 2016-06-29T10:33:23: === CTA observation ===
  82 + 2016-06-29T10:33:23: Events in list ............: 23099
  83 + 2016-06-29T10:33:23: Events in cube ............: 18532
  84 + 2016-06-29T10:33:23: Event bins outside RoI ....: 0
  85 + 2016-06-29T10:33:23: Events outside cube area ..: 4567
  86 + 2016-06-29T10:33:23: Events outside energy bins : 0
  87 +
  88 +From the 23099 events that have been simulated and stored in the
  89 +``events.fits`` file, 18532 lie within the cube boundaries and are thus put
  90 +into the resulting counts cube.
doc/source/users/user_manual/getting_started/butterfly.rst
@@ -39,7 +39,7 @@ to make this work. To launch the script, type: @@ -39,7 +39,7 @@ to make this work. To launch the script, type:
39 39
40 .. code-block:: bash 40 .. code-block:: bash
41 41
42 - python $CTOOLS/share/examples/python/show_butterfly.py butterfly.txt 42 + $CTOOLS/share/examples/python/show_butterfly.py butterfly.txt
43 43
44 This will result in a canvas which should look like the following: 44 This will result in a canvas which should look like the following:
45 45
@@ -47,5 +47,5 @@ This will result in a canvas which should look like the following: @@ -47,5 +47,5 @@ This will result in a canvas which should look like the following:
47 :height: 400px 47 :height: 400px
48 :align: center 48 :align: center
49 49
50 - *Confidence band of the fit* 50 + *Confidence band of the power law fit*
51 51
52 \ No newline at end of file 52 \ No newline at end of file
doc/source/users/user_manual/getting_started/cntmap-fits.jpg

47 KB | W: | H:

102 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/user_manual/getting_started/energy_dispersion.rst 0 → 100644
  1 +.. _sec_edisp_cta:
  2 +
  3 +Taking into account energy dispersion
  4 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5 +
  6 +You may not have recognised it, but the examples you have exercised so far
  7 +have neglected the impact of energy dispersion on the analysis. In reality,
  8 +however, the reconstructed event energy will differ from the true photon energy,
  9 +and this effect will become particularily important at low energies. There are
  10 +therefore cases where you want to take the effects of energy dispersion into
  11 +account, and you can do this in all ctools that make use of the instrument
  12 +response functions by setting the hidden ``edisp`` parameter to ``yes``.
  13 +
  14 +.. warning::
  15 +
  16 + The maximum likelihood computations including energy dispersion are
  17 + relatively time consuming, and in many situations the impact of the
  18 + energy dispersion on the analysis results will be very small. For this
  19 + reason, energy dispersion is by default disabled in ctools.
  20 +
  21 +To simulate events taking into account the energy dispersion you should
  22 +run the :ref:`ctobssim` tool with ``edisp=yes`` parameter:
  23 +
  24 +.. code-block:: bash
  25 +
  26 + $ ctobssim edisp=yes
  27 + RA of pointing (degrees) (0-360) [83.63]
  28 + Dec of pointing (degrees) (-90-90) [22.01]
  29 + Radius of FOV (degrees) (0-180) [5.0]
  30 + Start time (MET in s) [0.0]
  31 + End time (MET in s) [1800.0]
  32 + Lower energy limit (TeV) [0.1]
  33 + Upper energy limit (TeV) [100.0]
  34 + Calibration database [prod2]
  35 + Instrument response function [South_0.5h]
  36 + Input model XML file [$CTOOLS/share/models/crab.xml]
  37 + Output event data file or observation definition XML file [events.fits]
  38 +
  39 +You may then select events as before using the :ref:`ctselect` tool
  40 +(since this tool does not need the instrument response function it has no
  41 +hidden ``edisp`` parameter):
  42 +
  43 +.. code-block:: bash
  44 +
  45 + $ ctselect
  46 + Input event list or observation definition XML file [events.fits]
  47 + RA for ROI centre (degrees) (0-360) [83.63]
  48 + Dec for ROI centre (degrees) (-90-90) [22.01]
  49 + Radius of ROI (degrees) (0-180) [3.0]
  50 + Start time (CTA MET in seconds) [0.0]
  51 + End time (CTA MET in seconds) [0.0]
  52 + Lower energy limit (TeV) [0.1]
  53 + Upper energy limit (TeV) [100.0]
  54 + Output event list or observation definition XML file [selected_events.fits]
  55 +
  56 +You then perform a maximum likelihood fit using the :ref:`ctlike` tool
  57 +with ``edisp=yes`` so that energy dispersion is correctly taken into account
  58 +in the likelihood computation:
  59 +
  60 +.. code-block:: bash
  61 +
  62 + $ ctlike edisp=yes
  63 + Input event list, counts cube or observation definition XML file [selected_events.fits]
  64 + Calibration database [prod2]
  65 + Instrument response function [South_0.5h]
  66 + Input model XML file [$CTOOLS/share/models/crab.xml]
  67 + Output model XML file [crab_results.xml]
  68 +
  69 +Below you see the output from the ``ctlike.log`` file.
  70 +
  71 +.. code-block:: none
  72 +
  73 + 2016-06-29T20:33:36: +=================================+
  74 + 2016-06-29T20:33:36: | Maximum likelihood optimisation |
  75 + 2016-06-29T20:33:36: +=================================+
  76 + 2016-06-29T20:33:39: >Iteration 0: -logL=133777.933, Lambda=1.0e-03
  77 + 2016-06-29T20:33:42: >Iteration 1: -logL=133772.125, Lambda=1.0e-03, delta=5.808, max(|grad|)=23.221525 [Index:7]
  78 + 2016-06-29T20:33:45: >Iteration 2: -logL=133772.111, Lambda=1.0e-04, delta=0.013, max(|grad|)=-0.042654 [Prefactor:6]
  79 + 2016-06-29T20:33:48: >Iteration 3: -logL=133772.111, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.000611 [Index:3]
  80 + ...
  81 + 2016-06-29T20:33:50: +=========================================+
  82 + 2016-06-29T20:33:50: | Maximum likelihood optimisation results |
  83 + 2016-06-29T20:33:50: +=========================================+
  84 + 2016-06-29T20:33:50: === GOptimizerLM ===
  85 + 2016-06-29T20:33:50: Optimized function value ..: 133772.111
  86 + 2016-06-29T20:33:50: Absolute precision ........: 0.005
  87 + 2016-06-29T20:33:50: Acceptable value decrease .: 2
  88 + 2016-06-29T20:33:50: Optimization status .......: converged
  89 + 2016-06-29T20:33:50: Number of parameters ......: 10
  90 + 2016-06-29T20:33:50: Number of free parameters .: 4
  91 + 2016-06-29T20:33:50: Number of iterations ......: 3
  92 + 2016-06-29T20:33:50: Lambda ....................: 1e-06
  93 + 2016-06-29T20:33:50: Maximum log likelihood ....: -133772.111
  94 + 2016-06-29T20:33:50: Observed events (Nobs) ...: 20952.000
  95 + 2016-06-29T20:33:50: Predicted events (Npred) ..: 20952.000 (Nobs - Npred = 1.01277e-06)
  96 + 2016-06-29T20:33:50: === GModels ===
  97 + 2016-06-29T20:33:50: Number of models ..........: 2
  98 + 2016-06-29T20:33:50: Number of parameters ......: 10
  99 + 2016-06-29T20:33:50: === GModelSky ===
  100 + 2016-06-29T20:33:50: Name ......................: Crab
  101 + 2016-06-29T20:33:50: Instruments ...............: all
  102 + 2016-06-29T20:33:50: Instrument scale factors ..: unity
  103 + 2016-06-29T20:33:50: Observation identifiers ...: all
  104 + 2016-06-29T20:33:50: Model type ................: PointSource
  105 + 2016-06-29T20:33:50: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  106 + 2016-06-29T20:33:50: Number of parameters ......: 6
  107 + 2016-06-29T20:33:50: Number of spatial par's ...: 2
  108 + 2016-06-29T20:33:50: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  109 + 2016-06-29T20:33:50: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  110 + 2016-06-29T20:33:50: Number of spectral par's ..: 3
  111 + 2016-06-29T20:33:50: Prefactor ................: 5.74029e-16 +/- 1.04025e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  112 + 2016-06-29T20:33:50: Index ....................: -2.49899 +/- 0.015621 [-0,-5] (free,scale=-1,gradient)
  113 + 2016-06-29T20:33:50: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  114 + 2016-06-29T20:33:50: Number of temporal par's ..: 1
  115 + 2016-06-29T20:33:50: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  116 + 2016-06-29T20:33:50: === GCTAModelIrfBackground ===
  117 + 2016-06-29T20:33:50: Name ......................: CTABackgroundModel
  118 + 2016-06-29T20:33:50: Instruments ...............: CTA
  119 + 2016-06-29T20:33:50: Instrument scale factors ..: unity
  120 + 2016-06-29T20:33:50: Observation identifiers ...: all
  121 + 2016-06-29T20:33:50: Model type ................: "PowerLaw" * "Constant"
  122 + 2016-06-29T20:33:50: Number of parameters ......: 4
  123 + 2016-06-29T20:33:50: Number of spectral par's ..: 3
  124 + 2016-06-29T20:33:50: Prefactor ................: 0.959074 +/- 0.0134496 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  125 + 2016-06-29T20:33:50: Index ....................: -0.0162199 +/- 0.00850751 [-5,5] (free,scale=1,gradient)
  126 + 2016-06-29T20:33:50: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  127 + 2016-06-29T20:33:50: Number of temporal par's ..: 1
  128 + 2016-06-29T20:33:50: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  129 +
doc/source/users/user_manual/getting_started/fitting.rst
@@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
3 Fitting CTA data 3 Fitting CTA data
4 ~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~
5 5
6 -Now we are ready to fit the simulated data with a model. For simplicity  
7 -we use in this example the same model that we used to simulate the data 6 +Now you are ready to fit the simulated data with a model. For simplicity
  7 +the same model is used in the example that you used to simulate the data
8 with :ref:`ctobssim`. Model fitting is done using the :ref:`ctlike` tool, 8 with :ref:`ctobssim`. Model fitting is done using the :ref:`ctlike` tool,
9 -and we do the fit by typing: 9 +and you do the fit by typing:
10 10
11 .. code-block:: bash 11 .. code-block:: bash
12 12
@@ -40,8 +40,8 @@ Below we show the XML result file that has been produced by the run: @@ -40,8 +40,8 @@ Below we show the XML result file that has been produced by the run:
40 <source_library title="source library"> 40 <source_library title="source library">
41 <source name="Crab" type="PointSource"> 41 <source name="Crab" type="PointSource">
42 <spectrum type="PowerLaw"> 42 <spectrum type="PowerLaw">
43 - <parameter name="Prefactor" value="5.78443" error="0.101348" scale="1e-16" min="1e-07" max="1000" free="1" />  
44 - <parameter name="Index" value="2.50664" error="0.0153631" scale="-1" min="0" max="5" free="1" /> 43 + <parameter name="Prefactor" value="5.79064" error="0.101828" scale="1e-16" min="1e-07" max="1000" free="1" />
  44 + <parameter name="Index" value="2.47177" error="0.0154935" scale="-1" min="0" max="5" free="1" />
45 <parameter name="Scale" value="0.3" scale="1e+06" min="0.01" max="1000" free="0" /> 45 <parameter name="Scale" value="0.3" scale="1e+06" min="0.01" max="1000" free="0" />
46 </spectrum> 46 </spectrum>
47 <spatialModel type="SkyDirFunction"> 47 <spatialModel type="SkyDirFunction">
@@ -51,17 +51,17 @@ Below we show the XML result file that has been produced by the run: @@ -51,17 +51,17 @@ Below we show the XML result file that has been produced by the run:
51 </source> 51 </source>
52 <source name="CTABackgroundModel" type="CTAIrfBackground" instrument="CTA"> 52 <source name="CTABackgroundModel" type="CTAIrfBackground" instrument="CTA">
53 <spectrum type="PowerLaw"> 53 <spectrum type="PowerLaw">
54 - <parameter name="Prefactor" value="0.993018" error="0.0160113" scale="1" min="0.001" max="1000" free="1" />  
55 - <parameter name="Index" value="0.00269761" error="0.00973921" scale="1" min="-5" max="5" free="1" /> 54 + <parameter name="Prefactor" value="1.01642" error="0.0162226" scale="1" min="0.001" max="1000" free="1" />
  55 + <parameter name="Index" value="0.00462945" error="0.00964737" scale="1" min="-5" max="5" free="1" />
56 <parameter name="Scale" value="1" scale="1e+06" min="0.01" max="1000" free="0" /> 56 <parameter name="Scale" value="1" scale="1e+06" min="0.01" max="1000" free="0" />
57 </spectrum> 57 </spectrum>
58 </source> 58 </source>
59 </source_library> 59 </source_library>
60 60
61 In this example, the ``Prefactor`` and ``Index`` of the spectral model for the 61 In this example, the ``Prefactor`` and ``Index`` of the spectral model for the
62 -Crab as well as the ``Prefactor`` and ``Index`` of the background spectral 62 +Crab nebula as well as the ``Prefactor`` and ``Index`` of the background spectral
63 model have been fitted (all parameters having the attribute ``free="1"`` are 63 model have been fitted (all parameters having the attribute ``free="1"`` are
64 -fitted). Now we see also the effect of having multiplied the background 64 +fitted). Now you see also the effect of having multiplied the background
65 model with a power law. In that way, the amplitude of the background as 65 model with a power law. In that way, the amplitude of the background as
66 well as it's spectral slope is adjusted by the fit. Obviously, in this 66 well as it's spectral slope is adjusted by the fit. Obviously, in this
67 example the adjustment compensates only for the statistical fluctuations 67 example the adjustment compensates only for the statistical fluctuations
@@ -79,67 +79,66 @@ To get more details about the model fitting you can inspect the log file. @@ -79,67 +79,66 @@ To get more details about the model fitting you can inspect the log file.
79 Below the last lines of the ctlike.log log file that has been produced by 79 Below the last lines of the ctlike.log log file that has been produced by
80 this run: 80 this run:
81 81
82 -.. code-block:: xml 82 +.. code-block:: none
83 83
84 - 2015-12-07T20:55:32: +=================================+  
85 - 2015-12-07T20:55:32: | Maximum likelihood optimisation |  
86 - 2015-12-07T20:55:32: +=================================+  
87 - 2015-12-07T20:55:33: >Iteration 0: -logL=54877.412, Lambda=1.0e-03  
88 - 2015-12-07T20:55:35: >Iteration 1: -logL=54875.025, Lambda=1.0e-03, delta=2.387, max(|grad|)=1.856683 [Index:7]  
89 - 2015-12-07T20:55:36: >Iteration 2: -logL=54875.024, Lambda=1.0e-04, delta=0.001, max(|grad|)=-0.024661 [Index:3]  
90 - 2015-12-07T20:55:36: 84 + 2016-06-29T16:11:05: +=================================+
  85 + 2016-06-29T16:11:05: | Maximum likelihood optimisation |
  86 + 2016-06-29T16:11:05: +=================================+
  87 + 2016-06-29T16:11:06: >Iteration 0: -logL=55574.937, Lambda=1.0e-03
  88 + 2016-06-29T16:11:06: >Iteration 1: -logL=55573.383, Lambda=1.0e-03, delta=1.555, max(|grad|)=3.170837 [Index:7]
  89 + 2016-06-29T16:11:07: >Iteration 2: -logL=55573.382, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.056280 [Index:3]
91 ... 90 ...
92 - 2015-12-07T20:55:38: +=========================================+  
93 - 2015-12-07T20:55:38: | Maximum likelihood optimisation results |  
94 - 2015-12-07T20:55:38: +=========================================+  
95 - 2015-12-07T20:55:38: === GOptimizerLM ===  
96 - 2015-12-07T20:55:38: Optimized function value ..: 54875.024  
97 - 2015-12-07T20:55:38: Absolute precision ........: 0.005  
98 - 2015-12-07T20:55:38: Acceptable value decrease .: 2  
99 - 2015-12-07T20:55:38: Optimization status .......: converged  
100 - 2015-12-07T20:55:38: Number of parameters ......: 10  
101 - 2015-12-07T20:55:38: Number of free parameters .: 4  
102 - 2015-12-07T20:55:38: Number of iterations ......: 2  
103 - 2015-12-07T20:55:38: Lambda ....................: 1e-05  
104 - 2015-12-07T20:55:38: Maximum log likelihood ....: -54875.024  
105 - 2015-12-07T20:55:38: Observed events (Nobs) ...: 18195.000  
106 - 2015-12-07T20:55:38: Predicted events (Npred) ..: 18194.999 (Nobs - Npred = 0.00146383)  
107 - 2015-12-07T20:55:38: === GModels ===  
108 - 2015-12-07T20:55:38: Number of models ..........: 2  
109 - 2015-12-07T20:55:38: Number of parameters ......: 10  
110 - 2015-12-07T20:55:38: === GModelSky ===  
111 - 2015-12-07T20:55:38: Name ......................: Crab  
112 - 2015-12-07T20:55:38: Instruments ...............: all  
113 - 2015-12-07T20:55:38: Instrument scale factors ..: unity  
114 - 2015-12-07T20:55:38: Observation identifiers ...: all  
115 - 2015-12-07T20:55:38: Model type ................: PointSource  
116 - 2015-12-07T20:55:38: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
117 - 2015-12-07T20:55:38: Number of parameters ......: 6  
118 - 2015-12-07T20:55:38: Number of spatial par's ...: 2  
119 - 2015-12-07T20:55:38: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
120 - 2015-12-07T20:55:38: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
121 - 2015-12-07T20:55:38: Number of spectral par's ..: 3  
122 - 2015-12-07T20:55:38: Prefactor ................: 5.78443e-16 +/- 1.01348e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
123 - 2015-12-07T20:55:38: Index ....................: -2.50664 +/- 0.0153631 [-0,-5] (free,scale=-1,gradient)  
124 - 2015-12-07T20:55:38: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
125 - 2015-12-07T20:55:38: Number of temporal par's ..: 1  
126 - 2015-12-07T20:55:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)  
127 - 2015-12-07T20:55:38: === GCTAModelIrfBackground ===  
128 - 2015-12-07T20:55:38: Name ......................: CTABackgroundModel  
129 - 2015-12-07T20:55:38: Instruments ...............: CTA  
130 - 2015-12-07T20:55:38: Instrument scale factors ..: unity  
131 - 2015-12-07T20:55:38: Observation identifiers ...: all  
132 - 2015-12-07T20:55:38: Model type ................: "PowerLaw" * "Constant"  
133 - 2015-12-07T20:55:38: Number of parameters ......: 4  
134 - 2015-12-07T20:55:38: Number of spectral par's ..: 3  
135 - 2015-12-07T20:55:38: Prefactor ................: 0.993018 +/- 0.0160113 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)  
136 - 2015-12-07T20:55:38: Index ....................: 0.00269761 +/- 0.00973921 [-5,5] (free,scale=1,gradient)  
137 - 2015-12-07T20:55:38: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
138 - 2015-12-07T20:55:38: Number of temporal par's ..: 1  
139 - 2015-12-07T20:55:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 91 + 2016-06-29T16:11:08: +=========================================+
  92 + 2016-06-29T16:11:08: | Maximum likelihood optimisation results |
  93 + 2016-06-29T16:11:08: +=========================================+
  94 + 2016-06-29T16:11:08: === GOptimizerLM ===
  95 + 2016-06-29T16:11:08: Optimized function value ..: 55573.382
  96 + 2016-06-29T16:11:08: Absolute precision ........: 0.005
  97 + 2016-06-29T16:11:08: Acceptable value decrease .: 2
  98 + 2016-06-29T16:11:08: Optimization status .......: converged
  99 + 2016-06-29T16:11:08: Number of parameters ......: 10
  100 + 2016-06-29T16:11:08: Number of free parameters .: 4
  101 + 2016-06-29T16:11:08: Number of iterations ......: 2
  102 + 2016-06-29T16:11:08: Lambda ....................: 1e-05
  103 + 2016-06-29T16:11:08: Maximum log likelihood ....: -55573.382
  104 + 2016-06-29T16:11:08: Observed events (Nobs) ...: 18532.000
  105 + 2016-06-29T16:11:08: Predicted events (Npred) ..: 18531.998 (Nobs - Npred = 0.00243959)
  106 + 2016-06-29T16:11:08: === GModels ===
  107 + 2016-06-29T16:11:08: Number of models ..........: 2
  108 + 2016-06-29T16:11:08: Number of parameters ......: 10
  109 + 2016-06-29T16:11:08: === GModelSky ===
  110 + 2016-06-29T16:11:08: Name ......................: Crab
  111 + 2016-06-29T16:11:08: Instruments ...............: all
  112 + 2016-06-29T16:11:08: Instrument scale factors ..: unity
  113 + 2016-06-29T16:11:08: Observation identifiers ...: all
  114 + 2016-06-29T16:11:08: Model type ................: PointSource
  115 + 2016-06-29T16:11:08: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  116 + 2016-06-29T16:11:08: Number of parameters ......: 6
  117 + 2016-06-29T16:11:08: Number of spatial par's ...: 2
  118 + 2016-06-29T16:11:08: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  119 + 2016-06-29T16:11:08: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  120 + 2016-06-29T16:11:08: Number of spectral par's ..: 3
  121 + 2016-06-29T16:11:08: Prefactor ................: 5.79064e-16 +/- 1.01828e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  122 + 2016-06-29T16:11:08: Index ....................: -2.47177 +/- 0.0154935 [-0,-5] (free,scale=-1,gradient)
  123 + 2016-06-29T16:11:08: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  124 + 2016-06-29T16:11:08: Number of temporal par's ..: 1
  125 + 2016-06-29T16:11:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  126 + 2016-06-29T16:11:08: === GCTAModelIrfBackground ===
  127 + 2016-06-29T16:11:08: Name ......................: CTABackgroundModel
  128 + 2016-06-29T16:11:08: Instruments ...............: CTA
  129 + 2016-06-29T16:11:08: Instrument scale factors ..: unity
  130 + 2016-06-29T16:11:08: Observation identifiers ...: all
  131 + 2016-06-29T16:11:08: Model type ................: "PowerLaw" * "Constant"
  132 + 2016-06-29T16:11:08: Number of parameters ......: 4
  133 + 2016-06-29T16:11:08: Number of spectral par's ..: 3
  134 + 2016-06-29T16:11:08: Prefactor ................: 1.01642 +/- 0.0162226 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  135 + 2016-06-29T16:11:08: Index ....................: 0.00462945 +/- 0.00964737 [-5,5] (free,scale=1,gradient)
  136 + 2016-06-29T16:11:08: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  137 + 2016-06-29T16:11:08: Number of temporal par's ..: 1
  138 + 2016-06-29T16:11:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
140 139
141 The maximum likelihood optimizer required 2 iterations to converge. This 140 The maximum likelihood optimizer required 2 iterations to converge. This
142 -is pretty fast, but recall that we used the same model file for the simulation 141 +is pretty fast, but recall that you used the same model file for the simulation
143 and for fitting, hence the initial parameter values were already very close 142 and for fitting, hence the initial parameter values were already very close
144 to the best fitting values. To see the impact of the initial parameters on 143 to the best fitting values. To see the impact of the initial parameters on
145 the fit result, you may re-run :ref:`ctlike` using another copy of the model 144 the fit result, you may re-run :ref:`ctlike` using another copy of the model
@@ -180,16 +179,16 @@ are not too far from the best fitting values). @@ -180,16 +179,16 @@ are not too far from the best fitting values).
180 :ref:`ctlike` will then compute the Test Statistic value for that 179 :ref:`ctlike` will then compute the Test Statistic value for that
181 source and dump the result in the log file: 180 source and dump the result in the log file:
182 181
183 - .. code-block:: xml 182 + .. code-block:: none
184 183
185 - 2015-12-07T20:58:45: === GModelSky ===  
186 - 2015-12-07T20:58:45: Name ......................: Crab  
187 - 2015-12-07T20:58:45: Instruments ...............: all  
188 - 2015-12-07T20:58:45: Test Statistic ............: 21164.4 184 + 2016-06-29T16:17:38: === GModelSky ===
  185 + 2016-06-29T16:17:38: Name ......................: Crab
  186 + 2016-06-29T16:17:38: Instruments ...............: all
  187 + 2016-06-29T16:17:38: Test Statistic ............: 21778.8
189 188
190 The Test Statistic value will also be added as new attribute 189 The Test Statistic value will also be added as new attribute
191 ``ts`` to the XML result file: 190 ``ts`` to the XML result file:
192 191
193 .. code-block:: xml 192 .. code-block:: xml
194 193
195 - <source name="Crab" type="PointSource" ts="21164.384" tscalc="1"> 194 + <source name="Crab" type="PointSource" ts="21778.780" tscalc="1">
doc/source/users/user_manual/getting_started/python.rst
@@ -64,26 +64,9 @@ To visualise this container, type: @@ -64,26 +64,9 @@ To visualise this container, type:
64 >>> print(sim.obs()) 64 >>> print(sim.obs())
65 === GObservations === 65 === GObservations ===
66 Number of observations ....: 1 66 Number of observations ....: 1
  67 + Number of models ..........: 2
  68 + Number of observed events .: 23099
67 Number of predicted events : 0 69 Number of predicted events : 0
68 - === GCTAObservation ===  
69 - Name ......................:  
70 - Identifier ................:  
71 - Instrument ................: CTA  
72 - Event file ................: events.fits  
73 - Event type ................: EventList  
74 - Statistics ................: Poisson  
75 - Ontime ....................: 1800 s  
76 - Livetime ..................: 1710 s  
77 - Deadtime correction .......: 0.95  
78 - User energy range .........: undefined  
79 - === GCTAPointing ===  
80 - Pointing direction ........: (RA,Dec)=(83.63,22.01)  
81 - === GCTAResponseIrf ===  
82 - Caldb mission .............: cta  
83 - Caldb instrument ..........: prod2  
84 - Response name .............: South_0.5h  
85 - Energy dispersion .........: Not used  
86 - Save energy range .........: undefined  
87 70
88 There is one CTA observation in the container and to visualise the events 71 There is one CTA observation in the container and to visualise the events
89 in that observation you may type: 72 in that observation you may type:
@@ -92,7 +75,7 @@ in that observation you may type: @@ -92,7 +75,7 @@ in that observation you may type:
92 75
93 >>> print(sim.obs()[0].events()) 76 >>> print(sim.obs()[0].events())
94 === GCTAEventList === 77 === GCTAEventList ===
95 - Number of events ..........: 45370 78 + Number of events ..........: 23099 (disposed in "events.fits")
96 Time interval .............: 51544.5 - 51544.5 days 79 Time interval .............: 51544.5 - 51544.5 days
97 === GEbounds === 80 === GEbounds ===
98 Number of intervals .......: 1 81 Number of intervals .......: 1
@@ -125,38 +108,11 @@ terrestrial times (TT) of all events. @@ -125,38 +108,11 @@ terrestrial times (TT) of all events.
125 >>> for event in events: 108 >>> for event in events:
126 ... print(event) 109 ... print(event)
127 ... 110 ...
128 - Dir=RA=83.5743, DEC=21.9746 [-0.000617357,-0.000902194] Energy=328.153 GeV Time=-3.15576e+08 s (TT)  
129 - Dir=RA=83.5756, DEC=22.0127 [4.78931e-05,-0.000879886] Energy=353.264 GeV Time=-3.15576e+08 s (TT)  
130 - Dir=RA=83.6811, DEC=22.0034 [-0.000114612,0.000826825] Energy=550.35 GeV Time=-3.15576e+08 s (TT) 111 + Dir=RA=83.6308, DEC=21.8881 [-0.00212759,1.33661e-05] Energy=106.465 GeV Time=-3.15576e+08 s (TT)
  112 + Dir=RA=83.7518, DEC=21.8064 [-0.0035525,0.00197398] Energy=117.706 GeV Time=-3.15576e+08 s (TT)
  113 + Dir=RA=83.5545, DEC=22.0933 [0.00145377,-0.00122121] Energy=138.624 GeV Time=-3.15576e+08 s (TT)
131 ... 114 ...
132 115
133 -.. note::  
134 -  
135 - If you inspect the event list in detail you may recognise that all  
136 - events appear twice in the event list.  
137 - This is because we ran :ref:`ctobssim` twice (a first time when calling  
138 - the ``execute()`` method and a second time when calling the ``run()``  
139 - method).  
140 - **ctobssim will append simulated events to any pre-existing  
141 - events in an observation container.**  
142 - To get a single simulation you should clear the observation container  
143 - and re-run :ref:`ctobssim`:  
144 -  
145 - .. code-block:: python  
146 -  
147 - >>> sim.obs().clear()  
148 - >>> sim.run()  
149 - >>> print(sim.obs()[0].events())  
150 - === GCTAEventList ===  
151 - Number of events ..........: 22685  
152 - Time interval .............: 51544.5 - 51544.5 days  
153 - === GEbounds ===  
154 - Number of intervals .......: 1  
155 - Energy range ..............: 100 GeV - 100 TeV  
156 - === GCTARoi ===  
157 - ROI centre ................: RA=83.63, DEC=22.01 [0,0]  
158 - ROI radius ................: 5 deg  
159 -  
160 116
161 Performing a maximum likelihood analysis in Python 117 Performing a maximum likelihood analysis in Python
162 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -187,7 +143,7 @@ To check how the fit went you can inspect the optimiser used by @@ -187,7 +143,7 @@ To check how the fit went you can inspect the optimiser used by
187 143
188 >>> print(like.opt()) 144 >>> print(like.opt())
189 === GOptimizerLM === 145 === GOptimizerLM ===
190 - Optimized function value ..: 152299.205 146 + Optimized function value ..: 154553.422
191 Absolute precision ........: 0.005 147 Absolute precision ........: 0.005
192 Acceptable value decrease .: 2 148 Acceptable value decrease .: 2
193 Optimization status .......: converged 149 Optimization status .......: converged
@@ -220,8 +176,8 @@ member of the observation container: @@ -220,8 +176,8 @@ member of the observation container:
220 RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) 176 RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
221 DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) 177 DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
222 Number of spectral par's ..: 3 178 Number of spectral par's ..: 3
223 - Prefactor ................: 5.81591e-16 +/- 1.01725e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
224 - Index ....................: -2.50618 +/- 0.0153538 [-0,-5] (free,scale=-1,gradient) 179 + Prefactor ................: 5.82698e-16 +/- 1.02186e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  180 + Index ....................: -2.47534 +/- 0.0154764 [-0,-5] (free,scale=-1,gradient)
225 PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) 181 PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
226 Number of temporal par's ..: 1 182 Number of temporal par's ..: 1
227 Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 183 Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
@@ -233,8 +189,8 @@ member of the observation container: @@ -233,8 +189,8 @@ member of the observation container:
233 Model type ................: "PowerLaw" * "Constant" 189 Model type ................: "PowerLaw" * "Constant"
234 Number of parameters ......: 4 190 Number of parameters ......: 4
235 Number of spectral par's ..: 3 191 Number of spectral par's ..: 3
236 - Prefactor ................: 0.998788 +/- 0.0118567 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)  
237 - Index ....................: 0.00990034 +/- 0.00735768 [-5,5] (free,scale=1,gradient) 192 + Prefactor ................: 1.01266 +/- 0.0119676 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  193 + Index ....................: 0.00474762 +/- 0.00731725 [-5,5] (free,scale=1,gradient)
238 PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) 194 PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
239 Number of temporal par's ..: 1 195 Number of temporal par's ..: 1
240 Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 196 Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
@@ -250,8 +206,8 @@ This is easy from Python: @@ -250,8 +206,8 @@ This is easy from Python:
250 >>> like.run() 206 >>> like.run()
251 >>> print(like.obs().models()) 207 >>> print(like.obs().models())
252 ... 208 ...
253 - RA .......................: 83.6334 +/- 0.000917669 [-360,360] deg (free,scale=1)  
254 - DEC ......................: 22.0144 +/- 0.000836554 [-90,90] deg (free,scale=1) 209 + RA .......................: 83.6327 +/- 0.000916983 [-360,360] deg (free,scale=1)
  210 + DEC ......................: 22.0141 +/- 0.00086378 [-90,90] deg (free,scale=1)
255 211
256 The ``like.obs().models()`` method provides the model container, using the 212 The ``like.obs().models()`` method provides the model container, using the
257 ``["Crab"]`` operator we access the Crab model in that container and using 213 ``["Crab"]`` operator we access the Crab model in that container and using
@@ -293,7 +249,9 @@ the ``fix()`` method. @@ -293,7 +249,9 @@ the ``fix()`` method.
293 >>> print(like.obs()) 249 >>> print(like.obs())
294 === GObservations === 250 === GObservations ===
295 Number of observations ....: 1 251 Number of observations ....: 1
296 - Number of predicted events : 22685 252 + Number of models ..........: 2
  253 + Number of observed events .: 23099
  254 + Number of predicted events : 23099
297 255
298 is okay as the ``ctools.ctlike(sim.obs())`` constructor will create 256 is okay as the ``ctools.ctlike(sim.obs())`` constructor will create
299 a copy of the observation container that lives within the :ref:`ctlike` 257 a copy of the observation container that lives within the :ref:`ctlike`
@@ -309,6 +267,8 @@ the ``fix()`` method. @@ -309,6 +267,8 @@ the ``fix()`` method.
309 >>> print(obs) 267 >>> print(obs)
310 === GObservations === 268 === GObservations ===
311 Number of observations ....: 1 269 Number of observations ....: 1
  270 + Number of models ..........: 2
  271 + Number of observed events .: 23099
312 Number of predicted events : 0 272 Number of predicted events : 0
313 273
314 274
@@ -338,8 +298,9 @@ Here an example of how to use ``obsutils``: @@ -338,8 +298,9 @@ Here an example of how to use ``obsutils``:
338 >>> print(obs) 298 >>> print(obs)
339 === GObservations === 299 === GObservations ===
340 Number of observations ....: 4 300 Number of observations ....: 4
  301 + Number of models ..........: 0
  302 + Number of observed events .: 0
341 Number of predicted events : 0 303 Number of predicted events : 0
342 - ...  
343 >>> obs.models(gammalib.GModels("${CTOOLS}/share/models/crab.xml")) 304 >>> obs.models(gammalib.GModels("${CTOOLS}/share/models/crab.xml"))
344 >>> obs = obsutils.sim(obs) 305 >>> obs = obsutils.sim(obs)
345 >>> like = obsutils.fit(obs) 306 >>> like = obsutils.fit(obs)
@@ -355,8 +316,8 @@ pattern of four observations located at offset angles of 1 degree from the @@ -355,8 +316,8 @@ pattern of four observations located at offset angles of 1 degree from the
355 nominal location of the Crab nebula. 316 nominal location of the Crab nebula.
356 The ``obsutils.set_obs_list()`` will build an observation container from 317 The ``obsutils.set_obs_list()`` will build an observation container from
357 that pattern where each pointing will have a duration of 1800 seconds, 318 that pattern where each pointing will have a duration of 1800 seconds,
358 -cover the 0.1-100 TeV energy range and a field of view of 5 degrees.  
359 -The standard dummy CTA calibration information will be used. 319 +cover the 0.1-100 TeV energy range and a field of view of 5°.
  320 +The ``South_0.5h`` IRF from the Prod2 calibration database will be used.
360 A model is then appended to the observation container using the 321 A model is then appended to the observation container using the
361 ``obs.models()`` method. 322 ``obs.models()`` method.
362 The ``obsutils.sim()`` function then simulates the event data, the 323 The ``obsutils.sim()`` function then simulates the event data, the
@@ -484,4 +445,4 @@ Beyond the first steps @@ -484,4 +445,4 @@ Beyond the first steps
484 You now have learned the basics of using ctools and GammaLib within Python. 445 You now have learned the basics of using ctools and GammaLib within Python.
485 To go beyond these initial steps you may check the Python scripts in the 446 To go beyond these initial steps you may check the Python scripts in the
486 ``examples`` folder that provide useful analysis examples. 447 ``examples`` folder that provide useful analysis examples.
487 -Check the ``README`` file in that folder for an explanation of the scripts. 448 +Check the ``README.md`` file in that folder for an explanation of the scripts.
doc/source/users/user_manual/getting_started/quickstart.rst
@@ -9,9 +9,10 @@ half an hour long CTA observation of the Crab nebula as the single @@ -9,9 +9,10 @@ half an hour long CTA observation of the Crab nebula as the single
9 point source within the CTA field of view. You will learn how to bin the 9 point source within the CTA field of view. You will learn how to bin the
10 event data into a counts cube and how to fit a spatial and spectral model 10 event data into a counts cube and how to fit a spatial and spectral model
11 to the data. You will also learn how to analyse directly event lists 11 to the data. You will also learn how to analyse directly event lists
12 -without binning the events into a counts cube. Finally we will show how  
13 -you can create a butterfly diagram that shows the confidence band of the  
14 -fitted spectral model. 12 +without binning the events into a counts cube. We will show how you can
  13 +create a butterfly diagram that shows the confidence band of the
  14 +fitted spectral model. And you will learn how to take energy dispersion
  15 +into account.
15 16
16 .. toctree:: 17 .. toctree::
17 :maxdepth: 2 18 :maxdepth: 2
@@ -21,3 +22,4 @@ fitted spectral model. @@ -21,3 +22,4 @@ fitted spectral model.
21 fitting 22 fitting
22 unbinned 23 unbinned
23 butterfly 24 butterfly
  25 + energy_dispersion
doc/source/users/user_manual/getting_started/simulating.rst
@@ -153,34 +153,48 @@ The second file produced by :ref:`ctobssim` is a human readable log file that @@ -153,34 +153,48 @@ The second file produced by :ref:`ctobssim` is a human readable log file that
153 contains information about the job execution. As example, the last lines 153 contains information about the job execution. As example, the last lines
154 from this file are shown here: 154 from this file are shown here:
155 155
156 -.. code-block:: xml  
157 -  
158 - 2015-12-07T20:48:30: +======================+  
159 - 2015-12-07T20:48:30: | Simulate observation |  
160 - 2015-12-07T20:48:30: +======================+  
161 - 2015-12-07T20:48:30: === CTA observation ===  
162 - 2015-12-07T20:48:30: Simulation area ...........: 1.9635e+11 cm2  
163 - 2015-12-07T20:48:30: Simulation cone ...........: RA=83.63 deg, Dec=22.01 deg, r=5.5 deg  
164 - 2015-12-07T20:48:30: Time interval .............: 0 - 1800 s  
165 - 2015-12-07T20:48:30: Photon energy range .......: 100 GeV - 100 TeV  
166 - 2015-12-07T20:48:30: Event energy range ........: 100 GeV - 100 TeV  
167 - 2015-12-07T20:48:30: Use model .................: Crab  
168 - 2015-12-07T20:48:30: Normalization .............: 1 [Crab]  
169 - 2015-12-07T20:48:30: Flux ......................: 5.87297e-10 [Crab] photons/cm2/s  
170 - 2015-12-07T20:48:30: Normalized flux ...........: 5.87297e-10 [Crab] photons/cm2/s  
171 - 2015-12-07T20:48:30: Photon rate ...............: 115.316 photons/s [Crab]  
172 - 2015-12-07T20:48:31: MC source photons .........: 207547 [Crab]  
173 - 2015-12-07T20:48:31: MC source events ..........: 3646 [Crab]  
174 - 2015-12-07T20:48:31: MC source events ..........: 3646 (all source models)  
175 - 2015-12-07T20:48:33: MC events outside ROI .....: 0  
176 - 2015-12-07T20:48:33: MC background events ......: 19039  
177 - 2015-12-07T20:48:33: MC events .................: 22685 (all models) 156 +.. code-block:: none
  157 +
  158 + 2016-06-29T10:21:57: +======================+
  159 + 2016-06-29T10:21:57: | Simulate observation |
  160 + 2016-06-29T10:21:57: +======================+
  161 + 2016-06-29T10:21:57: === CTA observation ===
  162 + 2016-06-29T10:21:57: Simulation cone ...........: RA=83.63 deg, Dec=22.01 deg, radius=5.5 deg
  163 + 2016-06-29T10:21:57: Time interval .............: 0 - 1800 s
  164 + 2016-06-29T10:21:57: Photon energy range .......: 100 GeV - 199.526 GeV
  165 + 2016-06-29T10:21:57: Event energy range ........: 100 GeV - 199.526 GeV
  166 + 2016-06-29T10:21:57: Simulation area ..........: 5.75561e+09 cm2
  167 + 2016-06-29T10:21:57: Use model ................: Crab
  168 + 2016-06-29T10:21:57: Normalization ............: 1 [Crab]
  169 + 2016-06-29T10:21:57: Flux .....................: 3.76031e-10 [Crab] photons/cm2/s
  170 + 2016-06-29T10:21:57: Normalized flux ..........: 3.76031e-10 [Crab] photons/cm2/s
  171 + 2016-06-29T10:21:57: Photon rate ..............: 2.16429 photons/s [Crab]
  172 + 2016-06-29T10:21:57: MC source photons ........: 3889 [Crab]
  173 + 2016-06-29T10:21:57: MC source events .........: 1226 [Crab]
  174 + 2016-06-29T10:21:57: MC source events .........: 1226 (all source models)
  175 + 2016-06-29T10:21:57: Photon energy range .......: 199.526 GeV - 398.107 GeV
  176 + ...
  177 + 2016-06-29T10:21:57: MC source photons .........: 10759 [Crab]
  178 + 2016-06-29T10:21:57: MC source events ..........: 3686 [Crab]
  179 + 2016-06-29T10:21:57: MC events outside ROI .....: 0
  180 + 2016-06-29T10:21:57: MC background events ......: 19413
  181 + 2016-06-29T10:21:57: MC events .................: 23099 (all models)
178 182
179 Each line starts with the UTC time at which the line has been written. In 183 Each line starts with the UTC time at which the line has been written. In
180 -this run, 207547 Crab photons have been thrown over an area of 19.6 square  
181 -kilometres during a time interval of 1800 seconds. 3646 of these photons have  
182 -been registered by CTA as events. In the same time interval, 19039 background  
183 -events have been registred by CTA. 184 +this run, 10759 Crab photons have been thrown during a time interval of 1800
  185 +seconds. 3686 of these photons have been registered by CTA as events. In the
  186 +same time interval, 19413 background events have been registred by CTA.
  187 +
  188 +.. note::
  189 +
  190 + :ref:`ctobssim` will split the simulated energy range into a number of
  191 + slices, controlled via the hidden ``eslices`` parameter (ten energy slices
  192 + are used by default). For each energy slice, the simulation area
  193 + will be adapted to the effective area of the array in that energy slice,
  194 + which helps to keep the computing time low. The log file will provide
  195 + information about the simulation in each slice. In the example above, the
  196 + simulation results for the first energy slice are shown, followed by a
  197 + summary of the results for all slices.
184 198
185 You may change the name of the log file using the hidden parameter 199 You may change the name of the log file using the hidden parameter
186 ``logfile``: 200 ``logfile``:
doc/source/users/user_manual/getting_started/unbinned.rst
@@ -7,7 +7,7 @@ As gamma-ray events are rare, the counts cubes generated by :ref:`ctbin` @@ -7,7 +7,7 @@ As gamma-ray events are rare, the counts cubes generated by :ref:`ctbin`
7 will in general be sparsly populated, having many empty pixels, in 7 will in general be sparsly populated, having many empty pixels, in
8 particular at high energies. 8 particular at high energies.
9 An alternative analysis technique consists of working directly on the event 9 An alternative analysis technique consists of working directly on the event
10 -list without binning the events in a counts cube. We will see the benefit of 10 +list without binning the events in a counts cube. You will see the benefit of
11 such an analysis later once you re-run :ref:`ctlike` in unbinned mode. 11 such an analysis later once you re-run :ref:`ctlike` in unbinned mode.
12 12
13 For unbinned analysis you first have to define the data space region over 13 For unbinned analysis you first have to define the data space region over
@@ -66,19 +66,22 @@ If they don&#39;t exist, :ref:`ctlike` will not execute in unbinned mode. @@ -66,19 +66,22 @@ If they don&#39;t exist, :ref:`ctlike` will not execute in unbinned mode.
66 Below some lines of the ``ctselect.log`` file that show the data selection 66 Below some lines of the ``ctselect.log`` file that show the data selection
67 part: 67 part:
68 68
69 -.. code-block:: xml  
70 -  
71 - 2015-12-06T23:44:52: +=================+  
72 - 2015-12-06T23:44:52: | Event selection |  
73 - 2015-12-06T23:44:52: +=================+  
74 - 2015-12-06T23:44:52: === CTA observation ===  
75 - 2015-12-06T23:44:52: Selected energy range .....: 0.1 - 100 TeV  
76 - 2015-12-06T23:44:52: Requested ROI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg  
77 - 2015-12-06T23:44:52: ROI of data ...............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=5 deg  
78 - 2015-12-06T23:44:52: Selected ROI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg  
79 - 2015-12-06T23:44:52: cfitsio selection .........: ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000  
80 - 2015-12-06T23:44:52: FITS filename .............: /var/tmp/tmp.0.jHg5hJ[EVENTS][ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000]  
81 - 69 +.. code-block:: none
  70 +
  71 + 2016-06-29T16:20:10: +=================+
  72 + 2016-06-29T16:20:10: | Event selection |
  73 + 2016-06-29T16:20:10: +=================+
  74 + 2016-06-29T16:20:10: === CTA observation ===
  75 + 2016-06-29T16:20:10: Input filename ............: events.fits
  76 + 2016-06-29T16:20:10: Event extension name ......: EVENTS
  77 + 2016-06-29T16:20:10: GTI extension name ........: GTI
  78 + 2016-06-29T16:20:10: Selected energy range .....: 0.1 - 100 TeV
  79 + 2016-06-29T16:20:10: Requested ROI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
  80 + 2016-06-29T16:20:10: ROI of data ...............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=5 deg
  81 + 2016-06-29T16:20:10: Selected ROI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
  82 + 2016-06-29T16:20:10: cfitsio selection .........: ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000
  83 + 2016-06-29T16:20:10: FITS filename .............: /var/tmp/tmp.0.3aUIXn[EVENTS][ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000]
  84 +
82 .. note:: 85 .. note::
83 86
84 :ref:`ctobssim` will also write data selection keywords in the event 87 :ref:`ctobssim` will also write data selection keywords in the event
@@ -94,15 +97,14 @@ part: @@ -94,15 +97,14 @@ part:
94 selection, any existing selections, and the selection that was finally 97 selection, any existing selections, and the selection that was finally
95 applied. 98 applied.
96 99
97 -.. warning:: 100 +.. note::
98 101
99 :ref:`ctselect` may of course also be used for event selection prior to 102 :ref:`ctselect` may of course also be used for event selection prior to
100 binned analysis, for example to select events for a given period in 103 binned analysis, for example to select events for a given period in
101 - time. **If you use** :ref:`ctselect` **however to make a spatial or energy  
102 - selection, make sure that the counts cube is fully enclosed in the  
103 - selection intervals.** Otherwise you will get empty zones in the counts  
104 - cube of which the ctools are not aware of, and the subsequent analysis  
105 - results will be wrong. 104 + time. The ``WEIGHT`` extension of the counts cube will track the overlap
  105 + between the ROI applied by :ref:`ctselect` and the counts cube, and this
  106 + information will be transparently used in any further analysis to restrict
  107 + the analysis on counts cube bins that contain data.
106 108
107 Now that you have selected the events of interest, you can run ctlike in 109 Now that you have selected the events of interest, you can run ctlike in
108 unbinned mode. To do this you have to specify the selected event list 110 unbinned mode. To do this you have to specify the selected event list
@@ -120,19 +122,19 @@ instead of the counts cube: @@ -120,19 +122,19 @@ instead of the counts cube:
120 You will recognise that :ref:`ctlike` runs much faster in unbinned mode 122 You will recognise that :ref:`ctlike` runs much faster in unbinned mode
121 compared to binned mode. 123 compared to binned mode.
122 This is understandable as the selected event list contains 124 This is understandable as the selected event list contains
123 -only 21203 events, while the binned counts cube we used before had  
124 -200 x 200 x 20 = 800000 pixels. As unbinned maximum likelihood fitting loops  
125 -over the events (while binned maximum likelihood loops over the pixels), 125 +only 21604 events, while the binned counts cube you used before had
  126 +200 x 200 x 20 = 800000 bins. As unbinned maximum likelihood fitting loops
  127 +over the events (while binned maximum likelihood loops over the bins),
126 there are much less operations to perform in unbinned than in binned mode 128 there are much less operations to perform in unbinned than in binned mode
127 (there is some additional overhead in unbinned mode that comes from 129 (there is some additional overhead in unbinned mode that comes from
128 integrating the models over the region of interest, yet this is negligible 130 integrating the models over the region of interest, yet this is negligible
129 compared to the operations needed when looping over all pixels). So as long 131 compared to the operations needed when looping over all pixels). So as long
130 as you work with small event lists, unbinned mode is faster (this 132 as you work with small event lists, unbinned mode is faster (this
131 -typically holds up to 100 hours of observing time). 133 +typically holds up to 50 hours of observing time for point sources).
132 Unbinned :ref:`ctlike` should also be more precise as no binning is performed, 134 Unbinned :ref:`ctlike` should also be more precise as no binning is performed,
133 hence there is no loss of information due to histogramming. 135 hence there is no loss of information due to histogramming.
134 136
135 -Below you see the corresponding output from the ctlike.log file. The fitted 137 +Below you see the corresponding output from the ``ctlike.log`` file. The fitted
136 parameters are essentially identical to the ones found in binned mode. 138 parameters are essentially identical to the ones found in binned mode.
137 The slight difference with respect to the binned analysis may be explained 139 The slight difference with respect to the binned analysis may be explained
138 by the different event sample that has been used for the analysis: while 140 by the different event sample that has been used for the analysis: while
@@ -140,61 +142,60 @@ binned likelihood works on rectangular counts cubes, unbinned likelihood works @@ -140,61 +142,60 @@ binned likelihood works on rectangular counts cubes, unbinned likelihood works
140 on circular event selection regions. It is thus not possible to select exactly 142 on circular event selection regions. It is thus not possible to select exactly
141 the same events for both analyses. 143 the same events for both analyses.
142 144
143 -.. code-block:: xml  
144 -  
145 - 2015-12-07T21:02:17: +=================================+  
146 - 2015-12-07T21:02:17: | Maximum likelihood optimisation |  
147 - 2015-12-07T21:02:17: +=================================+  
148 - 2015-12-07T21:02:17: >Iteration 0: -logL=135278.644, Lambda=1.0e-03  
149 - 2015-12-07T21:02:17: >Iteration 1: -logL=135274.475, Lambda=1.0e-03, delta=4.168, max(|grad|)=5.806873 [Index:7]  
150 - 2015-12-07T21:02:17: >Iteration 2: -logL=135274.474, Lambda=1.0e-04, delta=0.001, max(|grad|)=-0.009463 [Index:7]  
151 - 2015-12-07T21:02:17:  
152 - ...  
153 - 2015-12-07T21:02:17: +=========================================+  
154 - 2015-12-07T21:02:17: | Maximum likelihood optimisation results |  
155 - 2015-12-07T21:02:17: +=========================================+  
156 - 2015-12-07T21:02:17: === GOptimizerLM ===  
157 - 2015-12-07T21:02:17: Optimized function value ..: 135274.474  
158 - 2015-12-07T21:02:17: Absolute precision ........: 0.005  
159 - 2015-12-07T21:02:17: Acceptable value decrease .: 2  
160 - 2015-12-07T21:02:17: Optimization status .......: converged  
161 - 2015-12-07T21:02:17: Number of parameters ......: 10  
162 - 2015-12-07T21:02:17: Number of free parameters .: 4  
163 - 2015-12-07T21:02:17: Number of iterations ......: 2  
164 - 2015-12-07T21:02:17: Lambda ....................: 1e-05  
165 - 2015-12-07T21:02:17: Maximum log likelihood ....: -135274.474  
166 - 2015-12-07T21:02:17: Observed events (Nobs) ...: 21203.000  
167 - 2015-12-07T21:02:17: Predicted events (Npred) ..: 21202.998 (Nobs - Npred = 0.00198937)  
168 - 2015-12-07T21:02:17: === GModels ===  
169 - 2015-12-07T21:02:17: Number of models ..........: 2  
170 - 2015-12-07T21:02:17: Number of parameters ......: 10  
171 - 2015-12-07T21:02:17: === GModelSky ===  
172 - 2015-12-07T21:02:17: Name ......................: Crab  
173 - 2015-12-07T21:02:17: Instruments ...............: all  
174 - 2015-12-07T21:02:17: Instrument scale factors ..: unity  
175 - 2015-12-07T21:02:17: Observation identifiers ...: all  
176 - 2015-12-07T21:02:17: Model type ................: PointSource  
177 - 2015-12-07T21:02:17: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"  
178 - 2015-12-07T21:02:17: Number of parameters ......: 6  
179 - 2015-12-07T21:02:17: Number of spatial par's ...: 2  
180 - 2015-12-07T21:02:17: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)  
181 - 2015-12-07T21:02:17: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)  
182 - 2015-12-07T21:02:17: Number of spectral par's ..: 3  
183 - 2015-12-07T21:02:17: Prefactor ................: 5.81583e-16 +/- 1.01727e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)  
184 - 2015-12-07T21:02:17: Index ....................: -2.50611 +/- 0.0153542 [-0,-5] (free,scale=-1,gradient)  
185 - 2015-12-07T21:02:17: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
186 - 2015-12-07T21:02:17: Number of temporal par's ..: 1  
187 - 2015-12-07T21:02:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)  
188 - 2015-12-07T21:02:17: === GCTAModelIrfBackground ===  
189 - 2015-12-07T21:02:17: Name ......................: CTABackgroundModel  
190 - 2015-12-07T21:02:17: Instruments ...............: CTA  
191 - 2015-12-07T21:02:17: Instrument scale factors ..: unity  
192 - 2015-12-07T21:02:17: Observation identifiers ...: all  
193 - 2015-12-07T21:02:17: Model type ................: "PowerLaw" * "Constant"  
194 - 2015-12-07T21:02:17: Number of parameters ......: 4  
195 - 2015-12-07T21:02:17: Number of spectral par's ..: 3  
196 - 2015-12-07T21:02:17: Prefactor ................: 0.990866 +/- 0.0136406 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)  
197 - 2015-12-07T21:02:17: Index ....................: 0.00536014 +/- 0.00839916 [-5,5] (free,scale=1,gradient)  
198 - 2015-12-07T21:02:17: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)  
199 - 2015-12-07T21:02:17: Number of temporal par's ..: 1  
200 - 2015-12-07T21:02:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 145 +.. code-block:: none
  146 +
  147 + 2016-06-29T16:24:44: +=================================+
  148 + 2016-06-29T16:24:44: | Maximum likelihood optimisation |
  149 + 2016-06-29T16:24:44: +=================================+
  150 + 2016-06-29T16:24:45: >Iteration 0: -logL=137562.094, Lambda=1.0e-03
  151 + 2016-06-29T16:24:45: >Iteration 1: -logL=137560.613, Lambda=1.0e-03, delta=1.481, max(|grad|)=2.548241 [Index:7]
  152 + 2016-06-29T16:24:45: >Iteration 2: -logL=137560.613, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.027191 [Index:3]
  153 + ...
  154 + 2016-06-29T16:24:45: +=========================================+
  155 + 2016-06-29T16:24:45: | Maximum likelihood optimisation results |
  156 + 2016-06-29T16:24:45: +=========================================+
  157 + 2016-06-29T16:24:45: === GOptimizerLM ===
  158 + 2016-06-29T16:24:45: Optimized function value ..: 137560.613
  159 + 2016-06-29T16:24:45: Absolute precision ........: 0.005
  160 + 2016-06-29T16:24:45: Acceptable value decrease .: 2
  161 + 2016-06-29T16:24:45: Optimization status .......: converged
  162 + 2016-06-29T16:24:45: Number of parameters ......: 10
  163 + 2016-06-29T16:24:45: Number of free parameters .: 4
  164 + 2016-06-29T16:24:45: Number of iterations ......: 2
  165 + 2016-06-29T16:24:45: Lambda ....................: 1e-05
  166 + 2016-06-29T16:24:45: Maximum log likelihood ....: -137560.613
  167 + 2016-06-29T16:24:45: Observed events (Nobs) ...: 21604.000
  168 + 2016-06-29T16:24:45: Predicted events (Npred) ..: 21603.998 (Nobs - Npred = 0.00202556)
  169 + 2016-06-29T16:24:45: === GModels ===
  170 + 2016-06-29T16:24:45: Number of models ..........: 2
  171 + 2016-06-29T16:24:45: Number of parameters ......: 10
  172 + 2016-06-29T16:24:45: === GModelSky ===
  173 + 2016-06-29T16:24:45: Name ......................: Crab
  174 + 2016-06-29T16:24:45: Instruments ...............: all
  175 + 2016-06-29T16:24:45: Instrument scale factors ..: unity
  176 + 2016-06-29T16:24:45: Observation identifiers ...: all
  177 + 2016-06-29T16:24:45: Model type ................: PointSource
  178 + 2016-06-29T16:24:45: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant"
  179 + 2016-06-29T16:24:45: Number of parameters ......: 6
  180 + 2016-06-29T16:24:45: Number of spatial par's ...: 2
  181 + 2016-06-29T16:24:45: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  182 + 2016-06-29T16:24:45: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  183 + 2016-06-29T16:24:45: Number of spectral par's ..: 3
  184 + 2016-06-29T16:24:45: Prefactor ................: 5.828e-16 +/- 1.0219e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  185 + 2016-06-29T16:24:45: Index ....................: -2.47546 +/- 0.0154751 [-0,-5] (free,scale=-1,gradient)
  186 + 2016-06-29T16:24:45: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  187 + 2016-06-29T16:24:45: Number of temporal par's ..: 1
  188 + 2016-06-29T16:24:45: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  189 + 2016-06-29T16:24:45: === GCTAModelIrfBackground ===
  190 + 2016-06-29T16:24:45: Name ......................: CTABackgroundModel
  191 + 2016-06-29T16:24:45: Instruments ...............: CTA
  192 + 2016-06-29T16:24:45: Instrument scale factors ..: unity
  193 + 2016-06-29T16:24:45: Observation identifiers ...: all
  194 + 2016-06-29T16:24:45: Model type ................: "PowerLaw" * "Constant"
  195 + 2016-06-29T16:24:45: Number of parameters ......: 4
  196 + 2016-06-29T16:24:45: Number of spectral par's ..: 3
  197 + 2016-06-29T16:24:45: Prefactor ................: 1.0132 +/- 0.0138017 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient)
  198 + 2016-06-29T16:24:45: Index ....................: 0.00653002 +/- 0.00831374 [-5,5] (free,scale=1,gradient)
  199 + 2016-06-29T16:24:45: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient)
  200 + 2016-06-29T16:24:45: Number of temporal par's ..: 1
  201 + 2016-06-29T16:24:45: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)