Commit 9e8cbd09fae2b8de908016038bc6c09c76477e78

Authored by Jürgen Knödlseder
2 parents 6c62c91c 726a20c1

Merge branch 'doxylink' into integration

Showing 33 changed files with 115 additions and 1273 deletions
.gitignore
... ... @@ -39,7 +39,7 @@ depcomp
39 39 test-driver
40 40 testconf.sh
41 41  
42   -doc/html/doxygen
  42 +doc/html
43 43 doc/man
44 44 src/ctools-setup
45 45 pyext/build/
... ... @@ -61,20 +61,3 @@ test/test_cscripts.sh
61 61 examples/*.fits
62 62 examples/*.xml
63 63 examples/*.dat
64   -
65   -# Sphinx stuff
66   -doc/html/.buildinfo
67   -doc/html/.doctrees/
68   -doc/html/_sources/
69   -doc/html/_static/
70   -doc/html/_images/
71   -doc/html/contents.html
72   -doc/html/develop.html
73   -doc/html/download.html
74   -doc/html/genindex.html
75   -doc/html/objects.inv
76   -doc/html/search.html
77   -doc/html/searchindex.js
78   -doc/html/test.html
79   -doc/html/index.html
80   -doc/html/user_manual/
... ...
doc/Doxyfile
... ... @@ -1553,7 +1553,7 @@ TAGFILES =
1553 1553 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
1554 1554 # a tag file that is based on the input files it reads.
1555 1555  
1556   -GENERATE_TAGFILE =
  1556 +GENERATE_TAGFILE = doc/html/doxygen/ctools.tag
1557 1557  
1558 1558 # If the ALLEXTERNALS tag is set to YES all external classes will be listed
1559 1559 # in the class index. If set to NO only the inherited external classes
... ...
doc/html/documentation.html deleted
1   -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2   -<html><head>
3   -<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Documentation</title>
4   -
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6   -</head>
7   -<body>
8   -<p class="Header">Documentation</p>
9   -<br>
10   -<p style="padding-top: 0pt; text-align: left;" class="Title">ctools
11   -references
12   -</p>
13   -<ul class="Body">
14   -<li><a href="doc/ctbin.html">ctbin</a></li>
15   -<li><a href="doc/ctlike.html">ctlike</a></li>
16   -<li><a href="doc/ctmodel.html">ctmodel</a></li>
17   -<li><a href="doc/ctobssim.html">ctobssim</a></li>
18   -<li><a href="doc/ctselect.html">ctselect</a></li>
19   -<li><a href="doc/ctskymap.html">ctskymap</a></li>
20   -</ul>
21   -<br>
22   -<p style="padding-top: 0pt; text-align: left;" class="Title">cscripts
23   -references
24   -</p>
25   -<ul class="Body">
26   -<li><a href="doc/cspull.html">cspull</a></li>
27   -<li><a href="doc/cssens.html">cssens</a></li>
28   -<li><a href="doc/cstsdist.html">cstsdist</a></li>
29   -</ul>
30   -<br>
31   -<hr size="1">
32   -<p class="Body">Last updated by: J&uuml;rgen
33   -Kn&ouml;dlseder (21 December 2012)
34   -</p>
35   -</body></html>
36 0 \ No newline at end of file
doc/html/home.html deleted
1   -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2   -<html><head>
3   -<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Home</title>
4   -
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6   -</head>
7   -<body>
8   -<p class="Header">ctools</p>
9   -<p style="padding-top: 0pt; text-align: left;" class="Body">ctools
10   -are a set of ftools-like executables needed for the scientific analysis
11   -of Cherenkov Telescope Array data. ctools is also a Python module
12   -that allows for interactive data analysis and building of analysis
13   -scripts and pipelines. ctools includes also an observation simulator
14   -to enable the scientific simulation of future CTA observations.</p>
15   -<br>
16   -<p style="padding-top: 0pt; text-align: left;" class="Body">ctools
17   -are based on <a href="http://gammalib.sourceforge.net/" target="_blank">GammaLib</a>, a versatile toolbox for
18   -the high-level analysis of astronomical gamma-ray data. Besides CTA,
19   -GammaLib supports also the analysis of Fermi-LAT data, and extensions
20   -to support further gamma-ray instruments are planned. This enables a
21   -simultaneous and coherent multi-instrument analysis of high-energy
22   -sources in the Universe.</p>
23   -<br>
24   -<p style="padding-top: 0pt; text-align: left;" class="Body">ctools
25   -and GammaLib is free software distributed under the <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">GPL
26   -license version 3</a>. </p>
27   -<br>
28   -<table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
29   -<tbody>
30   -<tr>
31   -<td style="text-align: center;"></td>
32   -<td style="text-align: center; width: 600px;" class="Body"><img style="width: 600px; height: 498px;" alt="Example simulation" src="images/survey-pop2.jpg"><br>
33   -Simulation
34   -of galactic plane scan (Dubus et al. 2012).</td>
35   -<td style="text-align: center;"></td>
36   -</tr>
37   -</tbody>
38   -</table>
39   -<br>
40   -<hr size="1">
41   -<p class="Body">Last updated by: J&uuml;rgen
42   -Kn&ouml;dlseder (4 April 2012)<br>
43   -</p>
44   -</body></html>
45 0 \ No newline at end of file
doc/html/images/cntmap-fits.jpg deleted

47 KB

doc/html/images/cntmap-map.jpg deleted

22.7 KB

doc/html/images/dskeys.jpg deleted

99.6 KB

doc/html/installation.html deleted
1   -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2   -<html><head>
3   -<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Installation</title>
4   -
5   -<link href="ctools.css" media="screen,print" type="text/css" rel="stylesheet"></head>
6   -<body>
7   -<p class="Header">Installation</p>
8   -<p style="padding-top: 0pt; text-align: left;" class="Body">
9   -<a href="#Step_1:_Install_GammaLib">Step 1: Install
10   -GammaLib</a>
11   -</p>
12   -<p style="padding-top: 0pt; text-align: left;" class="Body">
13   -<a href="#Step_2:_Setup_GammaLib_environment">Step 2:
14   -Setup
15   -GammaLib environment</a>
16   -</p>
17   -<p style="padding-top: 0pt; text-align: left;" class="Body">
18   -<a href="#Step_3:_Install_ctatools">Step 3: Install
19   -ctools</a>
20   -</p>
21   -<p style="padding-top: 0pt; text-align: left;" class="Body">
22   -<a href="#Step_4:_Setup_ctatools_environment">Step 4:
23   -Setup
24   -ctools environment</a>
25   -</p>
26   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Known_Problems">Known Problems</a></p>
27   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Getting_Help">Getting Help</a></p>
28   -<br>
29   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-weight: bold;">
30   -Note:</span> These installation instructions apply to
31   -<span style="font-family: Courier New,Courier,monospace;">ctools-00-04-00</span>
32   -or later.
33   -</p>
34   -<br>
35   -<p class="Title"><a name="Step_1:_Install_GammaLib"></a>Step
36   -1: Install GammaLib</p>
37   -<p style="padding-top: 0pt; text-align: left;" class="Body">ctools
38   -depends on GammaLib and thus GammaLib needs to be installed on your
39   -system prior to installing ctools. If you do not have GammaLib
40   -installed, or if you need to upgrade GammaLib, fetch the latest copy
41   -from <a href="https://sourceforge.net/projects/gammalib/" target="_blank">https://sourceforge.net/projects/gammalib/</a>
42   -and
43   -follow the GammaLib installation instructions on
44   -<a href="http://gammalib.sourceforge.net/" target="_blank">http://gammalib.sourceforge.net/</a>.
45   -<br>
46   -<br>
47   -</p>
48   -<p class="Title"><a name="Step_2:_Setup_GammaLib_environment"></a>Step
49   -2: Setup GammaLib environment</p>
50   -<p style="padding-top: 0pt; text-align: left;" class="Body">Before
51   -building and installing ctools, you have to configure GammaLib by
52   -setting up some
53   -environment variables.
54   -This will be done automatically by an initialisation script that is
55   -found in the <span style="font-family: Courier New,Courier,monospace;">bin</span>
56   -directory of the GammaLib directory (we call here "GammaLib
57   -directory"&nbsp;the directory into which GammaLib has been
58   -installed). Assuming that you have installed GammaLib in the default
59   -directory
60   -<span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma</span>
61   -you need to add the following to your <span style="font-family: Courier New,Courier,monospace;">$HOME/.bashrc</span>
62   -or <span style="font-family: Courier New,Courier,monospace;">$HOME/.profile</span>
63   -script on a Linux
64   -machine:
65   -</p>
66   -<p class="Code">export GAMMALIB=/usr/local/gamma<br>
67   -source $GAMMALIB/bin/gammalib-init.sh
68   -</p>
69   -<p style="padding-top: 0pt; text-align: left;" class="Body">If
70   -you use C shell or a variant then add the following to your
71   -<span style="font-family: Courier New,Courier,monospace;">$HOME/.cshrc</span>
72   -or <span style="font-family: Courier New,Courier,monospace;">$HOME/.tcshrc</span>
73   -script:
74   -</p>
75   -<p class="Code">setenv GAMMALIB /usr/local/gamma<br>
76   -source $GAMMALIB/bin/gammalib-init.csh </p>
77   -<br>
78   -<br>
79   -<p class="Title"><a name="Step_3:_Install_ctatools"></a>Step
80   -3: Install ctools</p>
81   -<p style="padding-top: 0pt; text-align: left;" class="Body">After
82   -downloading the ctools tarball, save it in an appropriate location
83   -(for example <span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma/src</span>),
84   -and type</p>
85   -<p class="Code">
86   -&gt; tar xvfz ctools-00-04-00.tar.gz
87   -</p>
88   -<p style="padding-top: 0pt; text-align: left;" class="Body">Step
89   -in the created directory using
90   -</p>
91   -<p class="Code">
92   -&gt; cd ctools-00-04-00
93   -</p>
94   -<p style="padding-top: 0pt; text-align: left;" class="Body">
95   -and build and install ctools by typing</p>
96   -<p class="Code">
97   -&gt; ./configure<br>
98   -&gt; make<br>
99   -&gt; make check<br>
100   -&gt; make install
101   -</p>
102   -<p style="padding-top: 0pt; text-align: left;" class="Body">
103   -at the operating system prompt.
104   -The <span style="font-family: Courier New,Courier,monospace;">./configure</span>
105   -command customizes the Makefiles for the particular
106   -system,
107   -the <span style="font-family: Courier New,Courier,monospace;">make</span>
108   -command compiles the source files and builds the executables, the the <span style="font-family: Courier New,Courier,monospace;">make
109   -check</span> command performs a system test, and
110   -the <span style="font-family: Courier New,Courier,monospace;">make
111   -install</span> command installs the executables in the <span style="font-family: Courier New,Courier,monospace;">bin</span>
112   -directory.
113   -Type <span style="font-family: Courier New,Courier,monospace;">./configure</span>
114   -and not simply <span style="font-family: Courier New,Courier,monospace;">configure</span>
115   -to ensure that the
116   -configuration
117   -script in the current directory is run and not some other system-wide
118   -configuration
119   -script.&nbsp;</p>
120   -<br>
121   -<p style="padding-top: 0pt; text-align: left;" class="Body">By
122   -default, the install directory is set to
123   -<span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma</span>.
124   -To change the install directory, an optional <span style="font-family: Courier New,Courier,monospace;">--prefix</span>
125   -argument should be
126   -given,
127   -for example:
128   -</p>
129   -<p class="Code">
130   -&gt; ./configure --prefix=/usr/local
131   -</p>
132   -<p style="padding-top: 0pt; text-align: left;" class="Body">A
133   -full list of configuration options can be found using</p>
134   -<p class="Code">
135   -&gt; ./configure --help
136   -</p>
137   -<br>
138   -<br>
139   -<p class="Title"><a name="Step_4:_Setup_ctatools_environment"></a>Step
140   -4: Setup ctools environment</p>
141   -<p style="padding-top: 0pt; text-align: left;" class="Body">If ctools have been installed in the same directory as GammaLib (which is
142   -the default configuration for ctools) you are done.</p>
143   -<br>
144   -<p style="padding-top: 0pt; text-align: left;" class="Body">If
145   -you decided to install ctools in a different directory, you have to
146   -configure ctools by
147   -setting up some
148   -environment variables.
149   -This will be done automatically by an initialisation script that is
150   -found in the <span style="font-family: Courier New,Courier,monospace;">bin</span>
151   -directory of the directory into which ctools has been installed.
152   -Assuming that you have installed ctools into
153   -<span style="font-family: Courier New,Courier,monospace;">/usr/local/ctools</span>
154   -you need to add the following to your <span style="font-family: Courier New,Courier,monospace;">$HOME/.bashrc</span>
155   -or <span style="font-family: Courier New,Courier,monospace;">$HOME/.profile</span>
156   -script on a Linux
157   -machine:
158   -</p>
159   -<p class="Code">export CTOOLS=/usr/local/ctools<br>
160   -source $CTOOLS/bin/ctools-init.sh
161   -</p>
162   -<p style="padding-top: 0pt; text-align: left;" class="Body">If
163   -you use C shell or a variant then add the following to your
164   -<span style="font-family: Courier New,Courier,monospace;">$HOME/.cshrc</span>
165   -or <span style="font-family: Courier New,Courier,monospace;">$HOME/.tcshrc</span>
166   -script:
167   -</p>
168   -<p class="Code">setenv CTOOLS /usr/local/ctools<br>
169   -source $CTOOLS/bin/ctools-init.csh </p>
170   -<br>
171   -<br>
172   -<p class="Title"><a name="Known_Problems"></a>Known
173   -Problems</p>
174   -<p style="padding-top: 0pt; text-align: left;" class="Body">
175   -<span style="font-weight: bold; font-size: 14px;">Python
176   -support</span>
177   -<br>
178   -ctools comes with Python wrappers so that all classes can be
179   -directly used from Python. To compile-in Python support, ctools
180   -needs the <span style="font-family: Courier New,Courier,monospace;">Python.h</span>
181   -header file, which on many distributions is not
182   -installed by default.
183   -To make <span style="font-family: Courier New,Courier,monospace;">Python.h</span>
184   -available, install the Python developer package
185   -in your distribution. Otherwise you will not be able to use ctools
186   -from Python.
187   -</p>
188   -<br>
189   -<p style="padding-top: 0pt; text-align: left;" class="Body">
190   -<span style="font-weight: bold; font-size: 14px;">Mac OS X</span>
191   -<br>
192   -The Python development package is not installed as default on Mac
193   -OS X, and consequently, the <span style="font-family: Courier New,Courier,monospace;">Python.h</span>
194   -header file is missing that is
195   -needed to compile in the Python bindings. The <span style="font-family: Courier New,Courier,monospace;">configure</span>
196   -script recognises this fact and adjust the build procedure accordingly,
197   -but you
198   -will not be able to use ctools from Python. So better install the
199   -Python development package before installing ctools.</p>
200   -<p style="padding-top: 0pt; text-align: left;" class="Body">It
201   -was also reported that adding of&nbsp;<span style="font-family: Courier New,Courier,monospace;">export
202   -MACOSX_DEPLOYMENT_TARGET=10.6</span> to the <span style="font-family: Courier New,Courier,monospace;">.bashrc</span>
203   -file was necessary one
204   -some Mac OS X 10.6 installations to make ctools compile.<br>
205   -</p>
206   -<br>
207   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-weight: bold; font-size: 14px;">Solaris</span>
208   -<br>
209   -Although ctools builds on Solaris using the Sun compiler, there are
210   -problems with global symbols in shared libraries and exception
211   -catching, which prevents the FITS interface to work
212   -correctly. ctools has however been built and tested successfully
213   -using the GNU
214   -compiler, and this is the only build method that is currently
215   -supported.
216   -Problems have also been encountered when compiling cfitsio versions
217   -more recent than 3.250. The problems have been reported to the cfitsio
218   -developer team, and are likely to be solved in the future. For the
219   -time being, it is recommended to use cfitsio version 3.250 on Solaris.
220   -</p>
221   -<br>
222   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-weight: bold; font-size: 14px;">OpenSolaris</span>
223   -<br>
224   -On OpenSolaris, the same problems concerning the SunStudio compiler
225   -occur as for Solaris, and also here, the GNU compiler is the
226   -recommended
227   -tool to build ctools. Also here, cfitsio version 3.250 is the
228   -recommended library as more recent version feature relocation
229   -problems. ctools has been tested using gcc 4.3.2 on OpenSolaris
230   -2009.06. Make sure to create the symbolic links
231   -</p>
232   -<p class="Code">ln -s /usr/bin/gcc4.3.2 /usr/bin/gcc<br>
233   -ln -s /usr/bin/g++4.3.2 /usr/bin/g++</p>
234   -<p style="padding-top: 0pt; text-align: left;" class="Body">
235   -which are not there by default to avoid excess warnings during
236   -compilation.
237   -</p>
238   -<br>
239   -<br>
240   -<p class="Title"><a name="Getting_Help"></a>Getting
241   -Help</p>
242   -<p style="padding-top: 0pt; text-align: left;" class="Body">
243   -Any questions, bug reports, or suggested enhancements related to ctools should be submitted to
244   -<a href="mailto:knodlseder@cesr.fr">knodlseder@cesr.fr</a>.
245   -</p>
246   -<br>
247   -<hr size="1">
248   -<p class="Body">Last updated by: J&uuml;rgen
249   -Kn&ouml;dlseder (4 April 2012)
250   -</p>
251   -</body></html>
252 0 \ No newline at end of file
doc/html/quickstart.html deleted
1   -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2   -<html><head>
3   -<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Getting Started</title>
4   -
5   -<link href="ctools.css" media="screen,print" type="text/css" rel="stylesheet">
6   -</head>
7   -<body>
8   -<p class="Header">Getting started</p>
9   -<p class="Title">First steps with ctools</p>
10   -<p style="padding-top: 0pt; text-align: left;" class="Body">
11   -This page gives provides a step-by-step description of the CTA data
12   -analysis procedure implemented in ctools. In this example we will
13   -simulate data for the Crab nebula, observed on-axis, as a single source
14   -in the CTA field of view.</p>
15   -<br>
16   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
17   -example consists of the following analysis steps:</p>
18   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Simulating_CTA_data">Simulating CTA data</a></p>
19   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Binning_CTA_data">Binning CTA data</a></p>
20   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Fitting_CTA_data">Fitting CTA data</a></p>
21   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Doing_an_unbinned_analysis">Doing an unbinned analysis</a></p>
22   -<br>
23   -<p style="padding-top: 0pt; text-align: left;" class="Body">And
24   -please read also:
25   -</p>
26   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Some_final_remarks">Some final remarks</a></p>
27   -<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Getting_Help">Getting Help</a></p>
28   -<br>
29   -<br>
30   -<p class="Title"><a name="Simulating_CTA_data"></a>Simulating
31   -CTA data</p>
32   -<p style="padding-top: 0pt; text-align: left;" class="Body">CTA
33   -data are simulated by the executable <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>.
34   -To start the executable, type <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
35   -at the console prompt (which is denoted by <span style="font-family: Courier New,Courier,monospace;">&gt;</span>).
36   -It will query for a number of parameters. The example shown below will
37   -work on a system that has been installed in the default directory <span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma</span>.
38   -If ctools have been installed in another directory, please adjust the
39   -parameter names accordingly.
40   -</p>
41   -<p class="Code">
42   -&gt; ctobssim<br>
43   -Model [test/data/crab_alone.xml] /usr/local/gamma/share/models/crab.xml
44   -<br>
45   -Output event data file [events.fits] <br>
46   -Calibration database [test/irf] /usr/local/gamma/share/caldb/cta<br>
47   -Instrument response function [kb_E_50h_v3] <br>
48   -RA for ROI centre (degrees) (0-360) [83.63] <br>
49   -Dec for ROI centre (degrees) (-90-90) [22.01] <br>
50   -Radius of ROI (degrees) (0-180) [10.0] <br>
51   -Start time (MET in s) (0) [0.0] <br>
52   -End time (MET in s) (0) [1800.0] <br>
53   -Lower energy limit (TeV) (0) [0.1] <br>
54   -Upper energy limit (TeV) (0) [100.0] <br>
55   -</p>
56   -<p style="padding-top: 0pt; text-align: left;" class="Body">Each
57   -line represents a query for one parameter. The line starts with a short
58   -description of the parameter, followed by the default parameter value
59   -proposed by <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
60   -in squared brackets <span style="font-family: Courier New,Courier,monospace;">[ ]</span>.
61   -If no parameter is entered (which is the case for the majority of
62   -parameters shown here), the default parameter will be used.</p>
63   -<br>
64   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
65   -CTA instrument properties (effective area, PSF width) are taken for the
66   -moment from Konrad Bernl&ouml;hrs sensitivity files which are
67   -stored in <span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma/share/caldb/cta</span>.
68   -To test another CTA configuration you may adapt the instrument response
69   -function name accordingly (see the <a href="#Some_final_remarks">final
70   -remarks</a>).</p>
71   -<br>
72   -<p style="padding-top: 0pt; text-align: left;" class="Body">Events
73   -are simulated based on the instrument properties and based on a source
74   -and background model. Only events that fall within the
75   -specified region of interest (ROI), defined as a circle around a sky
76   -position in Right Ascension and Declination (in degrees), will be
77   -stored in the output event data file. The duration of the simulation is
78   -taken here to 30 minutes (or 1800 seconds). Events are simulated for
79   -energies between 0.1 and 100 TeV.</p>
80   -<br>
81   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
82   -source and background model is defined by the XML file <span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma/share/models/crab.xml</span>:
83   -</p>
84   -<p class="Code">
85   -&lt;?xml version="1.0" standalone="no"?&gt;<br>
86   -&lt;source_library title="source library"&gt;<br>
87   -&nbsp; &lt;source name="MAGIC Crab (Albert et al. 2008, ApJ,
88   -674, 1037)" type="PointSource"&gt;<br>
89   -&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
90   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
91   -&lt;parameter name="Prefactor" scale="1e-16" value="5.7"&nbsp;
92   -min="1e-07" max="1000.0" free="1"/&gt;<br>
93   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
94   -&lt;parameter name="Index"&nbsp;&nbsp;&nbsp;&nbsp;
95   -scale="-1"&nbsp;&nbsp;&nbsp; value="2.48"
96   -min="0.0"&nbsp;&nbsp; max="+5.0"&nbsp;&nbsp;
97   -free="1"/&gt;<br>
98   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
99   -&lt;parameter name="Scale"&nbsp;&nbsp;&nbsp;&nbsp;
100   -scale="1e6"&nbsp;&nbsp; value="0.3"&nbsp;
101   -min="0.01"&nbsp; max="1000.0" free="0"/&gt;<br>
102   -&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
103   -&nbsp;&nbsp;&nbsp; &lt;spatialModel
104   -type="SkyDirFunction"&gt;<br>
105   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
106   -name="RA"&nbsp; scale="1.0" value="83.6331" min="-360" max="360"
107   -free="0"/&gt;<br>
108   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
109   -name="DEC" scale="1.0" value="22.0145" min="-90"&nbsp;
110   -max="90"&nbsp; free="0"/&gt;<br>
111   -&nbsp;&nbsp;&nbsp; &lt;/spatialModel&gt;<br>
112   -&nbsp; &lt;/source&gt;<br>
113   -&nbsp; &lt;source name="Background" type="RadialAcceptance"
114   -instrument="CTA"&gt;<br>
115   -&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
116   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
117   -&lt;parameter name="Prefactor" scale="1e-6" value="61.8"
118   -min="0.0"&nbsp; max="1000.0" free="1"/&gt;<br>
119   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
120   -&lt;parameter name="Index"&nbsp;&nbsp;&nbsp;&nbsp;
121   -scale="-1"&nbsp;&nbsp; value="1.85" min="0.0"&nbsp;
122   -max="+5.0"&nbsp;&nbsp; free="1"/&gt;<br>
123   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
124   -&lt;parameter name="Scale"&nbsp;&nbsp;&nbsp;&nbsp;
125   -scale="1e6"&nbsp; value="1.0"&nbsp; min="0.01" max="1000.0"
126   -free="0"/&gt;<br>
127   -&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
128   -&nbsp;&nbsp;&nbsp; &lt;radialModel
129   -type="Gaussian"&gt;<br>
130   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
131   -&lt;parameter name="Sigma" scale="1.0" value="3.0" min="0.01"
132   -max="10.0" free="1"/&gt;<br>
133   -&nbsp;&nbsp;&nbsp; &lt;/radialModel&gt;<br>
134   -&nbsp; &lt;/source&gt;<br>
135   -&lt;/source_library&gt;
136   -</p>
137   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
138   -model consists of a source library that contains 2
139   -"sources":&nbsp;the Crab nebula and an instrumental background
140   -model.</p>
141   -<br>
142   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
143   -Crab nebula is modelled by a factorized sky model that has a spectral
144   -and a spatial component (tags <span style="font-family: Courier New,Courier,monospace;">&lt;spectrum&gt;</span>
145   -and <span style="font-family: Courier New,Courier,monospace;">&lt;spatialModel&gt;</span>,
146   -respectively). The spectrum is modelled by a power law, which is
147   -defined by 3 parameters: the <span style="font-family: Courier New,Courier,monospace;">Prefactor</span>,
148   -the <span style="font-family: Courier New,Courier,monospace;">Index</span>
149   -and the <span style="font-family: Courier New,Courier,monospace;">Scale</span>.
150   -The spatial model has 2 parameters: Right Ascension in degrees (<span style="font-family: Courier New,Courier,monospace;">RA</span>),
151   -and Declination in degrees (<span style="font-family: Courier New,Courier,monospace;">DEC</span>).
152   -Each parameter has a <span style="font-family: Courier New,Courier,monospace;">value</span>
153   -and a <span style="font-family: Courier New,Courier,monospace;">scale</span>
154   -factor, the real value of the parameter being the product <span style="font-family: Courier New,Courier,monospace;">value *
155   -scale</span>. Typically, <span style="font-family: Courier New,Courier,monospace;">scale</span>
156   -is chosen so that <span style="font-family: Courier New,Courier,monospace;">value</span>
157   -is of the order of 1 (this is relevant for model fitting later). In
158   -addition,&nbsp;<span style="font-family: Courier New,Courier,monospace;">value</span>
159   -is bound by a minimum (<span style="font-family: Courier New,Courier,monospace;">min</span>)
160   -and maximum (<span style="font-family: Courier New,Courier,monospace;">max</span>)
161   -value, and a parameter may be free (<span style="font-family: Courier New,Courier,monospace;">free="1"</span>)
162   -or fixed (<span style="font-family: Courier New,Courier,monospace;">free="0"</span>).
163   -The <span style="font-family: Courier New,Courier,monospace;">min</span>,
164   -<span style="font-family: Courier New,Courier,monospace;">max</span>,
165   -and <span style="font-family: Courier New,Courier,monospace;">free</span>
166   -attributes are not relevant here for the simulations, but they will be
167   -important for the model fitting later.</p>
168   -<br>
169   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
170   -spectral intensity <span style="font-family: Courier New,Courier,monospace;">I(E)</span>
171   -(in units of photons/cm2/s/MeV) of the power law is given by&nbsp;</p>
172   -<p style="padding-top: 0pt; text-align: center; font-family: Courier New,Courier,monospace;" class="Body">I(E) = Prefactor * (E/Scale)^Index</p>
173   -<p style="padding-top: 0pt; text-align: left;" class="Body">where
174   -the <span style="font-family: Courier New,Courier,monospace;">E</span>
175   -and <span style="font-family: Courier New,Courier,monospace;">Scale</span>
176   -are given in MeV.</p>
177   -<br>
178   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
179   -instrumental background of CTA is modelled by a factorized data model
180   -that has a spectral and a radial component (tags <span style="font-family: Courier New,Courier,monospace;">&lt;spectrum&gt;</span>
181   -and <span style="font-family: Courier New,Courier,monospace;">&lt;radialModel&gt;</span>,
182   -respectively). The spectral component describes the <span style="font-weight: bold;">on-axis background
183   -counting rate</span> of CTA as function of energy in units of
184   -counts/s/sr/TeV.
185   -The radial component describes the variation of the background rate
186   -with <span style="font-weight: bold;">offset angle squared</span>,
187   -(i.e.&nbsp;square of the offset angle with respect to the pointing
188   -direction) which is modelled here by a Gaussian. The only parameter of
189   -the radial component is the width of the Gaussian <span style="font-family: Courier New,Courier,monospace;">Sigma</span>,
190   -which is here set to 3 degrees squared.</p>
191   -<br>
192   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
193   -has a couple of hidden parameters, the most important one being
194   -certainly <span style="font-family: Courier New,Courier,monospace;">seed</span>.
195   -<span style="font-family: Courier New,Courier,monospace;">seed</span>
196   -is an integer that specifies the seed value for the random number
197   -generator, and changing this parameter will allow to generate
198   -statistically independent Monte Carlo samples of CTA event data. To
199   -use for example a seed value of 41 one should type:
200   -</p>
201   -<p class="Code">&gt; ctobssim seed=41<br>
202   -</p>
203   -<p style="padding-top: 0pt; text-align: left;" class="Body">
204   -<span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
205   -will write 2 files in the working directory: <span style="font-family: Courier New,Courier,monospace;">events.fits</span>
206   -and <span style="font-family: Courier New,Courier,monospace;">ctobssim.log</span>.
207   -The first file contains the simulated events in FITS format and can be
208   -inspected using <a href="http://heasarc.gsfc.nasa.gov/docs/software/ftools/fv/" target="_blank"><span style="font-family: Courier New,Courier,monospace;">fv</span></a>
209   -or <a href="http://hea-www.harvard.edu/RD/ds9/" target="_blank"><span style="font-family: Courier New,Courier,monospace;">ds9</span></a>.
210   -The FITS file will contain 3 extensions: an empty primary image, a
211   -binary table named <span style="font-family: Courier New,Courier,monospace;">EVENTS</span>
212   -that holds the events (one row per event), and a binary table named <span style="font-family: Courier New,Courier,monospace;">GTI</span>
213   -holding the Good Time Interval (for the moment a single row with 2
214   -columns providing the start and the stop time of the simulated time
215   -interval).</p>
216   -<br>
217   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
218   -second file produced by <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
219   -is a human readable log file that contains information about
220   -the job execution. As example, the last lines from this file are shown
221   -here:</p>
222   -<p class="Code">2011-01-31T23:50:39: +==================+<br>
223   -2011-01-31T23:50:39: | Simulate photons |<br>
224   -2011-01-31T23:50:39: +==================+<br>
225   -2011-01-31T23:50:39:&nbsp; Simulated photons .........: 33943<br>
226   -2011-01-31T23:50:39:&nbsp; Simulation area ...........: 3.2e+10 cm2<br>
227   -2011-01-31T23:50:39:&nbsp; Simulation cone ...........: RA=83.63
228   -deg, Dec=22.01deg, r=10 deg<br>
229   -2011-01-31T23:50:39:&nbsp; Time interval .............: 0 s - 1800 s<br>
230   -2011-01-31T23:50:39:&nbsp; Energy range ..............: 100 GeV -
231   -100 TeV<br>
232   -2011-01-31T23:50:39:&nbsp; Random number seed ........: 1<br>
233   -2011-01-31T23:50:39: <br>
234   -2011-01-31T23:50:39: +=================+<br>
235   -2011-01-31T23:50:39: | Simulate events |<br>
236   -2011-01-31T23:50:39: +=================+<br>
237   -2011-01-31T23:50:39:&nbsp; MC source events ..........: 649<br>
238   -2011-01-31T23:50:39:&nbsp; MC background events ......: 3407<br>
239   -2011-01-31T23:50:39: <br>
240   -2011-01-31T23:50:39: +==========================+<br>
241   -2011-01-31T23:50:39: | Save events in FITS file |<br>
242   -2011-01-31T23:50:39: +==========================+<br>
243   -2011-01-31T23:50:39: <br>
244   -2011-01-31T23:50:39: Application "ctobssim" terminated after consuming
245   -14 seconds of CPU time.<br>
246   -<br>
247   -</p>
248   -<p style="padding-top: 0pt; text-align: left;" class="Body">Each
249   -line starts with the UTC time at which the line has been written. In
250   -this
251   -run, 33943 Crab photons have been thrown over an area of 3.2 square
252   -kilometres during a time interval of 1800 seconds. 649 of these photons
253   -have been registered by CTA as events. In the same time
254   -interval, 3407 background events have been registred by CTA.</p>
255   -<br>
256   -<br>
257   -<p class="Title"><a name="Binning_CTA_data"></a>Binning
258   -CTA data</p>
259   -<p style="padding-top: 0pt; text-align: left;" class="Body">
260   -As next analysis step the data are binned in a counts map using the
261   -executable <span style="font-family: Courier New,Courier,monospace;">ctbin</span>.
262   -A counts map is a 3 dimensional data cube, spanned by Right Ascension
263   -(or Galactic longitude), Declination (or Galactic latitude), and the
264   -logarithm (base 10) of energy.</p>
265   -<br>
266   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctbin</span>
267   -is executed by typing:</p>
268   -<p class="Code">
269   -&gt; ctbin<br>
270   -Event data file name [test/data/crab_events.fits.gz] events.fits<br>
271   -Output file name [cntmap.fits] <br>
272   -Start value for first energy bin in TeV [0.1] <br>
273   -Stop value for last energy bin in TeV [100.0] <br>
274   -Number of energy bins [20] <br>
275   -Projection method e.g. AIT|ARC|CAR|GLS|MER|NCP|SIN|STG|TAN [CAR] <br>
276   -Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] <br>
277   -First coordinate of image center in degrees (RA or galactic l) [83.63] <br>
278   -Second coordinate of image center in degrees (DEC or galactic b)
279   -[22.01] <br>
280   -Image scale (in degrees/pixel) [0.02] <br>
281   -Size of the X axis in pixels [200] <br>
282   -Size of the Y axis in pixels [200] </p>
283   -<p style="padding-top: 0pt; text-align: left;" class="Body">
284   -In this example we adjust the event data file name and accept all the
285   -remaining parameter defaults as they perfectly
286   -satisfy our needs. The counts map will be centred on the location of
287   -the Crab (Right Ascension 83.63 degrees, Declination 22.01 degrees) and
288   -will be aligned in celestial coordinates. A cartesian projection has
289   -been selected (<span style="font-weight: bold;">note that
290   -the cartesian projection is the only valid project available for the
291   -moment</span>). The counts map has 200 x 200
292   -spatial pixels of 0.02 x 0.02 degrees in size, hence it covers a total
293   -area of 4 x 4 degrees.</p>
294   -<br>
295   -<p style="padding-top: 0pt; text-align: left;" class="Body">A
296   -set of 20 counts maps will be created, which are logarithmically spaced
297   -in energy, and which cover the energy range from 0.1 TeV to 100 TeV. In
298   -this example, the counts map will be saved as <span style="font-family: Courier New,Courier,monospace;">cntmap.fits</span>
299   -in the
300   -working directory.
301   -In addition to the counts map, that is stored as the primary image
302   -extension, the FITS
303   -file also contains an extension named <span style="font-family: Courier New,Courier,monospace;">EBOUNDS</span>
304   -that defines the energy boundaries that were used, and an extension <span style="font-family: Courier New,Courier,monospace;">GTI</span>
305   -that defines the Good Time Intervals that have been used. The following
306   -image shows the resulting FITS file. The <span style="font-family: Courier New,Courier,monospace;">EBOUNDS</span>
307   -table has 20 rows, one for each energy bin, while the <span style="font-family: Courier New,Courier,monospace;">GTI</span>
308   -table has jusr a single row, indicating the start and stop time of the
309   -simulated data.</p>
310   -<br>
311   -<div style="text-align: center;"><img alt="CTA counts map FITS file" src="images/cntmap-fits.jpg"><br>
312   -</div>
313   -<br>
314   -<p style="padding-top: 0pt; text-align: left;" class="Body">An
315   -image
316   -of the first bin, covering the energy range 100 -&nbsp;141 GeV, is
317   -shown below:
318   -</p>
319   -<div style="text-align: center;"><img style="width: 496px; height: 518px;" alt="CTA counts map" src="images/cntmap-map.jpg"><br>
320   -</div>
321   -<br>
322   -<p style="padding-top: 0pt; text-align: left;" class="Body">For
323   -illustrating, the last few lines of the log file <span style="font-family: Courier New,Courier,monospace;">ctbin.log</span>
324   -are shown below:
325   -</p>
326   -<p class="Code">2011-02-01T09:28:05: +=========+<br>
327   -2011-02-01T09:28:05: | Binning |<br>
328   -2011-02-01T09:28:05: +=========+<br>
329   -2011-02-01T09:28:05:&nbsp; Events in list ............: 4056<br>
330   -2011-02-01T09:28:05:&nbsp; Events in map .............: 3683<br>
331   -2011-02-01T09:28:05:&nbsp; Events outside map area ...: 373<br>
332   -2011-02-01T09:28:05:&nbsp; Events outside energy bins : 0<br>
333   -2011-02-01T09:28:05: <br>
334   -2011-02-01T09:28:05: +============+<br>
335   -2011-02-01T09:28:05: | Counts map |<br>
336   -2011-02-01T09:28:05: +============+<br>
337   -2011-02-01T09:28:05: === GSkymap ===<br>
338   -2011-02-01T09:28:05:&nbsp; Number of pixels ..........: 40000<br>
339   -2011-02-01T09:28:05:&nbsp; Number of maps ............: 20<br>
340   -2011-02-01T09:28:05:&nbsp; X axis dimension ..........: 200<br>
341   -2011-02-01T09:28:05:&nbsp; Y axis dimension ..........: 200<br>
342   -2011-02-01T09:28:05: === GWcsCAR ===<br>
343   -2011-02-01T09:28:05:&nbsp; Coordinate system .........: EQU<br>
344   -2011-02-01T09:28:05:&nbsp; Reference coordinate ......: (83.63,
345   -22.01) deg<br>
346   -2011-02-01T09:28:05:&nbsp; Reference pixel ...........: (100.5,
347   -100.5)<br>
348   -2011-02-01T09:28:05:&nbsp; Increment at reference ....: (0.02,
349   -0.02) deg<br>
350   -2011-02-01T09:28:05:&nbsp; Coordinate of North Pole ..: (180, 0) deg<br>
351   -2011-02-01T09:28:05:&nbsp; CD matrix .................: [0.02 0][0
352   -0.02]<br>
353   -2011-02-01T09:28:05:&nbsp; Inverse CD matrix .........: [50 -0][-0
354   -50]<br>
355   -2011-02-01T09:28:05:&nbsp; Coordinate of native pole .: (83.63,
356   -112.01)<br>
357   -2011-02-01T09:28:05: <br>
358   -2011-02-01T09:28:05: Application "ctbin" terminated after consuming 10
359   -seconds of CPU time.
360   -</p>
361   -<p style="padding-top: 0pt; text-align: left;" class="Body">From
362   -the 4056 events that have been simulated and stored in the <span style="font-family: Courier New,Courier,monospace;">events.fits</span>
363   -file, 3683 lie within the map boundaries and are thus put into the
364   -resulting counts map. The counts map is stored in a cartesian
365   -projection in a <a href="http://fits.gsfc.nasa.gov/fits_wcs.html" target="_blank">World Coordinate System (WCS)</a>
366   -compliant format.
367   -</p>
368   -<br>
369   -<br>
370   -<p class="Title"><a name="Fitting_CTA_data"></a>Fitting
371   -CTA data</p>
372   -<p style="padding-top: 0pt; text-align: left;" class="Body">
373   -Now we are ready to fit the simulated data with a model. For simplicity
374   -we use in this example the same model that we used to simulate the data
375   -with <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>.
376   -Model fitting is done using the executable <span style="font-family: Courier New,Courier,monospace;">ctlike</span>,
377   -and we do the fit by typing:
378   -</p>
379   -<p class="Code">
380   -&gt; ctlike<br>
381   -Event list, counts map or observation definition
382   -file&nbsp;[test/data/crab_cntmap.fits.gz] cntmap.fits<br>
383   -Calibration
384   -database [test/irf] /usr/local/gamma/share/caldb/cta<br>
385   -Instrument response function [kb_E_50h_v3] <br>
386   -Source model [test/data/crab.xml] /usr/local/gamma/share/models/crab.xml<br>
387   -Source model output file [crab_results.xml]
388   -</p>
389   -<p style="padding-top: 0pt; text-align: left;" class="Body">Fitting
390   -of the data is done in <span style="font-family: Courier New,Courier,monospace;">BINNED</span>
391   -mode, which means that the events have been binned into a counts map
392   -and the fit computes the log-likelihood function by summing over all
393   -200 x 200 x 20 bins of the counts map. There is an alternative method,
394   -the so called <span style="font-family: Courier New,Courier,monospace;">UNBINNED</span>
395   -mode, where the events are not binned into a counts map and the
396   -log-likelihood is computed directly by summing over all events. We will
397   -explore
398   -the <span style="font-family: Courier New,Courier,monospace;">UNBINNED</span>
399   -mode <a href="#Doing_an_unbinned_analysis">later</a>.</p>
400   -<br>
401   -<p style="padding-top: 0pt; text-align: left;" class="Body">
402   -One of the parameters given to <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
403   -is a source model output file (we specified <span style="font-family: Courier New,Courier,monospace;">crab_results.xml</span>
404   -in the example), and this file will be a copy of the model XML file
405   -where the parameter values have been replaced by the fit results. In
406   -addition, the statistical uncertainties are added for each fitted
407   -parameter using the attribute <span style="font-family: Courier New,Courier,monospace;">error</span>.
408   -Below we show the XML result file that has been produced by the run:
409   -</p>
410   -<p class="Code">&lt;?xml version="1.0"
411   -encoding="UTF-8" standalone="no"?&gt;<br>
412   -&lt;source_library title="source library"&gt;<br>
413   -&nbsp; &lt;source name="MAGIC Crab (Albert et al. 2008, ApJ,
414   -674, 1037)" type="DiffuseSource"&gt;<br>
415   -&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
416   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
417   -name="Prefactor" value="5.7765" error="0.243328" scale="1e-16"
418   -min="1e-07" max="1000" free="1" /&gt;<br>
419   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
420   -name="Index" value="2.49937" error="0.0330191" scale="-1" min="0"
421   -max="5" free="1" /&gt;<br>
422   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
423   -name="Scale" value="0.3" scale="1e+06" min="0.01" max="1000" free="0"
424   -/&gt;<br>
425   -&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
426   -&nbsp;&nbsp;&nbsp; &lt;spatialModel
427   -type="SkyDirFunction"&gt;<br>
428   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
429   -name="RA" value="83.6331" scale="1" min="-360" max="360" free="0"
430   -/&gt;<br>
431   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
432   -name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0"
433   -/&gt;<br>
434   -&nbsp;&nbsp;&nbsp; &lt;/spatialModel&gt;<br>
435   -&nbsp; &lt;/source&gt;<br>
436   -&nbsp; &lt;source name="Background" type="RadialAcceptance"
437   -instrument="CTA"&gt;<br>
438   -&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
439   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
440   -name="Prefactor" value="61.7696" error="1.89829" scale="1e-06" min="0"
441   -max="1000" free="1" /&gt;<br>
442   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
443   -name="Index" value="1.87195" error="0.0166039" scale="-1" min="0"
444   -max="5" free="1" /&gt;<br>
445   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
446   -name="Scale" value="1" scale="1e+06" min="0.01" max="1000" free="0"
447   -/&gt;<br>
448   -&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
449   -&nbsp;&nbsp;&nbsp; &lt;radialModel
450   -type="Gaussian"&gt;<br>
451   -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
452   -name="Sigma" value="3.00467" error="0.071261" scale="1" min="0.01"
453   -max="10" free="1" /&gt;<br>
454   -&nbsp;&nbsp;&nbsp; &lt;/radialModel&gt;<br>
455   -&nbsp; &lt;/source&gt;<br>
456   -&lt;/source_library&gt;
457   -</p>
458   -<p style="padding-top: 0pt; text-align: left;" class="Body">
459   -In this example, the <span style="font-family: Courier New,Courier,monospace;">Prefactor</span>
460   -and <span style="font-family: Courier New,Courier,monospace;">Index</span>
461   -of the spectral model for the Crab as well as the <span style="font-family: Courier New,Courier,monospace;">Prefactor</span>,
462   -<span style="font-family: Courier New,Courier,monospace;">Index</span>
463   -and <span style="font-family: Courier New,Courier,monospace;">Sigma</span>
464   -parameter of the radial acceptance model have been fitted (all
465   -parameters having the attribute <span style="font-family: Courier New,Courier,monospace;">free="1"</span>
466   -are fitted).
467   -</p>
468   -<br>
469   -<p style="padding-top: 0pt; text-align: left;" class="Body">To
470   -get more details about the model fitting one can inspect the log file.
471   -Below
472   -we show the last lines of the <span style="font-family: Courier New,Courier,monospace;">ctlike.log</span>
473   -log file that has been produced by this run:
474   -</p>
475   -<p class="Code">2011-02-01T09:53:17:
476   -+=================================+<br>
477   -2011-02-01T09:53:17: | Maximum likelihood optimisation |<br>
478   -2011-02-01T09:53:17: +=================================+<br>
479   -2011-02-01T09:53:20:&nbsp; Initial iteration: func=18092.1,
480   -Lambda=0.001<br>
481   -2011-02-01T09:53:24:&nbsp; Iteration 1: func=18090, Lambda=0.0001,
482   -delta=2.08792<br>
483   -2011-02-01T09:53:27:&nbsp; Iteration 2: func=18090, Lambda=1e-05,
484   -delta=0.0021398<br>
485   -2011-02-01T09:53:30:&nbsp; Iteration 3: func=18090, Lambda=1e-06,
486   -delta=4.80215e-06<br>
487   -2011-02-01T09:53:34:&nbsp; Iteration 4: func=18090, Lambda=1e-07,
488   -delta=1.7495e-08<br>
489   -2011-02-01T09:53:37: <br>
490   -2011-02-01T09:53:37: +=========================================+<br>
491   -2011-02-01T09:53:37: | Maximum likelihood optimisation results |<br>
492   -2011-02-01T09:53:37: +=========================================+<br>
493   -2011-02-01T09:53:37: === GOptimizerLM ===<br>
494   -2011-02-01T09:53:37:&nbsp; Optimized function value ..: 18090<br>
495   -2011-02-01T09:53:37:&nbsp; Absolute precision ........: 1e-06<br>
496   -2011-02-01T09:53:37:&nbsp; Optimization status .......: converged<br>
497   -2011-02-01T09:53:37:&nbsp; Number of parameters ......: 11<br>
498   -2011-02-01T09:53:37:&nbsp; Number of free parameters .: 5<br>
499   -2011-02-01T09:53:37:&nbsp; Number of iterations ......: 4<br>
500   -2011-02-01T09:53:37:&nbsp; Lambda ....................: 1e-07<br>
501   -2011-02-01T09:53:37:&nbsp; Maximum log likelihood ....: -18090<br>
502   -2011-02-01T09:53:37:&nbsp; Npred .....................: 3683<br>
503   -2011-02-01T09:53:37: === GModels ===<br>
504   -2011-02-01T09:53:37:&nbsp; Number of models ..........: 2<br>
505   -2011-02-01T09:53:37:&nbsp; Number of parameters ......: 11<br>
506   -2011-02-01T09:53:37: === GModelPointSource ===<br>
507   -2011-02-01T09:53:37:&nbsp; Name ......................: MAGIC Crab
508   -(Albert et al. 2008, ApJ, 674, 1037)<br>
509   -2011-02-01T09:53:37:&nbsp; Instruments ...............: all<br>
510   -2011-02-01T09:53:37:&nbsp; Number of parameters ......: 6<br>
511   -2011-02-01T09:53:37:&nbsp; Number of spatial par's ...: 2<br>
512   -2011-02-01T09:53:37:&nbsp;&nbsp; RA .......................:
513   -83.6331 [-360,360] deg (fixed,scale=1)<br>
514   -2011-02-01T09:53:37:&nbsp;&nbsp; DEC ......................:
515   -22.0145 [-90,90] deg (fixed,scale=1)<br>
516   -2011-02-01T09:53:37:&nbsp; Number of spectral par's ..: 3<br>
517   -2011-02-01T09:53:37:&nbsp;&nbsp; Prefactor ................:
518   -5.7765e-16 +/- 2.43328e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16)<br>
519   -2011-02-01T09:53:37:&nbsp;&nbsp; Index ....................:
520   --2.49937 +/-&nbsp;0.0330191 [-0,-5]&nbsp; (free,scale=-1)<br>
521   -2011-02-01T09:53:37:&nbsp;&nbsp; PivotEnergy ..............:
522   -300000 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
523   -2011-02-01T09:53:37:&nbsp; Number of temporal par's ..: 1<br>
524   -2011-02-01T09:53:37:&nbsp;&nbsp; Constant .................: 1
525   -(relative value) (fixed,scale=1)<br>
526   -2011-02-01T09:53:37: === GCTAModelRadialAcceptance ===<br>
527   -2011-02-01T09:53:37:&nbsp; Name ......................: Background<br>
528   -2011-02-01T09:53:37:&nbsp; Instruments ...............: CTA<br>
529   -2011-02-01T09:53:37:&nbsp; Model type ................: "Gaussian"
530   -* "PowerLaw" * "Constant"<br>
531   -2011-02-01T09:53:37:&nbsp; Number of parameters ......: 5<br>
532   -2011-02-01T09:53:37:&nbsp; Number of radial par's ....: 1<br>
533   -2011-02-01T09:53:37:&nbsp;&nbsp; Sigma ....................:
534   -3.00467 +/- 0.071261 [0.01,10] deg2 (free,scale=1)<br>
535   -2011-02-01T09:53:37:&nbsp; Number of spectral par's ..: 3<br>
536   -2011-02-01T09:53:37:&nbsp;&nbsp; Prefactor ................:
537   -6.17696e-05 +/- 1.89829e-06 [0,0.001] ph/cm2/s/MeV (free,scale=1e-06)<br>
538   -2011-02-01T09:53:37:&nbsp;&nbsp; Index ....................:
539   --1.87195 +/-&nbsp;0.0166039 [-0,-5]&nbsp; (free,scale=-1)<br>
540   -2011-02-01T09:53:37:&nbsp;&nbsp; PivotEnergy ..............:
541   -1e+06 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
542   -2011-02-01T09:53:37:&nbsp; Number of temporal par's ..: 1<br>
543   -2011-02-01T09:53:37:&nbsp;&nbsp; Constant .................: 1
544   -(relative value) (fixed,scale=1)<br>
545   -2011-02-01T09:53:37: <br>
546   -2011-02-01T09:53:37: Application "ctlike" terminated after consuming 41
547   -seconds of CPU time.
548   -</p>
549   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
550   -maximum likelihood optimizer required 4 iterations to converge. This is
551   -pretty fast, but recall that we used the same model file for the
552   -simulation and for fitting, hence the initial parameter values are
553   -already very close to the best fitting values. To see the impact of the
554   -initial parameters on the fit result, you may re-run <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
555   -using another copy of the model XML file where the <span style="font-family: Courier New,Courier,monospace;">value</span>
556   -attributes of the parameters that should be fitted are changed. You
557   -will see that the optimizer requires a couple of more iterations, but
558   -it should converge to the same solution (provided that the initial
559   -values are not too far of the best fitting values).&nbsp;
560   -</p>
561   -<br>
562   -<br>
563   -<p class="Title"><a name="Doing_an_unbinned_analysis"></a>Doing
564   -an unbinned analysis</p>
565   -<p style="padding-top: 0pt; text-align: left;" class="Body">As
566   -gamma-ray events are rare, the counts maps generated by <span style="font-family: Courier New,Courier,monospace;">ctbin</span>
567   -will in general be sparse, having many empty pixels, in
568   -particular at high energies. An alternative analysis technique consists
569   -of working directly on the event list without binning the events in a
570   -counts map. We
571   -will see the benefit of such an analysis later once we re-run <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
572   -in unbinned mode.</p>
573   -<br>
574   -<p style="padding-top: 0pt; text-align: left;" class="Body">For
575   -unbinned analysis we have first to define the data
576   -space region over which the analysis is done. This is similiar to the <span style="font-family: Courier New,Courier,monospace;">ctbin</span>
577   -step in binned analysis where we define the size of the counts map, the
578   -energy range, and the time interval. For unbinned analysis we have no
579   -such thing as a counts map, but we have to define over which region of
580   -the data space the selected events are spread (because we have to
581   -integrate
582   -over this region to compute the total number of predicted events in the
583   -data space that we analyse). Furthermore, we have to define what energy
584   -range is covered, and what time interval is spanned by the data. All
585   -this is done by the executable <span style="font-family: Courier New,Courier,monospace;">ctselect</span>,
586   -which replaces the <span style="font-family: Courier New,Courier,monospace;">ctbin</span>
587   -step in an unbinned analysis.</p>
588   -<br>
589   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctselect</span>
590   -performs an event selection by choosing only&nbsp;events within a
591   -given
592   -region-of-interest (ROI), within a given energy band, and within a
593   -given time interval from the input event list. The ROI is a circular
594   -region on the sky, for which we define the centre (in celestial
595   -coordinates) and the radius. Such a circular ROI is sometimes also
596   -called an <span style="font-weight: bold;">acceptance cone</span>.
597   -The following example shows how <span style="font-family: Courier New,Courier,monospace;">ctselect</span>
598   -is invoked on the simulated
599   -test data: </p>
600   -<p class="Code">
601   -&gt; ctselect<br>
602   -Input event data file [test/data/crab_events.fits.gz]
603   -events.fits<br>
604   -Output event data file [selected_events.fits] <br>
605   -RA for ROI centre (degrees) (0-360) [83.63] <br>
606   -Dec for ROI centre (degrees) (-90-90) [22.01] <br>
607   -Radius of ROI (degrees) (0-180) [3.0] <br>
608   -Start time (MET in s) (0) [0.0] <br>
609   -End time (MET in s) (0) [1800.0] <br>
610   -Lower energy limit (TeV) (0) [0.1] <br>
611   -Upper energy limit (TeV) (0) [100.0]<br>
612   -</p>
613   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctselect</span>
614   -takes the input event list <span style="font-family: Courier New,Courier,monospace;">events.fits</span>,
615   -performs an event selection, and writes the selected event into the
616   -file <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>.
617   -The parameters it will query for are the centre of the ROI, the
618   -radius of the ROI, the start and stop time (in seconds), and the energy
619   -lower and upper limits (in TeV). The event selection information is
620   -also written as a set of <span style="font-weight: bold;">data
621   -selection keywords</span> to the output events file <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>,
622   -by respecting the same syntax that has been implemented for Fermi-LAT.
623   -The following image is a screen dump of the data
624   -selection keywords that have been written to the <span style="font-family: Courier New,Courier,monospace;">EVENTS</span>
625   -header in the file <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>:</p>
626   -<br>
627   -<p style="padding-top: 0pt; text-align: center;" class="Body">&nbsp;<img style="width: 456px; height: 310px;" alt="Data selection keywords" src="images/dskeys.jpg">
628   -</p>
629   -<br>
630   -<p style="padding-top: 0pt; text-align: left;" class="Body">It
631   -is important for unbinned analysis that these data selection keywords
632   -exist. If they don't exist, <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
633   -will not execute in unbinned mode.</p>
634   -<br>
635   -<p style="padding-top: 0pt; text-align: left;" class="Body">Below
636   -we show also for completeness the last few lines of the <span style="font-family: Courier New,Courier,monospace;">ctselect.log</span>
637   -file. It gives information about the specific data selection that has
638   -been performed.
639   -</p>
640   -<p class="Code">
641   -2011-02-01T19:58:34: +=================+<br>
642   -2011-02-01T19:58:34: | Event selection |<br>
643   -2011-02-01T19:58:34: +=================+<br>
644   -2011-02-01T19:58:34:&nbsp; Time range ................: 0-1800<br>
645   -2011-02-01T19:58:34:&nbsp; Energy range ..............: 0.1-100 TeV<br>
646   -2011-02-01T19:58:34:&nbsp; Acceptance cone centre ....: RA=83.63,
647   -DEC=22.01 deg<br>
648   -2011-02-01T19:58:34:&nbsp; Acceptance cone radius ....: 3 deg<br>
649   -2011-02-01T19:58:34:&nbsp; cfitsio selection .........: TIME
650   -&gt;= 0 &amp;&amp; TIME &lt;= 1800 &amp;&amp;
651   -ENERGY &gt;= 0.1 &amp;&amp; ENERGY &lt;= 100
652   -&amp;&amp; ANGSEP(83.63,<br>
653   -22.01,RA,DEC) &lt;= 3<br>
654   -2011-02-01T19:58:34:&nbsp; FITS filename .............:
655   -events.fits[EVENTS][TIME &gt;= 0 &amp;&amp; TIME &lt;=
656   -1800 &amp;&amp; ENERGY &gt;= 0.1 &amp;&amp; ENERGY
657   -&lt;= <br>
658   -100 &amp;&amp; ANGSEP(83.63,22.01,RA,DEC) &lt;= 3]<br>
659   -2011-02-01T19:58:34: <br>
660   -2011-02-01T19:58:34: Application "ctselect" terminated after consuming
661   -10 seconds of CPU time.<br>
662   -&nbsp;<br>
663   -</p>
664   -<p style="padding-top: 0pt; text-align: left;" class="Body">Now
665   -that the event selection has been performed, <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
666   -can be run in unbinned mode. To do this, you have to type <span style="font-family: Courier New,Courier,monospace;">UNBINNED</span>
667   -when the maximum likelihood method is queried. The remaining parameters
668   -are similar to binned mode, except for the last one that asks now for
669   -an event data file instead of a counts map. Specify here the selected
670   -event list <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>
671   -that has been produced by <span style="font-family: Courier New,Courier,monospace;">ctselect</span>.
672   -To run <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
673   -in unbinned mode, type the following:
674   -</p>
675   -<p class="Code">
676   -&gt; ctlike<br>
677   -Event list, counts map or observation definition
678   -file&nbsp;[test/data/crab_events.fits.gz] selected_events.fits<br>
679   -Calibration database [test/irf] /usr/local/gamma/share/caldb/cta<br>
680   -Instrument response function [kb_E_50h_v3] <br>
681   -Source model [test/data/crab.xml] /usr/local/gamma/share/models/crab.xml<br>
682   -Source model output file [crab_results.xml] </p>
683   -<p style="padding-top: 0pt; text-align: left;" class="Body">You
684   -will recognise that <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
685   -runs much faster in unbinned mode compared to binned mode. This is
686   -understandable as the selected event list contains only 4048 events,
687   -while the binned counts map we used before had 200 x 200 x 20 = 800000
688   -pixels. As unbinned maximum likelihood fitting loops over the events
689   -(while binned maximum likelihood loops over the pixels), there are much
690   -less operations to perform in unbinned than in binned mode (there is
691   -some additional overhead in unbinned mode that comes from integrating
692   -the models over the region of interest, yet this is negligible compared
693   -to the operations needed when looping over the pixels). So as long as
694   -you work with
695   -short event lists, unbinned mode is faster. Unbinned <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
696   -should also be more
697   -precise as no binning is performed, hence there is no loss of
698   -information due to histogramming.</p>
699   -<br>
700   -<p style="padding-top: 0pt; text-align: left;" class="Body">Below
701   -you see the corresponding output from the <span style="font-family: Courier New,Courier,monospace;">ctlike.log</span>
702   -file. The fitted parameters are essentially identical to the ones found
703   -in binned mode. The slight
704   -difference with respect to the binned analysis may be explained by the
705   -different event sample that has been used for the analysis: while
706   -binned likelihood works on rectangular counts maps, unbinned likelihood
707   -works on circular event selection regions. It is thus not possible to
708   -select exactly the same events for both analyses!</p>
709   -<p class="Code">
710   -2011-02-02T14:32:54: +=================================+<br>
711   -2011-02-02T14:32:54: | Maximum likelihood optimisation |<br>
712   -2011-02-02T14:32:54: +=================================+<br>
713   -2011-02-02T14:32:54:&nbsp; Initial iteration: func=33730.9,
714   -Lambda=0.001<br>
715   -2011-02-02T14:32:54:&nbsp; Iteration 1: func=33728.3,
716   -Lambda=0.0001, delta=2.56377<br>
717   -2011-02-02T14:32:54:&nbsp; Iteration 2: func=33728.3, Lambda=1e-05,
718   -delta=0.00443209<br>
719   -2011-02-02T14:32:54:&nbsp; Iteration 3: func=33728.3, Lambda=1e-06,
720   -delta=5.81336e-06<br>
721   -2011-02-02T14:32:54:&nbsp; Iteration 4: func=33728.3, Lambda=1e-07,
722   -delta=1.31549e-08<br>
723   -2011-02-02T14:32:54: <br>
724   -2011-02-02T14:32:54: +=========================================+<br>
725   -2011-02-02T14:32:54: | Maximum likelihood optimisation results |<br>
726   -2011-02-02T14:32:54: +=========================================+<br>
727   -2011-02-02T14:32:54: === GOptimizerLM ===<br>
728   -2011-02-02T14:32:54:&nbsp; Optimized function value ..: 33728.3<br>
729   -2011-02-02T14:32:54:&nbsp; Absolute precision ........: 1e-06<br>
730   -2011-02-02T14:32:54:&nbsp; Optimization status .......: converged<br>
731   -2011-02-02T14:32:54:&nbsp; Number of parameters ......: 11<br>
732   -2011-02-02T14:32:54:&nbsp; Number of free parameters .: 5<br>
733   -2011-02-02T14:32:54:&nbsp; Number of iterations ......: 4<br>
734   -2011-02-02T14:32:54:&nbsp; Lambda ....................: 1e-07<br>
735   -2011-02-02T14:32:54:&nbsp; Maximum log likelihood ....: -33728.3<br>
736   -2011-02-02T14:32:54:&nbsp; Npred .....................: 4048<br>
737   -2011-02-02T14:32:54: === GModels ===<br>
738   -2011-02-02T14:32:54:&nbsp; Number of models ..........: 2<br>
739   -2011-02-02T14:32:54:&nbsp; Number of parameters ......: 11<br>
740   -2011-02-02T14:32:54: === GModelPointSource ===<br>
741   -2011-02-02T14:32:54:&nbsp; Name ......................: MAGIC Crab
742   -(Albert et al. 2008, ApJ, 674, 1037)<br>
743   -2011-02-02T14:32:54:&nbsp; Instruments ...............: all<br>
744   -2011-02-02T14:32:54:&nbsp; Number of parameters ......: 6<br>
745   -2011-02-02T14:32:54:&nbsp; Number of spatial par's ...: 2<br>
746   -2011-02-02T14:32:54:&nbsp;&nbsp; RA .......................:
747   -83.6331 [-360,360] deg (fixed,scale=1)<br>
748   -2011-02-02T14:32:54:&nbsp;&nbsp; DEC ......................:
749   -22.0145 [-90,90] deg (fixed,scale=1)<br>
750   -2011-02-02T14:32:54:&nbsp; Number of spectral par's ..: 3<br>
751   -2011-02-02T14:32:54:&nbsp;&nbsp; Prefactor ................:
752   -5.83432e-16 +/- 2.44527e-17 [1e-23,1e-13] ph/cm2/s/MeV
753   -(free,scale=1e-16)<br>
754   -2011-02-02T14:32:54:&nbsp;&nbsp; Index ....................:
755   --2.50725 +/- 0.0328297 [-0,-5]&nbsp; (free,scale=-1)<br>
756   -2011-02-02T14:32:54:&nbsp;&nbsp; PivotEnergy ..............:
757   -300000 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
758   -2011-02-02T14:32:54:&nbsp; Number of temporal par's ..: 1<br>
759   -2011-02-02T14:32:54:&nbsp;&nbsp; Constant .................: 1
760   -(relative value) (fixed,scale=1)<br>
761   -2011-02-02T14:32:54: === GCTAModelRadialAcceptance ===<br>
762   -2011-02-02T14:32:54:&nbsp; Name ......................: Background<br>
763   -2011-02-02T14:32:54:&nbsp; Instruments ...............: CTA<br>
764   -2011-02-02T14:32:54:&nbsp; Model type ................: "Gaussian"
765   -* "PowerLaw" * "Constant"<br>
766   -2011-02-02T14:32:54:&nbsp; Number of parameters ......: 5<br>
767   -2011-02-02T14:32:54:&nbsp; Number of radial par's ....: 1<br>
768   -2011-02-02T14:32:54:&nbsp;&nbsp; Sigma ....................:
769   -3.03472 +/- 0.0398509 [0.01,10] deg2 (free,scale=1)<br>
770   -2011-02-02T14:32:54:&nbsp; Number of spectral par's ..: 3<br>
771   -2011-02-02T14:32:54:&nbsp;&nbsp; Prefactor ................:
772   -6.18897e-05 +/- 1.74306e-06 [0,0.001] ph/cm2/s/MeV (free,scale=1e-06)<br>
773   -2011-02-02T14:32:54:&nbsp;&nbsp; Index ....................:
774   --1.86369 +/- 0.0156024 [-0,-5]&nbsp; (free,scale=-1)<br>
775   -2011-02-02T14:32:54:&nbsp;&nbsp; PivotEnergy ..............:
776   -1e+06 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
777   -2011-02-02T14:32:54:&nbsp; Number of temporal par's ..: 1<br>
778   -2011-02-02T14:32:54:&nbsp;&nbsp; Constant .................: 1
779   -(relative value) (fixed,scale=1)<br>
780   -2011-02-02T14:32:54: <br>
781   -2011-02-02T14:32:54: Application "ctlike" terminated after consuming 2
782   -seconds of CPU time.<br>
783   -</p>
784   -<br>
785   -<br>
786   -<p class="Title"><a name="Some_final_remarks"></a>Some
787   -final remarks <span style="color: red;">(updated for
788   -ctools-00-02-03)</span></p>
789   -<p style="padding-top: 0pt; text-align: left;" class="Body">First
790   -you should notice that <span style="font-weight: bold;">ctools
791   -are in the prototyping phase</span>. If GammaLib and ctatools are
792   -installed on your system you should be able to run the above example
793   -without any problems, and you can do even much more.</p>
794   -<br>
795   -<p style="padding-top: 0pt; text-align: left;" class="Body">You
796   -may specify longer integration times for the simulation and for the
797   -analysis, you can have several point sources in the
798   -XML file, and you may try to fit all sources simultaneously using <span style="font-family: Courier New,Courier,monospace;">ctlike</span>.
799   -Yet, for the moment,
800   -you are limited to point sources (<span style="font-family: Courier New,Courier,monospace;">type="PointSource"</span>)
801   -and their spectra should be power laws (<span style="font-family: Courier New,Courier,monospace;">type="PowerLaw"</span>).
802   -Although there are already a number of other spectral types available
803   -in GammaLib, I have not yet had the time to implement their Monte Carlo
804   -generator, hence you cannot simulate events for spectral laws different
805   -from power laws for the moment. You may try, however, fitting the
806   -sources with other spectral laws, yet I have not tried this, and I
807   -cannot guarantee that it works.</p>
808   -<br>
809   -<p style="padding-top: 0pt; text-align: left;" class="Body">There
810   -is also only one radial acceptance model defined so far, and you should
811   -use the model definition that is given in the example.</p>
812   -<br>
813   -<p style="padding-top: 0pt; text-align: left;" class="Body">So
814   -far, there are four projection types supported: <span style="font-family: Courier New,Courier,monospace;">AZP</span>,
815   -<span style="font-family: Courier New,Courier,monospace;">CAR</span>,
816   -<span style="font-family: Courier New,Courier,monospace;">STG</span>,
817   -and <span style="font-family: Courier New,Courier,monospace;">TAN</span>.
818   -You can use them in Galactic (<span style="font-family: Courier New,Courier,monospace;">GAL</span>)
819   -or celestial (<span style="font-family: Courier New,Courier,monospace;">CEL</span>)
820   -coordinates.</p>
821   -<br>
822   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
823   -instrument response function that has been implemented so far in
824   -GammaLib (yes, it is in GammaLib, not in ctatools) is very simple. It
825   -just reads Konrad's effective area files to get the onaxis effective
826   -area. It is assumed that the effective area varies with offset angle,
827   -and a Gaussian as function of offset angle squared has been implemented
828   -for the functional form of this variation. By default, the <span style="font-family: Courier New,Courier,monospace;">sigma</span>
829   -of this Gaussian is fixed to 3 deg<sup>2</sup>.
830   -This value can not be modified using the ctatools, but it can be
831   -altered using the Python interface. In any case, this treatment of the
832   -offset angle dependence is only preliminary and <span style="font-weight: bold;">will be changed as soon as a
833   -format has been defined for the CTA response functions</span>.</p>
834   -<p style="padding-top: 0pt; text-align: left;" class="Body"></p>
835   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
836   -and <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
837   -query for the name of the instrument response function file, and you
838   -may specify different
839   -response files if you want to study the impact of array configuration
840   -on the results. To see what is available, type (adjust the
841   -path corresponding to your installation directory):
842   -</p>
843   -<p class="Code">&gt; ls
844   -/usr/local/gamma/share/caldb/cta<br>
845   -kb_A_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
846   -kb_D_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
847   -kb_G_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
848   -kb_J_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
849   -kb_NB_50h_v3.dat<br>
850   -kb_B_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
851   -kb_E_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
852   -kb_H_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
853   -kb_K_50h_v3.dat<br>
854   -kb_C_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
855   -kb_F_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
856   -kb_I_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
857   -kb_NA_50h_v3.dat<br>
858   -</p>
859   -<p style="padding-top: 0pt; text-align: left;" class="Body">The
860   -point spread function (PSF) definition is also read from these files.
861   -So far, the <span style="font-weight: bold;">PSF is a
862   -simple&nbsp;Gaussian</span>. The energy dependent Gaussian
863   -width is defined by
864   -the r68 parameter in Konrad's response files.</p>
865   -<br>
866   -<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-weight: bold;">Lifetime
867   -is assumed to be 100%</span>. I'm not sure whether lifetime is
868   -folded in the
869   -effective areas of Konrad's response files, if not, a corresponding
870   -correction should be applied to all source fluxes obtained with the
871   -ctatools.
872   -</p>
873   -<br>
874   -<p style="padding-top: 0pt; text-align: left;" class="Body">Finally,
875   -if
876   -you want to have the log file also dumped to the screen as the
877   -executable runs, add <span style="font-family: Courier New,Courier,monospace;">debug=yes</span>
878   -on the command line, e.g.
879   -</p>
880   -<p class="Code">&gt; ctlike debug=yes
881   -</p>
882   -<p style="padding-top: 0pt; text-align: left;" class="Body">
883   -And now: <span style="font-weight: bold;">enjoy playing
884   -with ctatools</span>.
885   -</p>
886   -<br>
887   -<br>
888   -<p class="Title"><a name="Getting_Help"></a>Getting
889   -Help</p>
890   -<p style="padding-top: 0pt; text-align: left;" class="Body">
891   -Any questions, bug reports, or suggested enhancements related to
892   -ctatools and GammaLib&nbsp;should be submitted
893   -to <a href="mailto:jurgen.knodlseder@irap.omp.eu">jurgen.knodlseder@irap.omp.eu</a>.
894   -</p>
895   -<br>
896   -<hr size="1">
897   -<p class="Body">Last updated by: J&uuml;rgen
898   -Kn&ouml;dlseder (4 April 2012)
899   -</p>
900   -</body></html>
901 0 \ No newline at end of file
doc/html/images/example_survey.jpg renamed to doc/source/_static/example_survey.jpg

245 KB

test/example_survey.png renamed to doc/source/_static/example_survey.png

251 KB

doc/html/images/header.jpg renamed to doc/source/_static/header.jpg

35.5 KB

doc/html/images/survey-pop2.jpg renamed to doc/source/_static/survey-pop2.jpg

350 KB

doc/source/_templates/index.html
... ... @@ -37,7 +37,7 @@ CTA format), Fermi/LAT and COMPTEL data. {%endtrans%}&lt;/p&gt;
37 37 <li><a class="smalllink" href="{{ pathto("user_manual/getting_started/quickstart") }}">{%trans%}Quickstart{%endtrans%}</a></li>
38 38 <li><a class="smalllink" href="{{ pathto("user_manual/getting_started/response") }}">{%trans%}CTA response functions{%endtrans%}</a></li>
39 39 <li><a class="smalllink" href="{{ pathto("user_manual/index") }}">{%trans%}User Manual{%endtrans%}</a></li>
40   -<li><a class="smalllink" href="{{ pathto("documentation") }}">{%trans%}ctools reference{%endtrans%}</a></li>
  40 +<li><a class="smalllink" href="{{ pathto("tools_reference") }}">{%trans%}ctools Reference{%endtrans%}</a></li>
41 41 <li><a class="smalllink" href="doxygen/index.html">{%trans%}Source code documentation (Doxygen){%endtrans%}</a></li>
42 42 </ul>
43 43  
... ...
doc/source/conf.py
... ... @@ -23,9 +23,34 @@ import sys, os
23 23 # If your documentation needs a minimal Sphinx version, state it here.
24 24 #needs_sphinx = '1.0'
25 25  
  26 +extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.mathjax']
  27 +
26 28 # Add any Sphinx extension module names here, as strings. They can be extensions
27 29 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28   -extensions = ['sphinx.ext.mathjax']
  30 +try:
  31 + import sphinxcontrib.doxylink
  32 + extensions += ['sphinxcontrib.doxylink']
  33 +except:
  34 + print('WARNING: Python package `sphinxcontrib.doxylink` not found.\n'
  35 + 'WARNING: Please install it to get fully-functional Sphinx docs.\n'
  36 + 'WARNING: https://pypi.python.org/pypi/sphinxcontrib-doxylink\n')
  37 +
  38 +# http://sphinx-doc.org/extensions.html#where-to-put-your-own-extensions
  39 +sys.path.append(os.path.abspath('exts'))
  40 +
  41 +# We bundled the `rawfiles` sphinx extension to copy over files on sphinx build
  42 +# https://pypi.python.org/pypi/sphinxcontrib-rawfiles
  43 +extensions += ['rawfiles']
  44 +
  45 +# You can list any files or folders here that should be copied 1:1 to the html
  46 +# output directory by sphinx-build
  47 +rawfiles = ['fhelp']
  48 +
  49 +# This makes it possible to cross-link to the GammaLib Sphinx docs
  50 +# see http://sphinx-doc.org/ext/intersphinx.html
  51 +intersphinx_mapping = dict()
  52 +intersphinx_mapping['gammalib'] = ('http://gammalib.sourceforge.net/', None)
  53 +
29 54  
30 55 # Add any paths that contain templates here, relative to this directory.
31 56 templates_path = ['_templates']
... ... @@ -241,3 +266,9 @@ texinfo_documents = [
241 266  
242 267 # How to display URL addresses: 'footnote', 'no', or 'inline'.
243 268 #texinfo_show_urls = 'footnote'
  269 +
  270 +# Define connection to Doxygen API docs
  271 +# http://pythonhosted.org/sphinxcontrib-doxylink/index.html#confval-doxylink
  272 +doxylink = {
  273 + 'doxy' : ('doc/html/doxygen/ctools.tag', 'doxygen/'),
  274 +}
... ...
doc/source/exts/rawfiles.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +# Copied from https://bitbucket.org/birkenfeld/sphinx-contrib/
  3 +import os
  4 +import shutil
  5 +
  6 +def on_html_collect_pages(app):
  7 + for f in app.builder.config.rawfiles:
  8 + src = os.path.join(app.srcdir, f)
  9 + dst = os.path.join(app.builder.outdir, f)
  10 + # cleanup
  11 + if os.path.exists(dst):
  12 + if os.path.isdir(dst):
  13 + shutil.rmtree(dst)
  14 + elif os.path.isfile(dst):
  15 + os.remove(dst)
  16 + # copy file
  17 + if os.path.exists(src):
  18 + if os.path.isdir(src):
  19 + shutil.copytree(src, dst)
  20 + elif os.path.isfile(src):
  21 + shutil.copy(src, dst)
  22 + else:
  23 + msg = ('rawfiles target is not directory or file "%s".' % src)
  24 + app.builder.warn(msg)
  25 + else:
  26 + msg = ('rawfiles can not find "%s".' % src)
  27 + app.builder.warn(msg)
  28 +
  29 + return ()
  30 +
  31 +def setup(app):
  32 + app.add_config_value('rawfiles', [], 'html')
  33 + app.connect("html-collect-pages", on_html_collect_pages)
0 34 \ No newline at end of file
... ...
doc/html/doc/cspull.html renamed to doc/source/fhelp/cspull.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>cspull</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA pull distribution generator" name="description">
8 8 </head>
... ... @@ -16,7 +16,7 @@ parameters.&lt;/p&gt;
16 16 pull distributions for all parameters in a model. The pull is defined
17 17 by the fitted value minus the simulated true value, devided by the
18 18 statistical uncertainty. For unbiased parameter estimates, the pull
19   -distribution should follow a Gaussian centred on 0 and a sigma
  19 +distribution should follow a Gaussian centred on 0 and a sigma
20 20 parameter of 1.</p>
21 21 <br>
22 22 <p class="Title">Links</p>
... ...
doc/html/doc/cssens.html renamed to doc/source/fhelp/cssens.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>cssens</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA sensitivity estimator" name="description">
8 8 </head>
... ...
doc/html/doc/cstsdist.html renamed to doc/source/fhelp/cstsdist.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>cstsdist</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA TS distribution generator" name="description">
8 8 </head>
... ...
doc/html/doc/ctbin.html renamed to doc/source/fhelp/ctbin.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>ctbin</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA event binning tool" name="description">
8 8 </head>
... ...
doc/html/doc/ctlike.html renamed to doc/source/fhelp/ctlike.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>ctlike</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA maximum likelihood fitting tool" name="description"></head>
8 8 <body>
... ...
doc/html/doc/ctmodel.html renamed to doc/source/fhelp/ctmodel.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>ctmodel</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA modelling tool" name="description">
8 8 </head>
... ...
doc/html/doc/ctobssim.html renamed to doc/source/fhelp/ctobssim.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>ctobssim</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA observation simulation tool" name="description">
8 8 </head>
... ...
doc/html/ctools.css renamed to doc/source/fhelp/ctools.css
doc/html/doc/ctselect.html renamed to doc/source/fhelp/ctselect.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>ctselect</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA event sub-selection tool" name="description">
8 8 </head>
... ...
doc/html/doc/ctskymap.html renamed to doc/source/fhelp/ctskymap.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>ctskymap</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="CTA sky mapping tool" name="description">
8 8 </head>
... ...
doc/html/doc/ftools_usage.html renamed to doc/source/fhelp/ftools_usage.html
... ... @@ -2,7 +2,7 @@
2 2 <html lang="en"><head>
3 3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Basic FTOOL Parameter Usage</title>
4 4  
5   -<link rel="stylesheet" type="text/css" media="screen,print" href="../ctools.css">
  5 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctools.css">
6 6 <meta content="Jurgen Knodlseder" name="author">
7 7 <meta content="Basic FTOOL Parameter Usage" name="description">
8 8 </head>
... ...
doc/source/tools_reference.rst 0 → 100644
  1 +ctools reference manual
  2 +=======================
  3 +
  4 +General information on FTOOLS usage can be found `here <fhelp/ftools_usage.html>`__.
  5 +
  6 +Below you can find links to the command line tools help pages that are available in ctools.
  7 +
  8 +ctools
  9 +------
  10 +
  11 +* `ctbin <fhelp/ctbin.html>`__ --- Calculates counts maps for binned maximum likelihood analysis.
  12 +* `ctlike <fhelp/ctlike.html>`__ --- Performs binned and unbinned maximum likelihood analysis of CTA data.
  13 +* `ctmodel <fhelp/ctmodel.html>`__ --- Calculates model counts maps.
  14 +* `ctobssim <fhelp/ctobssim.html>`__ --- Observation simulator.
  15 +* `ctselect <fhelp/ctselect.html>`__ --- Performs sub-selections of event data which are needed for unbinned maximum likelihood analysis.
  16 +* `ctskymap <fhelp/ctskymap.html>`__ --- Computes sky map from CTA data.
  17 +
  18 +cscripts
  19 +--------
  20 +
  21 +* `cspull <fhelp/cspull.html>`__ --- Generates pull distribution for all model parameters.
  22 +* `cssens <fhelp/cssens.html>`__ --- Computes the CTA sensitivity for a number of energy bins.
  23 +* `cstsdist <fhelp/cstsdist.html>`__ --- Generates the TS distribution for a particular model.
... ...
doc/source/user_manual/enhancing.rst
1 1 Enhancing ctools
2 2 ================
3 3  
  4 +Most ctools users will run the existing ctools or cscripts,
  5 +which cover the most common simulation and analysis needs.
  6 +
  7 +Advanced users and developers can write their own tools and scripts.
  8 +The following C++ and Python examples can help get you started:
  9 +
  10 +* :doxy:`ctlike`
  11 +* :doxy:`obsutils`
  12 +* :doxy:`cstsdist`
  13 +
4 14 Building your own cscripts
5 15 --------------------------
6 16  
7 17 Building your own ctools
8   -------------------------
9 18 \ No newline at end of file
  19 +------------------------
... ...
doc/source/user_manual/getting_started/models.rst
... ... @@ -2,4 +2,5 @@ Models available in ctools
2 2 --------------------------
3 3  
4 4 To be written ... (you may read
5   -http://gammalib.sourceforge.net/user_manual/modules/model.html#spectral-models for the time being).
  5 +:ref:`the model section in the GammaLib user manual <gammalib:sec_model>`
  6 +for the time being).
... ...
doc/source/user_manual/index.rst
... ... @@ -9,7 +9,6 @@ User Manual
9 9 getting
10 10 getting_started/index
11 11 enhancing
12   - reference
13 12 expert
14 13 plotting
15 14 glossary
... ...
doc/source/user_manual/reference.rst deleted
1   -ctools reference manual
2   -=======================
3   -
4   -ctools
5   -------
6   -
7   -cscripts
8   ---------
9 0 \ No newline at end of file
test/example_survey.jpg deleted

245 KB