Commit 62900845e336e19a22a7fe5006e744f853f6a9a4

Authored by knodlseder
1 parent 61567855

initial version

doc/html/about.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  6 + <title>About</title>
  7 +
  8 +
  9 + <link rel="stylesheet" type="text/css" media="screen,print" href="ctatools.css">
  10 +
  11 +</head>
  12 +
  13 +
  14 +<body>
  15 +
  16 +<p class="Header">About</p>
  17 +
  18 +<p style="padding-top: 0pt; text-align: left;" class="Body">ctatools
  19 +are a set of ftools-like executables needed for the scientific analysis
  20 +of Cherenkov Telescope Array data. ctatools are based on GammaLib, a
  21 +versatile toolbox for the high-level analysis of
  22 +astronomical gamma-ray data.</p>
  23 +
  24 +<br>
  25 +
  26 +<p style="padding-top: 0pt; text-align: left;" class="Body">ctatools
  27 +are&nbsp;implemented in C++ and are fully scriptable using the
  28 +Python scripting language.</p>
  29 +
  30 +<br>
  31 +
  32 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  33 +ctatools development is led by the Insitut de Recherche en
  34 +Astrophysique et Plan&eacute;tologie
  35 +(IRAP), a mixed CNRS / Universit&eacute; Paul Sabatier laboratory
  36 +in Toulouse, France.</p>
  37 +
  38 +<br>
  39 +
  40 +<br>
  41 +
  42 +</body>
  43 +</html>
doc/html/banner.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  6 + <title>Banner</title>
  7 +
  8 +
  9 + <link rel="stylesheet" type="text/css" media="screen,print" href="ctatools.css">
  10 +
  11 + <meta name="author" content="J&uuml;rgen Kn&ouml;dlseder">
  12 +
  13 +</head>
  14 +
  15 +
  16 +<body style="color: rgb(255, 255, 255); background-color: rgb(0, 32, 82);" link="#ffffff" alink="#ffffff" vlink="#cccccc">
  17 +
  18 +<table style="text-align: left; background-color: rgb(0, 32, 82); width: 861px; height: 80px;" border="0" cellpadding="0" cellspacing="0">
  19 +
  20 + <tbody>
  21 +
  22 + <tr>
  23 +
  24 + <td style="text-align: left; vertical-align: top; background-color: rgb(0, 32, 82); height: 80px; width: 536px;" colspan="3"><img style="width: 536px; height: 80px;" alt="ctatools" src="images/header.jpg"><br>
  25 +
  26 + </td>
  27 +
  28 + </tr>
  29 +
  30 + </tbody>
  31 +</table>
  32 +
  33 +</body>
  34 +</html>
doc/html/ctatools.css 0 → 100644
  1 +.Body { color: #404040; font-family: 'Arial', 'Arial', 'Arial', sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; opacity: 1.00; padding-bottom: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; } .Header { color: #666666; font-family: 'Arial', 'Arial', 'Arial', 'Arial', sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 0; line-height: 44px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; opacity: 1.00; padding-bottom: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; } .Title { color: #404040; font-family: 'Arial', 'Arial', 'Arial', sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: 0; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; opacity: 1.00; padding-bottom: 10px; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; } .Menu { color: #404040; font-family: 'Arial', 'Arial', 'Arial', sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: 0; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; opacity: 1.00; padding-bottom: 10px; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; } .Code { border-style: solid; border-width: 0.1em; margin: 1em 0.5em; padding: 0.6em 0.5em 0.5em; font-family: Courier New,Courier,monospace; font-size: smaller; background-color: rgb(255, 255, 204); display: block; }
0 \ No newline at end of file 2 \ No newline at end of file
doc/html/documentation.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  6 + <title>Documentation</title>
  7 +
  8 +
  9 + <link rel="stylesheet" type="text/css" media="screen,print" href="ctatools.css">
  10 +
  11 +</head>
  12 +
  13 +
  14 +<body>
  15 +
  16 +<p class="Header">Documentation</p>
  17 +
  18 +<p style="padding-top: 0pt; text-align: left;" class="Body">...
  19 +needs still to be written :-)
  20 +</p>
  21 +
  22 +<br>
  23 +
  24 +<br>
  25 +
  26 +</body>
  27 +</html>
doc/html/download.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  6 + <title>Download</title>
  7 +
  8 +
  9 + <link href="ctatools.css" media="screen,print" type="text/css" rel="stylesheet">
  10 +
  11 +</head>
  12 +
  13 +
  14 +<body>
  15 +
  16 +<p class="Header">Download</p>
  17 +
  18 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  19 +The latest ctatools release is ctatools-00-01-00 (February 2, 2011).</p>
  20 +
  21 +<br>
  22 +
  23 +<p style="padding-top: 0pt; text-align: left;" class="Body">ctatools
  24 +are still internal to the CTA consortium. If you are part of the
  25 +consortium, you may obtained a copy by sending an e-mail to <a href="mailto:knodlseder@cesr.fr?subject=%5Bctatools%5D">knodlseder@cesr.fr</a>.
  26 +</p>
  27 +
  28 +<br>
  29 +
  30 +</body>
  31 +</html>
doc/html/filler.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  6 + <title>Filler</title>
  7 +
  8 +
  9 + <link href="ctatools.css" media="screen,print" type="text/css" rel="stylesheet">
  10 +
  11 + <meta content="J&uuml;rgen Kn&ouml;dlseder" name="author">
  12 +
  13 +</head>
  14 +
  15 +
  16 +<body style="color: rgb(255, 255, 255); background-color: rgb(0, 32, 82);" link="#ffffff" alink="#ffffff" vlink="#cccccc">
  17 +
  18 +</body>
  19 +</html>
doc/html/home.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  6 + <title>Home</title>
  7 +
  8 +
  9 + <link rel="stylesheet" type="text/css" media="screen,print" href="ctatools.css">
  10 +
  11 +</head>
  12 +
  13 +
  14 +<body>
  15 +
  16 +<p class="Header">ctatools</p>
  17 +
  18 +<p style="padding-top: 0pt; text-align: left;" class="Body">ctatools
  19 +are a set of ftools-like executables needed for the scientific analysis
  20 +of Cherenkov Telescope Array data.
  21 +</p>
  22 +
  23 +<br>
  24 +
  25 +<br>
  26 +
  27 +</body>
  28 +</html>
doc/html/images/cntmap-fits.jpg 0 → 100644

47 KB

doc/html/images/cntmap-map.jpg 0 → 100644

22.7 KB

doc/html/images/dskeys.jpg 0 → 100644

99.6 KB

doc/html/images/header.jpg 0 → 100644

33.7 KB

doc/html/index.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  5 +<title>ctatools</title>
  6 +<link rel="stylesheet" type="text/css" media="screen,print" href="ctatools.css" />
  7 +</head>
  8 +<frameset rows="80,35,*" border=0 frameborder=0 scrolling=no>
  9 +<frame src="banner.html" border=0 frameborder=0 scrolling=no name="banner">
  10 +<frameset cols="23,*" border=0 frameborder=0 scrolling=no>
  11 +<frame src="filler.html" border=0 frameborder=0 scrolling=no name="filler">
  12 +<frame src="menu.html" border=0 frameborder=0 scrolling=no name="menu">
  13 +</frameset>
  14 +<frameset cols="18,*" scrolling=no>
  15 +<frame border=0 frameborder=0 scrolling=no>
  16 +<frame src="home.html" border=0 frameborder=0 scrolling=yes name="main">
  17 +</frameset>
  18 +</frameset>
  19 +</html>
doc/html/installation.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  6 + <title>Installation</title>
  7 +
  8 +
  9 + <link href="ctatools.css" media="screen,print" type="text/css" rel="stylesheet">
  10 +
  11 +</head>
  12 +
  13 +
  14 +<body>
  15 +
  16 +<p class="Header">Installation</p>
  17 +
  18 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  19 +<a href="#Step_1:_Install_GammaLib">Step 1: Install
  20 +GammaLib</a>
  21 +</p>
  22 +
  23 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  24 +<a href="#Step_2:_Setup_environment">Step 2: Setup
  25 +environment</a>
  26 +</p>
  27 +
  28 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  29 +<a href="#Step_3:_Install_ctatools">Step 3: Install
  30 +ctatools</a>
  31 +</p>
  32 +
  33 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Known_Problems">Known Problems</a></p>
  34 +
  35 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Getting_Help">Getting Help</a></p>
  36 +
  37 +<br>
  38 +
  39 +<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-weight: bold;">
  40 +Note:</span> These installation instructions apply to
  41 +ctatools-00-01-00.&nbsp;ctatools-00-01-00
  42 +require&nbsp;GammaLib-00-04-05
  43 +to be installed on your system.
  44 +</p>
  45 +
  46 +<br>
  47 +
  48 +<p class="Title"><a name="Step_1:_Install_GammaLib"></a>Step
  49 +1: Install GammaLib</p>
  50 +
  51 +<p style="padding-top: 0pt; text-align: left;" class="Body">ctatools
  52 +depends on GammaLib and thus GammaLib needs to be installed on your
  53 +system prior to installing ctatools. If you do not have GammaLib
  54 +installed, or if you need to upgrade GammaLib, fetch the latest copy
  55 +from <a href="https://sourceforge.net/projects/gammalib/" target="_blank">https://sourceforge.net/projects/gammalib/</a>
  56 +and
  57 +follow the GammaLib installation instructions on
  58 +<a href="http://gammalib.sourceforge.net/" target="_blank">http://gammalib.sourceforge.net/</a>.
  59 +<br>
  60 +
  61 +<br>
  62 +
  63 +</p>
  64 +
  65 +<p class="Title"><a name="Step_2:_Setup_environment"></a>Step
  66 +2: Setup environment</p>
  67 +
  68 +<p style="padding-top: 0pt; text-align: left;" class="Body">Before
  69 +using GammaLib (and ctatools use GammaLib) you have to setup some
  70 +environment variables.
  71 +This will be done automatically by an initialisation script that will
  72 +be installed in the <span style="font-family: Courier New,Courier,monospace;">bin</span>
  73 +directory. Assuming that you have installed GammaLib in the default
  74 +directory
  75 +<span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma</span>
  76 +you need to add the following to your <span style="font-family: Courier New,Courier,monospace;">.bashrc</span>
  77 +or <span style="font-family: Courier New,Courier,monospace;">$HOME/.profile</span>
  78 +script on a Linux
  79 +machine:
  80 +</p>
  81 +
  82 +<p class="Code">export GAMMALIB=/usr/local/gamma<br>
  83 +
  84 +source $GAMMALIB/bin/gammalib-init.sh
  85 +</p>
  86 +
  87 +<p style="padding-top: 0pt; text-align: left;" class="Body">If
  88 +you use C shell or a variant then add the following to your
  89 +<span style="font-family: Courier New,Courier,monospace;">.cshrc</span>
  90 +or <span style="font-family: Courier New,Courier,monospace;">.tcshrc</span>
  91 +script:
  92 +</p>
  93 +
  94 +<p class="Code">setenv GAMMALIB /usr/local/gamma<br>
  95 +
  96 +source $GAMMALIB/bin/gammalib-init.csh </p>
  97 +
  98 +<br>
  99 +
  100 +<br>
  101 +
  102 +<p class="Title"><a name="Step_3:_Install_ctatools"></a>Step
  103 +3: Install ctatools</p>
  104 +
  105 +<p style="padding-top: 0pt; text-align: left;" class="Body">After
  106 +downloading the ctatools tarball, save it in an appropriate location
  107 +(for example <span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma/src</span>),
  108 +and type</p>
  109 +
  110 +<p class="Code">
  111 +&gt; tar xvfz ctatools-01-00-00.tar.gz
  112 +</p>
  113 +
  114 +<p style="padding-top: 0pt; text-align: left;" class="Body">Step
  115 +in the created directory using
  116 +</p>
  117 +
  118 +<p class="Code">
  119 +&gt; cd ctatools-01-00-00
  120 +</p>
  121 +
  122 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  123 +and build and install ctatools by typing</p>
  124 +
  125 +<p class="Code">
  126 +&gt; ./configure<br>
  127 +
  128 +&gt; make<br>
  129 +
  130 +&gt; make install
  131 +</p>
  132 +
  133 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  134 +at the operating system prompt.
  135 +The <span style="font-family: Courier New,Courier,monospace;">./configure</span>
  136 +command customizes the Makefiles for the particular
  137 +system,
  138 +the <span style="font-family: Courier New,Courier,monospace;">make</span>
  139 +command compiles the source files and builds the executables, and
  140 +the <span style="font-family: Courier New,Courier,monospace;">make
  141 +install</span> command installs the executables in the <span style="font-family: Courier New,Courier,monospace;">bin</span>
  142 +directory.
  143 +Type <span style="font-family: Courier New,Courier,monospace;">./configure</span>
  144 +and not simply <span style="font-family: Courier New,Courier,monospace;">configure</span>
  145 +to ensure that the
  146 +configuration
  147 +script in the current directory is run and not some other system-wide
  148 +configuration
  149 +script.&nbsp;</p>
  150 +
  151 +<br>
  152 +
  153 +<p style="padding-top: 0pt; text-align: left;" class="Body">By
  154 +default, the install directory is set to
  155 +<span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma</span>.
  156 +To change the install directory, an optional <span style="font-family: Courier New,Courier,monospace;">--prefix</span>
  157 +argument should be
  158 +given,
  159 +for example:
  160 +</p>
  161 +
  162 +<p class="Code">
  163 +&gt; ./configure --prefix=/usr/local
  164 +</p>
  165 +
  166 +<p style="padding-top: 0pt; text-align: left;" class="Body">A
  167 +full list of configuration options can be found using</p>
  168 +
  169 +<p class="Code">
  170 +&gt; ./configure --help
  171 +</p>
  172 +
  173 +<br>
  174 +
  175 +<p class="Title"><a name="Known_Problems"></a>Known
  176 +Problems</p>
  177 +
  178 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  179 +<span style="font-weight: bold; font-size: 14px;">Solaris</span>
  180 +<br>
  181 +
  182 +ctatools has been compiled successfully on Solaris 2.10 using the Sun
  183 +Studio compiler. However, GammaLib symbols are
  184 +not globally exported due to a strage behaviour of the Sun Studio
  185 +compiler. This prevents for example GammaLib library from catching
  186 +its own exceptions and from registering models. Consequently, many
  187 +functionnalities will not work.</p>
  188 +
  189 +<br>
  190 +
  191 +<p style="padding-top: 0pt; text-align: left;" class="Body">Using
  192 +gcc (version 3.4.3), ctatools and GammaLib works correctly on Solaris
  193 +2.10, yet loading ctatools or GammaLib as a Python module fails.
  194 +<br>
  195 +
  196 +<br>
  197 +
  198 +</p>
  199 +
  200 +<br>
  201 +
  202 +<p class="Title"><a name="Getting_Help"></a>Getting
  203 +Help</p>
  204 +
  205 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  206 +Any questions, bug reports, or suggested enhancements related to
  207 +ctatools should be submitted to
  208 +<a href="mailto:knodlseder@cesr.fr">knodlseder@cesr.fr</a>.
  209 +</p>
  210 +
  211 +</body>
  212 +</html>
doc/html/menu.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  6 + <title>Menu</title>
  7 +
  8 +
  9 + <link rel="stylesheet" type="text/css" media="screen,print" href="ctatools.css">
  10 +
  11 + <meta name="author" content="J&uuml;rgen Kn&ouml;dlseder">
  12 +
  13 +</head>
  14 +
  15 +
  16 +<body style="color: rgb(255, 255, 255); background-color: rgb(0, 32, 82);" link="#ffffff" alink="#ffffff" vlink="#cccccc">
  17 +
  18 +<table style="text-align: left; background-color: rgb(0, 32, 82); width: 861px; height: 35px;" border="0" cellpadding="0" cellspacing="0">
  19 +
  20 + <tbody>
  21 +
  22 + <tr>
  23 +
  24 + <td style="background-color: rgb(0, 32, 82); text-align: left; vertical-align: top; width: 732px;" class="Menu"> <a href="home.html" target="main">Home</a>
  25 +&nbsp;&nbsp;&nbsp;&nbsp; <a href="download.html" target="main">Download</a>
  26 +&nbsp;&nbsp;&nbsp;&nbsp; <a href="installation.html" target="main">Installation</a>
  27 +&nbsp;&nbsp;&nbsp;&nbsp; <a href="quickstart.html" target="main">Getting Started</a>
  28 +&nbsp;&nbsp;&nbsp;&nbsp; <a href="documentation.html" target="main">Documentation</a>
  29 +&nbsp;&nbsp;&nbsp;&nbsp; <a href="about.html" target="main">About</a> </td>
  30 +
  31 + </tr>
  32 +
  33 + </tbody>
  34 +</table>
  35 +
  36 +</body>
  37 +</html>
doc/html/quickstart.html 0 → 100644
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +
  5 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  6 + <title>Getting Started</title>
  7 +
  8 +
  9 + <link href="ctatools.css" media="screen,print" type="text/css" rel="stylesheet">
  10 +
  11 +</head>
  12 +
  13 +
  14 +<body>
  15 +
  16 +<p class="Header">Getting started</p>
  17 +
  18 +<p class="Title">First steps with ctatools</p>
  19 +
  20 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  21 +This page gives provides a step-by-step description of the CTA data
  22 +analysis procedure implemented in ctatools. In this example we will
  23 +simulate data for the Crab nebula, observed on-axis, as a single source
  24 +in the CTA field of view.</p>
  25 +
  26 +<br>
  27 +
  28 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  29 +example consists of the following analysis steps:</p>
  30 +
  31 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Simulating_CTA_data">Simulating CTA data</a></p>
  32 +
  33 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Binning_CTA_data">Binning CTA data</a></p>
  34 +
  35 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Fitting_CTA_data">Fitting CTA data</a></p>
  36 +
  37 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Doing_an_unbinned_analysis">Doing an unbinned analysis</a></p>
  38 +
  39 +<br>
  40 +
  41 +<p style="padding-top: 0pt; text-align: left;" class="Body">And
  42 +please read also:
  43 +</p>
  44 +
  45 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Some_final_remarks">Some final remarks</a></p>
  46 +
  47 +<p style="padding-top: 0pt; text-align: left;" class="Body"><a href="#Getting_Help">Getting Help</a></p>
  48 +
  49 +<br>
  50 +
  51 +<br>
  52 +
  53 +<p class="Title"><a name="Simulating_CTA_data"></a>Simulating
  54 +CTA data</p>
  55 +
  56 +<p style="padding-top: 0pt; text-align: left;" class="Body">CTA
  57 +data are simulated by the executable <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>.
  58 +To start the executable, type <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
  59 +at the console prompt (which is denoted by <span style="font-family: Courier New,Courier,monospace;">&gt;</span>).
  60 +It will query for a number of parameters. The example shown below will
  61 +work on a system that has been installed in the default directory <span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma</span>.
  62 +If ctatools have been installed in another directory, please adjust the
  63 +parameter names accordingly.
  64 +</p>
  65 +
  66 +<p class="Code">
  67 +&gt; ctobssim<br>
  68 +
  69 +Model [test/data/crab_alone.xml] /usr/local/gamma/share/models/crab.xml
  70 +<br>
  71 +
  72 +Output event data file [events.fits] <br>
  73 +
  74 +Calibration database [test/irf] /usr/local/gamma/share/caldb/cta<br>
  75 +
  76 +Instrument response function [kb_E_50h_v3] <br>
  77 +
  78 +RA for ROI centre (degrees) (0-360) [83.63] <br>
  79 +
  80 +Dec for ROI centre (degrees) (-90-90) [22.01] <br>
  81 +
  82 +Radius of ROI (degrees) (0-180) [10.0] <br>
  83 +
  84 +Start time (MET in s) (0) [0.0] <br>
  85 +
  86 +End time (MET in s) (0) [1800.0] <br>
  87 +
  88 +Lower energy limit (TeV) (0) [0.1] <br>
  89 +
  90 +Upper energy limit (TeV) (0) [100.0] <br>
  91 +
  92 +</p>
  93 +
  94 +<p style="padding-top: 0pt; text-align: left;" class="Body">Each
  95 +line represents a query for one parameter. The line starts with a short
  96 +description of the parameter, followed by the default parameter value
  97 +proposed by <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
  98 +in squared brackets <span style="font-family: Courier New,Courier,monospace;">[ ]</span>.
  99 +If no parameter is entered (which is the case for the majority of
  100 +parameters shown here), the default parameter will be used.</p>
  101 +
  102 +<br>
  103 +
  104 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  105 +CTA instrument properties (effective area, PSF width) are taken for the
  106 +moment from Konrad Bernl&ouml;hrs sensitivity files which are
  107 +stored in <span style="font-family: Courier New,Courier,monospace;">/usr/local/gamma/share/caldb/cta</span>.
  108 +To test another CTA configuration you may adapt the instrument response
  109 +function name accordingly (see the <a href="#Some_final_remarks">final
  110 +remarks</a>).</p>
  111 +
  112 +<br>
  113 +
  114 +<p style="padding-top: 0pt; text-align: left;" class="Body">Events
  115 +are simulated based on the instrument properties and based on a source
  116 +and background model. Only events that fall within the
  117 +specified region of interest (ROI), defined as a circle around a sky
  118 +position in Right Ascension and Declination (in degrees), will be
  119 +stored in the output event data file. The duration of the simulation is
  120 +taken here to 30 minutes (or 1800 seconds). Events are simulated for
  121 +energies between 0.1 and 100 TeV.</p>
  122 +
  123 +<br>
  124 +
  125 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  126 +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>:
  127 +</p>
  128 +
  129 +<p class="Code">
  130 +&lt;?xml version="1.0" standalone="no"?&gt;<br>
  131 +
  132 +&lt;source_library title="source library"&gt;<br>
  133 +
  134 +&nbsp; &lt;source name="MAGIC Crab (Albert et al. 2008, ApJ,
  135 +674, 1037)" type="PointSource"&gt;<br>
  136 +
  137 +&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
  138 +
  139 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  140 +&lt;parameter name="Prefactor" scale="1e-16" value="5.7"&nbsp;
  141 +min="1e-07" max="1000.0" free="1"/&gt;<br>
  142 +
  143 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  144 +&lt;parameter name="Index"&nbsp;&nbsp;&nbsp;&nbsp;
  145 +scale="-1"&nbsp;&nbsp;&nbsp; value="2.48"
  146 +min="0.0"&nbsp;&nbsp; max="+5.0"&nbsp;&nbsp;
  147 +free="1"/&gt;<br>
  148 +
  149 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  150 +&lt;parameter name="Scale"&nbsp;&nbsp;&nbsp;&nbsp;
  151 +scale="1e6"&nbsp;&nbsp; value="0.3"&nbsp;
  152 +min="0.01"&nbsp; max="1000.0" free="0"/&gt;<br>
  153 +
  154 +&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
  155 +
  156 +&nbsp;&nbsp;&nbsp; &lt;spatialModel
  157 +type="SkyDirFunction"&gt;<br>
  158 +
  159 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  160 +name="RA"&nbsp; scale="1.0" value="83.6331" min="-360" max="360"
  161 +free="0"/&gt;<br>
  162 +
  163 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  164 +name="DEC" scale="1.0" value="22.0145" min="-90"&nbsp;
  165 +max="90"&nbsp; free="0"/&gt;<br>
  166 +
  167 +&nbsp;&nbsp;&nbsp; &lt;/spatialModel&gt;<br>
  168 +
  169 +&nbsp; &lt;/source&gt;<br>
  170 +
  171 +&nbsp; &lt;source name="Background" type="RadialAcceptance"
  172 +instrument="CTA"&gt;<br>
  173 +
  174 +&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
  175 +
  176 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  177 +&lt;parameter name="Prefactor" scale="1e-6" value="61.8"
  178 +min="0.0"&nbsp; max="1000.0" free="1"/&gt;<br>
  179 +
  180 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  181 +&lt;parameter name="Index"&nbsp;&nbsp;&nbsp;&nbsp;
  182 +scale="-1"&nbsp;&nbsp; value="1.85" min="0.0"&nbsp;
  183 +max="+5.0"&nbsp;&nbsp; free="1"/&gt;<br>
  184 +
  185 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  186 +&lt;parameter name="Scale"&nbsp;&nbsp;&nbsp;&nbsp;
  187 +scale="1e6"&nbsp; value="1.0"&nbsp; min="0.01" max="1000.0"
  188 +free="0"/&gt;<br>
  189 +
  190 +&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
  191 +
  192 +&nbsp;&nbsp;&nbsp; &lt;radialModel
  193 +type="Gaussian"&gt;<br>
  194 +
  195 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  196 +&lt;parameter name="Sigma" scale="1.0" value="3.0" min="0.01"
  197 +max="10.0" free="1"/&gt;<br>
  198 +
  199 +&nbsp;&nbsp;&nbsp; &lt;/radialModel&gt;<br>
  200 +
  201 +&nbsp; &lt;/source&gt;<br>
  202 +
  203 +&lt;/source_library&gt;
  204 +</p>
  205 +
  206 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  207 +model consists of a source library that contains 2
  208 +"sources":&nbsp;the Crab nebula and an instrumental background
  209 +model.</p>
  210 +
  211 +<br>
  212 +
  213 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  214 +Crab nebula is modelled by a factorized sky model that has a spectral
  215 +and a spatial component (tags <span style="font-family: Courier New,Courier,monospace;">&lt;spectrum&gt;</span>
  216 +and <span style="font-family: Courier New,Courier,monospace;">&lt;spatialModel&gt;</span>,
  217 +respectively). The spectrum is modelled by a power law, which is
  218 +defined by 3 parameters: the <span style="font-family: Courier New,Courier,monospace;">Prefactor</span>,
  219 +the <span style="font-family: Courier New,Courier,monospace;">Index</span>
  220 +and the <span style="font-family: Courier New,Courier,monospace;">Scale</span>.
  221 +The spatial model has 2 parameters: Right Ascension in degrees (<span style="font-family: Courier New,Courier,monospace;">RA</span>),
  222 +and Declination in degrees (<span style="font-family: Courier New,Courier,monospace;">DEC</span>).
  223 +Each parameter has a <span style="font-family: Courier New,Courier,monospace;">value</span>
  224 +and a <span style="font-family: Courier New,Courier,monospace;">scale</span>
  225 +factor, the real value of the parameter being the product <span style="font-family: Courier New,Courier,monospace;">value *
  226 +scale</span>. Typically, <span style="font-family: Courier New,Courier,monospace;">scale</span>
  227 +is chosen so that <span style="font-family: Courier New,Courier,monospace;">value</span>
  228 +is of the order of 1 (this is relevant for model fitting later). In
  229 +addition,&nbsp;<span style="font-family: Courier New,Courier,monospace;">value</span>
  230 +is bound by a minimum (<span style="font-family: Courier New,Courier,monospace;">min</span>)
  231 +and maximum (<span style="font-family: Courier New,Courier,monospace;">max</span>)
  232 +value, and a parameter may be free (<span style="font-family: Courier New,Courier,monospace;">free="1"</span>)
  233 +or fixed (<span style="font-family: Courier New,Courier,monospace;">free="0"</span>).
  234 +The <span style="font-family: Courier New,Courier,monospace;">min</span>,
  235 +<span style="font-family: Courier New,Courier,monospace;">max</span>,
  236 +and <span style="font-family: Courier New,Courier,monospace;">free</span>
  237 +attributes are not relevant here for the simulations, but they will be
  238 +important for the model fitting later.</p>
  239 +
  240 +<br>
  241 +
  242 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  243 +spectral intensity <span style="font-family: Courier New,Courier,monospace;">I(E)</span>
  244 +(in units of photons/cm2/s/MeV) of the power law is given by&nbsp;</p>
  245 +
  246 +<p style="padding-top: 0pt; text-align: center; font-family: Courier New,Courier,monospace;" class="Body">I(E) = Prefactor * (E/Scale)^Index</p>
  247 +
  248 +<p style="padding-top: 0pt; text-align: left;" class="Body">where
  249 +the <span style="font-family: Courier New,Courier,monospace;">E</span>
  250 +and <span style="font-family: Courier New,Courier,monospace;">Scale</span>
  251 +are given in MeV.</p>
  252 +
  253 +<br>
  254 +
  255 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  256 +instrumental background of CTA is modelled by a factorized data model
  257 +that has a spectral and a radial component (tags <span style="font-family: Courier New,Courier,monospace;">&lt;spectrum&gt;</span>
  258 +and <span style="font-family: Courier New,Courier,monospace;">&lt;radialModel&gt;</span>,
  259 +respectively). The spectral component describes the <span style="font-weight: bold;">on-axis background
  260 +counting rate</span> of CTA as function of energy in units of
  261 +counts/s/sr/TeV.
  262 +The radial component describes the variation of the background rate
  263 +with <span style="font-weight: bold;">offset angle squared</span>,
  264 +(i.e.&nbsp;square of the offset angle with respect to the pointing
  265 +direction) which is modelled here by a Gaussian. The only parameter of
  266 +the radial component is the width of the Gaussian <span style="font-family: Courier New,Courier,monospace;">Sigma</span>,
  267 +which is here set to 3 degrees squared.</p>
  268 +
  269 +<br>
  270 +
  271 +<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
  272 +has a couple of hidden parameters, the most important one being
  273 +certainly <span style="font-family: Courier New,Courier,monospace;">seed</span>.
  274 +<span style="font-family: Courier New,Courier,monospace;">seed</span>
  275 +is an integer that specifies the seed value for the random number
  276 +generator, and changing this parameter will allow to generate
  277 +statistically independent Monte Carlo samples of CTA event data. To
  278 +use for example a seed value of 41 one should type:
  279 +</p>
  280 +
  281 +<p class="Code">&gt; ctobssim seed=41<br>
  282 +
  283 +</p>
  284 +
  285 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  286 +<span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
  287 +will write 2 files in the working directory: <span style="font-family: Courier New,Courier,monospace;">events.fits</span>
  288 +and <span style="font-family: Courier New,Courier,monospace;">ctobssim.log</span>.
  289 +The first file contains the simulated events in FITS format and can be
  290 +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>
  291 +or <a href="http://hea-www.harvard.edu/RD/ds9/" target="_blank"><span style="font-family: Courier New,Courier,monospace;">ds9</span></a>.
  292 +The FITS file will contain 3 extensions: an empty primary image, a
  293 +binary table named <span style="font-family: Courier New,Courier,monospace;">EVENTS</span>
  294 +that holds the events (one row per event), and a binary table named <span style="font-family: Courier New,Courier,monospace;">GTI</span>
  295 +holding the Good Time Interval (for the moment a single row with 2
  296 +columns providing the start and the stop time of the simulated time
  297 +interval).</p>
  298 +
  299 +<br>
  300 +
  301 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  302 +second file produced by <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
  303 +is a human readable log file that contains information about
  304 +the job execution. As example, the last lines from this file are shown
  305 +here:</p>
  306 +
  307 +<p class="Code">2011-01-31T23:50:39: +==================+<br>
  308 +
  309 +2011-01-31T23:50:39: | Simulate photons |<br>
  310 +
  311 +2011-01-31T23:50:39: +==================+<br>
  312 +
  313 +2011-01-31T23:50:39:&nbsp; Simulated photons .........: 33943<br>
  314 +
  315 +2011-01-31T23:50:39:&nbsp; Simulation area ...........: 3.2e+10 cm2<br>
  316 +
  317 +2011-01-31T23:50:39:&nbsp; Simulation cone ...........: RA=83.63
  318 +deg, Dec=22.01deg, r=10 deg<br>
  319 +
  320 +2011-01-31T23:50:39:&nbsp; Time interval .............: 0 s - 1800 s<br>
  321 +
  322 +2011-01-31T23:50:39:&nbsp; Energy range ..............: 100 GeV -
  323 +100 TeV<br>
  324 +
  325 +2011-01-31T23:50:39:&nbsp; Random number seed ........: 1<br>
  326 +
  327 +2011-01-31T23:50:39: <br>
  328 +
  329 +2011-01-31T23:50:39: +=================+<br>
  330 +
  331 +2011-01-31T23:50:39: | Simulate events |<br>
  332 +
  333 +2011-01-31T23:50:39: +=================+<br>
  334 +
  335 +2011-01-31T23:50:39:&nbsp; MC source events ..........: 649<br>
  336 +
  337 +2011-01-31T23:50:39:&nbsp; MC background events ......: 3407<br>
  338 +
  339 +2011-01-31T23:50:39: <br>
  340 +
  341 +2011-01-31T23:50:39: +==========================+<br>
  342 +
  343 +2011-01-31T23:50:39: | Save events in FITS file |<br>
  344 +
  345 +2011-01-31T23:50:39: +==========================+<br>
  346 +
  347 +2011-01-31T23:50:39: <br>
  348 +
  349 +2011-01-31T23:50:39: Application "ctobssim" terminated after consuming
  350 +14 seconds of CPU time.<br>
  351 +
  352 +<br>
  353 +
  354 +</p>
  355 +
  356 +<p style="padding-top: 0pt; text-align: left;" class="Body">Each
  357 +line starts with the UTC time at which the line has been written. In
  358 +this
  359 +run, 33943 Crab photons have been thrown over an area of 3.2 square
  360 +kilometres during a time interval of 1800 seconds. 649 of these photons
  361 +have been registered by CTA as events. In the same time
  362 +interval, 3407 background events have been registred by CTA.</p>
  363 +
  364 +<br>
  365 +
  366 +<br>
  367 +
  368 +<p class="Title"><a name="Binning_CTA_data"></a>Binning
  369 +CTA data</p>
  370 +
  371 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  372 +As next analysis step the data are binned in a counts map using the
  373 +executable <span style="font-family: Courier New,Courier,monospace;">ctbin</span>.
  374 +A counts map is a 3 dimensional data cube, spanned by Right Ascension
  375 +(or Galactic longitude), Declination (or Galactic latitude), and the
  376 +logarithm (base 10) of energy.</p>
  377 +
  378 +<br>
  379 +
  380 +<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctbin</span>
  381 +is executed by typing:</p>
  382 +
  383 +<p class="Code">
  384 +&gt; ctbin<br>
  385 +
  386 +Event data file name [test/data/crab_events.fits.gz] events.fits<br>
  387 +
  388 +Output file name [cntmap.fits] <br>
  389 +
  390 +Start value for first energy bin in TeV [0.1] <br>
  391 +
  392 +Stop value for last energy bin in TeV [100.0] <br>
  393 +
  394 +Number of energy bins [20] <br>
  395 +
  396 +Projection method e.g. AIT|ARC|CAR|GLS|MER|NCP|SIN|STG|TAN [CAR] <br>
  397 +
  398 +Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] <br>
  399 +
  400 +First coordinate of image center in degrees (RA or galactic l) [83.63] <br>
  401 +
  402 +Second coordinate of image center in degrees (DEC or galactic b)
  403 +[22.01] <br>
  404 +
  405 +Image scale (in degrees/pixel) [0.02] <br>
  406 +
  407 +Size of the X axis in pixels [200] <br>
  408 +
  409 +Size of the Y axis in pixels [200] </p>
  410 +
  411 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  412 +In this example we adjust the event data file name and accept all the
  413 +remaining parameter defaults as they perfectly
  414 +satisfy our needs. The counts map will be centred on the location of
  415 +the Crab (Right Ascension 83.63 degrees, Declination 22.01 degrees) and
  416 +will be aligned in celestial coordinates. A cartesian projection has
  417 +been selected (<span style="font-weight: bold;">note that
  418 +the cartesian projection is the only valid project available for the
  419 +moment</span>). The counts map has 200 x 200
  420 +spatial pixels of 0.02 x 0.02 degrees in size, hence it covers a total
  421 +area of 4 x 4 degrees.</p>
  422 +
  423 +<br>
  424 +
  425 +<p style="padding-top: 0pt; text-align: left;" class="Body">A
  426 +set of 20 counts maps will be created, which are logarithmically spaced
  427 +in energy, and which cover the energy range from 0.1 TeV to 100 TeV. In
  428 +this example, the counts map will be saved as <span style="font-family: Courier New,Courier,monospace;">cntmap.fits</span>
  429 +in the
  430 +working directory.
  431 +In addition to the counts map, that is stored as the primary image extension, the FITS
  432 +file also contains an extension named <span style="font-family: Courier New,Courier,monospace;">EBOUNDS</span>
  433 +that defines the energy boundaries that were used, and an extension <span style="font-family: Courier New,Courier,monospace;">GTI</span>
  434 +that defines the Good Time Intervals that have been used. The following
  435 +image shows the resulting FITS file. The <span style="font-family: Courier New,Courier,monospace;">EBOUNDS</span> table has 20 rows, one for each energy bin, while the <span style="font-family: Courier New,Courier,monospace;">GTI</span> table has jusr a single row, indicating the start and stop time of the simulated data.</p>
  436 +<br>
  437 +
  438 +<div style="text-align: center;"><img alt="CTA counts map FITS file" src="images/cntmap-fits.jpg"><br>
  439 +
  440 +</div>
  441 +
  442 +<br>
  443 +
  444 +<p style="padding-top: 0pt; text-align: left;" class="Body">An
  445 +image
  446 +of the first bin, covering the energy range 100 -&nbsp;141 GeV, is
  447 +shown below:
  448 +</p>
  449 +
  450 +<div style="text-align: center;"><img style="width: 496px; height: 518px;" alt="CTA counts map" src="images/cntmap-map.jpg"><br>
  451 +
  452 +</div>
  453 +
  454 +<br>
  455 +
  456 +<p style="padding-top: 0pt; text-align: left;" class="Body">For
  457 +illustrating, the last few lines of the log file <span style="font-family: Courier New,Courier,monospace;">ctbin.log</span>
  458 +are shown below:
  459 +</p>
  460 +
  461 +<p class="Code">2011-02-01T09:28:05: +=========+<br>
  462 +
  463 +2011-02-01T09:28:05: | Binning |<br>
  464 +
  465 +2011-02-01T09:28:05: +=========+<br>
  466 +
  467 +2011-02-01T09:28:05:&nbsp; Events in list ............: 4056<br>
  468 +
  469 +2011-02-01T09:28:05:&nbsp; Events in map .............: 3683<br>
  470 +
  471 +2011-02-01T09:28:05:&nbsp; Events outside map area ...: 373<br>
  472 +
  473 +2011-02-01T09:28:05:&nbsp; Events outside energy bins : 0<br>
  474 +
  475 +2011-02-01T09:28:05: <br>
  476 +
  477 +2011-02-01T09:28:05: +============+<br>
  478 +
  479 +2011-02-01T09:28:05: | Counts map |<br>
  480 +
  481 +2011-02-01T09:28:05: +============+<br>
  482 +
  483 +2011-02-01T09:28:05: === GSkymap ===<br>
  484 +
  485 +2011-02-01T09:28:05:&nbsp; Number of pixels ..........: 40000<br>
  486 +
  487 +2011-02-01T09:28:05:&nbsp; Number of maps ............: 20<br>
  488 +
  489 +2011-02-01T09:28:05:&nbsp; X axis dimension ..........: 200<br>
  490 +
  491 +2011-02-01T09:28:05:&nbsp; Y axis dimension ..........: 200<br>
  492 +
  493 +2011-02-01T09:28:05: === GWcsCAR ===<br>
  494 +
  495 +2011-02-01T09:28:05:&nbsp; Coordinate system .........: EQU<br>
  496 +
  497 +2011-02-01T09:28:05:&nbsp; Reference coordinate ......: (83.63,
  498 +22.01) deg<br>
  499 +
  500 +2011-02-01T09:28:05:&nbsp; Reference pixel ...........: (100.5,
  501 +100.5)<br>
  502 +
  503 +2011-02-01T09:28:05:&nbsp; Increment at reference ....: (0.02,
  504 +0.02) deg<br>
  505 +
  506 +2011-02-01T09:28:05:&nbsp; Coordinate of North Pole ..: (180, 0) deg<br>
  507 +
  508 +2011-02-01T09:28:05:&nbsp; CD matrix .................: [0.02 0][0
  509 +0.02]<br>
  510 +
  511 +2011-02-01T09:28:05:&nbsp; Inverse CD matrix .........: [50 -0][-0
  512 +50]<br>
  513 +
  514 +2011-02-01T09:28:05:&nbsp; Coordinate of native pole .: (83.63,
  515 +112.01)<br>
  516 +
  517 +2011-02-01T09:28:05: <br>
  518 +
  519 +2011-02-01T09:28:05: Application "ctbin" terminated after consuming 10
  520 +seconds of CPU time.
  521 +</p>
  522 +
  523 +<p style="padding-top: 0pt; text-align: left;" class="Body">From
  524 +the 4056 events that have been simulated and stored in the <span style="font-family: Courier New,Courier,monospace;">events.fits</span>
  525 +file, 3683 lie within the map boundaries and are thus put into the
  526 +resulting counts map. The counts map is stored in a cartesian
  527 +projection in a <a href="http://fits.gsfc.nasa.gov/fits_wcs.html" target="_blank">World Coordinate System (WCS)</a>
  528 +compliant format.
  529 +</p>
  530 +
  531 +<br>
  532 +
  533 +<br>
  534 +
  535 +<p class="Title"><a name="Fitting_CTA_data"></a>Fitting
  536 +CTA data</p>
  537 +
  538 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  539 +Now we are ready to fit the simulated data with a model. For simplicity
  540 +we use in this example the same model that we used to simulate the data
  541 +with <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>.
  542 +Model fitting is done using the executable <span style="font-family: Courier New,Courier,monospace;">ctlike</span>,
  543 +and we do the fit by typing:
  544 +</p>
  545 +
  546 +<p class="Code">
  547 +&gt; ctlike<br>
  548 +
  549 +Maximum likelihood method [BINNED] <br>
  550 +
  551 +Calibration database [test/irf] /usr/local/gamma/share/caldb/cta<br>
  552 +
  553 +Instrument response function [kb_E_50h_v3] <br>
  554 +
  555 +Source model [test/data/crab.xml] /usr/local/gamma/share/models/crab.xml<br>
  556 +
  557 +Source model output file [crab_results.xml] <br>
  558 +
  559 +Counts map [test/data/crab_cntmap.fits.gz] cntmap.fits
  560 +</p>
  561 +
  562 +<p style="padding-top: 0pt; text-align: left;" class="Body">Fitting
  563 +of the data is done in <span style="font-family: Courier New,Courier,monospace;">BINNED</span>
  564 +mode, which means that the events have been binned into a counts map
  565 +and the fit computes the log-likelihood function by summing over all
  566 +200 x 200 x 20 bins of the counts map. There is an alternative method,
  567 +the so called <span style="font-family: Courier New,Courier,monospace;">UNBINNED</span>
  568 +mode, where the events are not binned into a counts map and the
  569 +log-likelihood is computed directly by summing over all events. We will
  570 +explore
  571 +the <span style="font-family: Courier New,Courier,monospace;">UNBINNED</span>
  572 +mode <a href="#Doing_an_unbinned_analysis">later</a>.</p>
  573 +
  574 +<br>
  575 +
  576 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  577 +One of the parameters given to <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  578 +is a source model output file (we specified <span style="font-family: Courier New,Courier,monospace;">crab_results.xml</span>
  579 +in the example), and this file will be a copy of the model XML file
  580 +where the parameter values have been replaced by the fit results. In
  581 +addition, the statistical uncertainties are added for each fitted
  582 +parameter using the attribute <span style="font-family: Courier New,Courier,monospace;">error</span>.
  583 +Below we show the XML result file that has been produced by the run:
  584 +</p>
  585 +
  586 +<p class="Code">&lt;?xml version="1.0"
  587 +encoding="UTF-8" standalone="no"?&gt;<br>
  588 +
  589 +&lt;source_library title="source library"&gt;<br>
  590 +
  591 +&nbsp; &lt;source name="MAGIC Crab (Albert et al. 2008, ApJ,
  592 +674, 1037)" type="DiffuseSource"&gt;<br>
  593 +
  594 +&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
  595 +
  596 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  597 +name="Prefactor" value="5.7765" error="0.243328" scale="1e-16"
  598 +min="1e-07" max="1000" free="1" /&gt;<br>
  599 +
  600 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  601 +name="Index" value="2.49937" error="0.0330191" scale="-1" min="0"
  602 +max="5" free="1" /&gt;<br>
  603 +
  604 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  605 +name="Scale" value="0.3" scale="1e+06" min="0.01" max="1000" free="0"
  606 +/&gt;<br>
  607 +
  608 +&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
  609 +
  610 +&nbsp;&nbsp;&nbsp; &lt;spatialModel
  611 +type="SkyDirFunction"&gt;<br>
  612 +
  613 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  614 +name="RA" value="83.6331" scale="1" min="-360" max="360" free="0"
  615 +/&gt;<br>
  616 +
  617 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  618 +name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0"
  619 +/&gt;<br>
  620 +
  621 +&nbsp;&nbsp;&nbsp; &lt;/spatialModel&gt;<br>
  622 +
  623 +&nbsp; &lt;/source&gt;<br>
  624 +
  625 +&nbsp; &lt;source name="Background" type="RadialAcceptance"
  626 +instrument="CTA"&gt;<br>
  627 +
  628 +&nbsp;&nbsp;&nbsp; &lt;spectrum type="PowerLaw"&gt;<br>
  629 +
  630 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  631 +name="Prefactor" value="61.7696" error="1.89829" scale="1e-06" min="0"
  632 +max="1000" free="1" /&gt;<br>
  633 +
  634 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  635 +name="Index" value="1.87195" error="0.0166039" scale="-1" min="0"
  636 +max="5" free="1" /&gt;<br>
  637 +
  638 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  639 +name="Scale" value="1" scale="1e+06" min="0.01" max="1000" free="0"
  640 +/&gt;<br>
  641 +
  642 +&nbsp;&nbsp;&nbsp; &lt;/spectrum&gt;<br>
  643 +
  644 +&nbsp;&nbsp;&nbsp; &lt;radialModel
  645 +type="Gaussian"&gt;<br>
  646 +
  647 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter
  648 +name="Sigma" value="3.00467" error="0.071261" scale="1" min="0.01"
  649 +max="10" free="1" /&gt;<br>
  650 +
  651 +&nbsp;&nbsp;&nbsp; &lt;/radialModel&gt;<br>
  652 +
  653 +&nbsp; &lt;/source&gt;<br>
  654 +
  655 +&lt;/source_library&gt;
  656 +</p>
  657 +
  658 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  659 +In this example, the <span style="font-family: Courier New,Courier,monospace;">Prefactor</span>
  660 +and <span style="font-family: Courier New,Courier,monospace;">Index</span>
  661 +of the spectral model for the Crab as well as the <span style="font-family: Courier New,Courier,monospace;">Prefactor</span>,
  662 +<span style="font-family: Courier New,Courier,monospace;">Index</span>
  663 +and <span style="font-family: Courier New,Courier,monospace;">Sigma</span>
  664 +parameter of the radial acceptance model have been fitted (all
  665 +parameters having the attribute <span style="font-family: Courier New,Courier,monospace;">free="1"</span>
  666 +are fitted). <span style="font-weight: bold;">One could
  667 +be tempted to try fitting also the location of the Crab point source,
  668 +yet this feature is not yet implemented</span>.
  669 +</p>
  670 +
  671 +<br>
  672 +
  673 +<p style="padding-top: 0pt; text-align: left;" class="Body">To
  674 +get more details about the model fitting one can inspect the log file.
  675 +Below
  676 +we show the last lines of the <span style="font-family: Courier New,Courier,monospace;">ctlike.log</span>
  677 +log file that has been produced by this run:
  678 +</p>
  679 +
  680 +<p class="Code">2011-02-01T09:53:17:
  681 ++=================================+<br>
  682 +
  683 +2011-02-01T09:53:17: | Maximum likelihood optimisation |<br>
  684 +
  685 +2011-02-01T09:53:17: +=================================+<br>
  686 +
  687 +2011-02-01T09:53:20:&nbsp; Initial iteration: func=18092.1,
  688 +Lambda=0.001<br>
  689 +
  690 +2011-02-01T09:53:24:&nbsp; Iteration 1: func=18090, Lambda=0.0001,
  691 +delta=2.08792<br>
  692 +
  693 +2011-02-01T09:53:27:&nbsp; Iteration 2: func=18090, Lambda=1e-05,
  694 +delta=0.0021398<br>
  695 +
  696 +2011-02-01T09:53:30:&nbsp; Iteration 3: func=18090, Lambda=1e-06,
  697 +delta=4.80215e-06<br>
  698 +
  699 +2011-02-01T09:53:34:&nbsp; Iteration 4: func=18090, Lambda=1e-07,
  700 +delta=1.7495e-08<br>
  701 +
  702 +2011-02-01T09:53:37: <br>
  703 +
  704 +2011-02-01T09:53:37: +=========================================+<br>
  705 +
  706 +2011-02-01T09:53:37: | Maximum likelihood optimisation results |<br>
  707 +
  708 +2011-02-01T09:53:37: +=========================================+<br>
  709 +
  710 +2011-02-01T09:53:37: === GOptimizerLM ===<br>
  711 +
  712 +2011-02-01T09:53:37:&nbsp; Optimized function value ..: 18090<br>
  713 +
  714 +2011-02-01T09:53:37:&nbsp; Absolute precision ........: 1e-06<br>
  715 +
  716 +2011-02-01T09:53:37:&nbsp; Optimization status .......: converged<br>
  717 +
  718 +2011-02-01T09:53:37:&nbsp; Number of parameters ......: 11<br>
  719 +
  720 +2011-02-01T09:53:37:&nbsp; Number of free parameters .: 5<br>
  721 +
  722 +2011-02-01T09:53:37:&nbsp; Number of iterations ......: 4<br>
  723 +
  724 +2011-02-01T09:53:37:&nbsp; Lambda ....................: 1e-07<br>
  725 +
  726 +2011-02-01T09:53:37:&nbsp; Maximum log likelihood ....: -18090<br>
  727 +
  728 +2011-02-01T09:53:37:&nbsp; Npred .....................: 3683<br>
  729 +
  730 +2011-02-01T09:53:37: === GModels ===<br>
  731 +
  732 +2011-02-01T09:53:37:&nbsp; Number of models ..........: 2<br>
  733 +
  734 +2011-02-01T09:53:37:&nbsp; Number of parameters ......: 11<br>
  735 +
  736 +2011-02-01T09:53:37: === GModelPointSource ===<br>
  737 +
  738 +2011-02-01T09:53:37:&nbsp; Name ......................: MAGIC Crab
  739 +(Albert et al. 2008, ApJ, 674, 1037)<br>
  740 +
  741 +2011-02-01T09:53:37:&nbsp; Instruments ...............: all<br>
  742 +
  743 +2011-02-01T09:53:37:&nbsp; Number of parameters ......: 6<br>
  744 +
  745 +2011-02-01T09:53:37:&nbsp; Number of spatial par's ...: 2<br>
  746 +
  747 +2011-02-01T09:53:37:&nbsp;&nbsp; RA .......................:
  748 +83.6331 [-360,360] deg (fixed,scale=1)<br>
  749 +
  750 +2011-02-01T09:53:37:&nbsp;&nbsp; DEC ......................:
  751 +22.0145 [-90,90] deg (fixed,scale=1)<br>
  752 +
  753 +2011-02-01T09:53:37:&nbsp; Number of spectral par's ..: 3<br>
  754 +
  755 +2011-02-01T09:53:37:&nbsp;&nbsp; Prefactor ................:
  756 +5.7765e-16 +/- 2.43328e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16)<br>
  757 +
  758 +2011-02-01T09:53:37:&nbsp;&nbsp; Index ....................:
  759 +-2.49937 +/-&nbsp;0.0330191 [-0,-5]&nbsp; (free,scale=-1)<br>
  760 +
  761 +2011-02-01T09:53:37:&nbsp;&nbsp; PivotEnergy ..............:
  762 +300000 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
  763 +
  764 +2011-02-01T09:53:37:&nbsp; Number of temporal par's ..: 1<br>
  765 +
  766 +2011-02-01T09:53:37:&nbsp;&nbsp; Constant .................: 1
  767 +(relative value) (fixed,scale=1)<br>
  768 +
  769 +2011-02-01T09:53:37: === GCTAModelRadialAcceptance ===<br>
  770 +
  771 +2011-02-01T09:53:37:&nbsp; Name ......................: Background<br>
  772 +
  773 +2011-02-01T09:53:37:&nbsp; Instruments ...............: CTA<br>
  774 +
  775 +2011-02-01T09:53:37:&nbsp; Model type ................: "Gaussian"
  776 +* "PowerLaw" * "Constant"<br>
  777 +
  778 +2011-02-01T09:53:37:&nbsp; Number of parameters ......: 5<br>
  779 +
  780 +2011-02-01T09:53:37:&nbsp; Number of radial par's ....: 1<br>
  781 +
  782 +2011-02-01T09:53:37:&nbsp;&nbsp; Sigma ....................:
  783 +3.00467 +/- 0.071261 [0.01,10] deg2 (free,scale=1)<br>
  784 +
  785 +2011-02-01T09:53:37:&nbsp; Number of spectral par's ..: 3<br>
  786 +
  787 +2011-02-01T09:53:37:&nbsp;&nbsp; Prefactor ................:
  788 +6.17696e-05 +/- 1.89829e-06 [0,0.001] ph/cm2/s/MeV (free,scale=1e-06)<br>
  789 +
  790 +2011-02-01T09:53:37:&nbsp;&nbsp; Index ....................:
  791 +-1.87195 +/-&nbsp;0.0166039 [-0,-5]&nbsp; (free,scale=-1)<br>
  792 +
  793 +2011-02-01T09:53:37:&nbsp;&nbsp; PivotEnergy ..............:
  794 +1e+06 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
  795 +
  796 +2011-02-01T09:53:37:&nbsp; Number of temporal par's ..: 1<br>
  797 +
  798 +2011-02-01T09:53:37:&nbsp;&nbsp; Constant .................: 1
  799 +(relative value) (fixed,scale=1)<br>
  800 +
  801 +2011-02-01T09:53:37: <br>
  802 +
  803 +2011-02-01T09:53:37: Application "ctlike" terminated after consuming 41
  804 +seconds of CPU time.
  805 +</p>
  806 +
  807 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  808 +maximum likelihood optimizer required 4 iterations to converge. This is
  809 +pretty fast, but recall that we used the same model file for the
  810 +simulation and for fitting, hence the initial parameter values are
  811 +already very close to the best fitting values. To see the impact of the
  812 +initial parameters on the fit result, you may re-run <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  813 +using another copy of the model XML file where the <span style="font-family: Courier New,Courier,monospace;">value</span>
  814 +attributes of the parameters that should be fitted are changed. You
  815 +will see that the optimizer requires a couple of more iterations, but
  816 +it should converge to the same solution (provided that the initial
  817 +values are not too far of the best fitting values).&nbsp;
  818 +</p>
  819 +
  820 +<br>
  821 +
  822 +<br>
  823 +
  824 +<p class="Title"><a name="Doing_an_unbinned_analysis"></a>Doing
  825 +an unbinned analysis</p>
  826 +
  827 +<p style="padding-top: 0pt; text-align: left;" class="Body">As
  828 +gamma-ray events are rare, the counts maps generated by <span style="font-family: Courier New,Courier,monospace;">ctbin</span>
  829 +will in general be sparse, having many empty pixels, in
  830 +particular at high energies. An alternative analysis technique consists
  831 +of working directly on the event list without binning the events in a
  832 +counts map. We
  833 +will see the benefit of such an analysis later once we re-run <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  834 +in unbinned mode.</p>
  835 +
  836 +<br>
  837 +
  838 +<p style="padding-top: 0pt; text-align: left;" class="Body">For
  839 +unbinned analysis we have first to define the data
  840 +space region over which the analysis is done. This is similiar to the <span style="font-family: Courier New,Courier,monospace;">ctbin</span>
  841 +step in binned analysis where we define the size of the counts map, the
  842 +energy range, and the time interval. For unbinned analysis we have no
  843 +such thing as a counts map, but we have to define over which region of
  844 +the data space the selected events are spread (because we have to
  845 +integrate
  846 +over this region to compute the total number of predicted events in the
  847 +data space that we analyse). Furthermore, we have to define what energy
  848 +range is covered, and what time interval is spanned by the data. All
  849 +this is done by the executable <span style="font-family: Courier New,Courier,monospace;">ctselect</span>,
  850 +which replaces the <span style="font-family: Courier New,Courier,monospace;">ctbin</span>
  851 +step in an unbinned analysis.</p>
  852 +
  853 +<br>
  854 +
  855 +<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctselect</span>
  856 +performs an event selection by choosing only&nbsp;events within a
  857 +given
  858 +region-of-interest (ROI), within a given energy band, and within a
  859 +given time interval from the input event list. The ROI is a circular
  860 +region on the sky, for which we define the centre (in celestial
  861 +coordinates) and the radius. Such a circular ROI is sometimes also
  862 +called an <span style="font-weight: bold;">acceptance cone</span>.
  863 +The following example shows how <span style="font-family: Courier New,Courier,monospace;">ctselect</span>
  864 +is invoked on the simulated
  865 +test data: </p>
  866 +
  867 +<p class="Code">
  868 +&gt; ctselect<br>
  869 +
  870 +Input event data file [test/data/crab_events.fits.gz]
  871 +events.fits<br>
  872 +
  873 +Output event data file [selected_events.fits] <br>
  874 +
  875 +RA for ROI centre (degrees) (0-360) [83.63] <br>
  876 +
  877 +Dec for ROI centre (degrees) (-90-90) [22.01] <br>
  878 +
  879 +Radius of ROI (degrees) (0-180) [3.0] <br>
  880 +
  881 +Start time (MET in s) (0) [0.0] <br>
  882 +
  883 +End time (MET in s) (0) [1800.0] <br>
  884 +
  885 +Lower energy limit (TeV) (0) [0.1] <br>
  886 +
  887 +Upper energy limit (TeV) (0) [100.0]<br>
  888 +
  889 +</p>
  890 +
  891 +<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-family: Courier New,Courier,monospace;">ctselect</span>
  892 +takes the input event list <span style="font-family: Courier New,Courier,monospace;">events.fits</span>,
  893 +performs an event selection, and writes the selected event into the
  894 +file <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>.
  895 +The parameters it will query for are the centre of the ROI, the
  896 +radius of the ROI, the start and stop time (in seconds), and the energy
  897 +lower and upper limits (in TeV). The event selection information is
  898 +also written as a set of <span style="font-weight: bold;">data
  899 +selection keywords</span> to the output events file <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>,
  900 +by respecting the same syntax that has been implemented for Fermi-LAT.
  901 +The following image is a screen dump of the data
  902 +selection keywords that have been written to the <span style="font-family: Courier New,Courier,monospace;">EVENTS</span>
  903 +header in the file <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>:</p>
  904 +
  905 +<br>
  906 +
  907 +<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">
  908 +</p>
  909 +
  910 +<br>
  911 +
  912 +<p style="padding-top: 0pt; text-align: left;" class="Body">It
  913 +is important for unbinned analysis that these data selection keywords
  914 +exist. If they don't exist, <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  915 +will not execute in unbinned mode.</p>
  916 +
  917 +<br>
  918 +
  919 +<p style="padding-top: 0pt; text-align: left;" class="Body">Below
  920 +we show also for completeness the last few lines of the <span style="font-family: Courier New,Courier,monospace;">ctselect.log</span>
  921 +file. It gives information about the specific data selection that has
  922 +been performed.
  923 +</p>
  924 +
  925 +<p class="Code">
  926 +2011-02-01T19:58:34: +=================+<br>
  927 +
  928 +2011-02-01T19:58:34: | Event selection |<br>
  929 +
  930 +2011-02-01T19:58:34: +=================+<br>
  931 +
  932 +2011-02-01T19:58:34:&nbsp; Time range ................: 0-1800<br>
  933 +
  934 +2011-02-01T19:58:34:&nbsp; Energy range ..............: 0.1-100 TeV<br>
  935 +
  936 +2011-02-01T19:58:34:&nbsp; Acceptance cone centre ....: RA=83.63,
  937 +DEC=22.01 deg<br>
  938 +
  939 +2011-02-01T19:58:34:&nbsp; Acceptance cone radius ....: 3 deg<br>
  940 +
  941 +2011-02-01T19:58:34:&nbsp; cfitsio selection .........: TIME
  942 +&gt;= 0 &amp;&amp; TIME &lt;= 1800 &amp;&amp;
  943 +ENERGY &gt;= 0.1 &amp;&amp; ENERGY &lt;= 100
  944 +&amp;&amp; ANGSEP(83.63,<br>
  945 +
  946 +22.01,RA,DEC) &lt;= 3<br>
  947 +
  948 +2011-02-01T19:58:34:&nbsp; FITS filename .............:
  949 +events.fits[EVENTS][TIME &gt;= 0 &amp;&amp; TIME &lt;=
  950 +1800 &amp;&amp; ENERGY &gt;= 0.1 &amp;&amp; ENERGY
  951 +&lt;= <br>
  952 +
  953 +100 &amp;&amp; ANGSEP(83.63,22.01,RA,DEC) &lt;= 3]<br>
  954 +
  955 +2011-02-01T19:58:34: <br>
  956 +
  957 +2011-02-01T19:58:34: Application "ctselect" terminated after consuming
  958 +10 seconds of CPU time.<br>
  959 +
  960 +&nbsp;<br>
  961 +
  962 +</p>
  963 +
  964 +<p style="padding-top: 0pt; text-align: left;" class="Body">Now
  965 +that the event selection has been performed, <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  966 +can be run in unbinned mode. To do this, you have to type <span style="font-family: Courier New,Courier,monospace;">UNBINNED</span>
  967 +when the maximum likelihood method is queried. The remaining parameters
  968 +are similar to binned mode, except for the last one that asks now for
  969 +an event data file instead of a counts map. Specify here the selected
  970 +event list <span style="font-family: Courier New,Courier,monospace;">selected_events.fits</span>
  971 +that has been produced by <span style="font-family: Courier New,Courier,monospace;">ctselect</span>.
  972 +To run <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  973 +in unbinned mode, type the following:
  974 +</p>
  975 +
  976 +<p class="Code">
  977 +&gt; ctlike<br>
  978 +
  979 +Maximum likelihood method [BINNED] UNBINNED <br>
  980 +
  981 +Calibration database [test/irf] /usr/local/gamma/share/caldb/cta<br>
  982 +
  983 +Instrument response function [kb_E_50h_v3] <br>
  984 +
  985 +Source model [test/data/crab.xml] /usr/local/gamma/share/models/crab.xml<br>
  986 +
  987 +Source model output file [crab_results.xml] <br>
  988 +
  989 +Event data file name [test/data/crab_events.fits.gz]
  990 +selected_events.fits
  991 +</p>
  992 +
  993 +<p style="padding-top: 0pt; text-align: left;" class="Body">You
  994 +will recognise that <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  995 +runs much faster in unbinned mode compared to binned mode. This is
  996 +understandable as the selected event list contains only 4048 events,
  997 +while the binned counts map we used before had 200 x 200 x 20 = 800000
  998 +pixels. As unbinned maximum likelihood fitting loops over the events
  999 +(while binned maximum likelihood loops over the pixels), there are much
  1000 +less operations to perform in unbinned than in binned mode (there is
  1001 +some additional overhead in unbinned mode that comes from integrating
  1002 +the models over the region of interest, yet this is negligible compared
  1003 +to the operations needed when looping over the pixels). So as long as
  1004 +you work with
  1005 +short event lists, unbinned mode is faster. Unbinned <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  1006 +should also be more
  1007 +precise as no binning is performed, hence there is no loss of
  1008 +information due to histogramming.</p>
  1009 +
  1010 +<br>
  1011 +
  1012 +<p style="padding-top: 0pt; text-align: left;" class="Body">Below
  1013 +you see the corresponding output from the <span style="font-family: Courier New,Courier,monospace;">ctlike.log</span>
  1014 +file. The fitted parameters are essentially identical to the ones found
  1015 +in binned mode. The slight
  1016 +difference with respect to the binned analysis may be explained by the
  1017 +different event sample that has been used for the analysis: while
  1018 +binned likelihood works on rectangular counts maps, unbinned likelihood
  1019 +works on circular event selection regions. It is thus not possible to
  1020 +select exactly the same events for both analyses!</p>
  1021 +
  1022 +<p class="Code">
  1023 +2011-02-02T14:32:54: +=================================+<br>
  1024 +
  1025 +2011-02-02T14:32:54: | Maximum likelihood optimisation |<br>
  1026 +
  1027 +2011-02-02T14:32:54: +=================================+<br>
  1028 +
  1029 +2011-02-02T14:32:54:&nbsp; Initial iteration: func=33730.9,
  1030 +Lambda=0.001<br>
  1031 +
  1032 +2011-02-02T14:32:54:&nbsp; Iteration 1: func=33728.3,
  1033 +Lambda=0.0001, delta=2.56377<br>
  1034 +
  1035 +2011-02-02T14:32:54:&nbsp; Iteration 2: func=33728.3, Lambda=1e-05,
  1036 +delta=0.00443209<br>
  1037 +
  1038 +2011-02-02T14:32:54:&nbsp; Iteration 3: func=33728.3, Lambda=1e-06,
  1039 +delta=5.81336e-06<br>
  1040 +
  1041 +2011-02-02T14:32:54:&nbsp; Iteration 4: func=33728.3, Lambda=1e-07,
  1042 +delta=1.31549e-08<br>
  1043 +
  1044 +2011-02-02T14:32:54: <br>
  1045 +
  1046 +2011-02-02T14:32:54: +=========================================+<br>
  1047 +
  1048 +2011-02-02T14:32:54: | Maximum likelihood optimisation results |<br>
  1049 +
  1050 +2011-02-02T14:32:54: +=========================================+<br>
  1051 +
  1052 +2011-02-02T14:32:54: === GOptimizerLM ===<br>
  1053 +
  1054 +2011-02-02T14:32:54:&nbsp; Optimized function value ..: 33728.3<br>
  1055 +
  1056 +2011-02-02T14:32:54:&nbsp; Absolute precision ........: 1e-06<br>
  1057 +
  1058 +2011-02-02T14:32:54:&nbsp; Optimization status .......: converged<br>
  1059 +
  1060 +2011-02-02T14:32:54:&nbsp; Number of parameters ......: 11<br>
  1061 +
  1062 +2011-02-02T14:32:54:&nbsp; Number of free parameters .: 5<br>
  1063 +
  1064 +2011-02-02T14:32:54:&nbsp; Number of iterations ......: 4<br>
  1065 +
  1066 +2011-02-02T14:32:54:&nbsp; Lambda ....................: 1e-07<br>
  1067 +
  1068 +2011-02-02T14:32:54:&nbsp; Maximum log likelihood ....: -33728.3<br>
  1069 +
  1070 +2011-02-02T14:32:54:&nbsp; Npred .....................: 4048<br>
  1071 +
  1072 +2011-02-02T14:32:54: === GModels ===<br>
  1073 +
  1074 +2011-02-02T14:32:54:&nbsp; Number of models ..........: 2<br>
  1075 +
  1076 +2011-02-02T14:32:54:&nbsp; Number of parameters ......: 11<br>
  1077 +
  1078 +2011-02-02T14:32:54: === GModelPointSource ===<br>
  1079 +
  1080 +2011-02-02T14:32:54:&nbsp; Name ......................: MAGIC Crab
  1081 +(Albert et al. 2008, ApJ, 674, 1037)<br>
  1082 +
  1083 +2011-02-02T14:32:54:&nbsp; Instruments ...............: all<br>
  1084 +
  1085 +2011-02-02T14:32:54:&nbsp; Number of parameters ......: 6<br>
  1086 +
  1087 +2011-02-02T14:32:54:&nbsp; Number of spatial par's ...: 2<br>
  1088 +
  1089 +2011-02-02T14:32:54:&nbsp;&nbsp; RA .......................:
  1090 +83.6331 [-360,360] deg (fixed,scale=1)<br>
  1091 +
  1092 +2011-02-02T14:32:54:&nbsp;&nbsp; DEC ......................:
  1093 +22.0145 [-90,90] deg (fixed,scale=1)<br>
  1094 +
  1095 +2011-02-02T14:32:54:&nbsp; Number of spectral par's ..: 3<br>
  1096 +
  1097 +2011-02-02T14:32:54:&nbsp;&nbsp; Prefactor ................:
  1098 +5.83432e-16 +/- 2.44527e-17 [1e-23,1e-13] ph/cm2/s/MeV
  1099 +(free,scale=1e-16)<br>
  1100 +
  1101 +2011-02-02T14:32:54:&nbsp;&nbsp; Index ....................:
  1102 +-2.50725 +/- 0.0328297 [-0,-5]&nbsp; (free,scale=-1)<br>
  1103 +
  1104 +2011-02-02T14:32:54:&nbsp;&nbsp; PivotEnergy ..............:
  1105 +300000 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
  1106 +
  1107 +2011-02-02T14:32:54:&nbsp; Number of temporal par's ..: 1<br>
  1108 +
  1109 +2011-02-02T14:32:54:&nbsp;&nbsp; Constant .................: 1
  1110 +(relative value) (fixed,scale=1)<br>
  1111 +
  1112 +2011-02-02T14:32:54: === GCTAModelRadialAcceptance ===<br>
  1113 +
  1114 +2011-02-02T14:32:54:&nbsp; Name ......................: Background<br>
  1115 +
  1116 +2011-02-02T14:32:54:&nbsp; Instruments ...............: CTA<br>
  1117 +
  1118 +2011-02-02T14:32:54:&nbsp; Model type ................: "Gaussian"
  1119 +* "PowerLaw" * "Constant"<br>
  1120 +
  1121 +2011-02-02T14:32:54:&nbsp; Number of parameters ......: 5<br>
  1122 +
  1123 +2011-02-02T14:32:54:&nbsp; Number of radial par's ....: 1<br>
  1124 +
  1125 +2011-02-02T14:32:54:&nbsp;&nbsp; Sigma ....................:
  1126 +3.03472 +/- 0.0398509 [0.01,10] deg2 (free,scale=1)<br>
  1127 +
  1128 +2011-02-02T14:32:54:&nbsp; Number of spectral par's ..: 3<br>
  1129 +
  1130 +2011-02-02T14:32:54:&nbsp;&nbsp; Prefactor ................:
  1131 +6.18897e-05 +/- 1.74306e-06 [0,0.001] ph/cm2/s/MeV (free,scale=1e-06)<br>
  1132 +
  1133 +2011-02-02T14:32:54:&nbsp;&nbsp; Index ....................:
  1134 +-1.86369 +/- 0.0156024 [-0,-5]&nbsp; (free,scale=-1)<br>
  1135 +
  1136 +2011-02-02T14:32:54:&nbsp;&nbsp; PivotEnergy ..............:
  1137 +1e+06 [10000,1e+09] MeV (fixed,scale=1e+06)<br>
  1138 +
  1139 +2011-02-02T14:32:54:&nbsp; Number of temporal par's ..: 1<br>
  1140 +
  1141 +2011-02-02T14:32:54:&nbsp;&nbsp; Constant .................: 1
  1142 +(relative value) (fixed,scale=1)<br>
  1143 +
  1144 +2011-02-02T14:32:54: <br>
  1145 +
  1146 +2011-02-02T14:32:54: Application "ctlike" terminated after consuming 2
  1147 +seconds of CPU time.<br>
  1148 +
  1149 +</p>
  1150 +
  1151 +<br>
  1152 +
  1153 +<br>
  1154 +
  1155 +<p class="Title"><a name="Some_final_remarks"></a>Some
  1156 +final remarks</p>
  1157 +
  1158 +<p style="padding-top: 0pt; text-align: left;" class="Body">First
  1159 +you should notice that <span style="font-weight: bold;">ctatools
  1160 +are in the prototyping phase</span>. If GammaLib and ctatools are
  1161 +installed on your system you should be able to run the above example
  1162 +without any problems, and you can do even much more.</p>
  1163 +
  1164 +<br>
  1165 +
  1166 +<p style="padding-top: 0pt; text-align: left;" class="Body">You
  1167 +may specify longer integration times for the simulation and for the
  1168 +analysis, you can have several point sources in the
  1169 +XML file, and you may try to fit all sources simultaneously using <span style="font-family: Courier New,Courier,monospace;">ctlike</span>.
  1170 +Yet, for the moment,
  1171 +you are limited to point sources (<span style="font-family: Courier New,Courier,monospace;">type="PointSource"</span>)
  1172 +and their spectra should be power laws (<span style="font-family: Courier New,Courier,monospace;">type="PowerLaw"</span>).
  1173 +Although there are already a number of other spectral types available
  1174 +in GammaLib, I have not yet had the time to implement their Monte Carlo
  1175 +generator, hence you cannot simulate events for spectral laws different
  1176 +from power laws for the moment. You may try, however, fitting the
  1177 +sources with other spectral laws, yet I have not tried this, and I
  1178 +cannot guarantee that it works.</p>
  1179 +
  1180 +<br>
  1181 +
  1182 +<p style="padding-top: 0pt; text-align: left;" class="Body">There
  1183 +is also only one radial acceptance model defined so far, and you should
  1184 +use the model definition that is given in the example.</p>
  1185 +
  1186 +<br>
  1187 +
  1188 +<p style="padding-top: 0pt; text-align: left;" class="Body">Also,
  1189 +<span style="font-weight: bold;">don't fiddle around with
  1190 +other projections and coordinate systems in
  1191 +<span style="font-family: Courier New,Courier,monospace;">ctbin</span></span><span style="font-family: Courier New,Courier,monospace;">.</span>
  1192 +The cartesian projection is the only one that so far is
  1193 +implemented, and galactic coordinates have not been tested so far.</p>
  1194 +
  1195 +<br>
  1196 +
  1197 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  1198 +instrument response function that has been implemented so far in
  1199 +GammaLib (yes, it is in GammaLib, not in ctatools) is very simple. It
  1200 +just reads Konrad's effective area files to get an <span style="font-weight: bold;">effective area that is so far
  1201 +independent of offset angle</span>. <span style="font-family: Courier New,Courier,monospace;">ctobssim</span>
  1202 +and <span style="font-family: Courier New,Courier,monospace;">ctlike</span>
  1203 +query for the name of the instrument response function file, and you
  1204 +may specify different
  1205 +response files if you like. To see what is available, type (adjust the
  1206 +path corresponding to your installation directory):
  1207 +</p>
  1208 +
  1209 +<p class="Code">&gt; ls
  1210 +/usr/local/gamma/share/caldb/cta<br>
  1211 +
  1212 +kb_A_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1213 +kb_D_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1214 +kb_G_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1215 +kb_J_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1216 +kb_NB_50h_v3.dat<br>
  1217 +
  1218 +kb_B_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1219 +kb_E_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1220 +kb_H_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1221 +kb_K_50h_v3.dat<br>
  1222 +
  1223 +kb_C_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1224 +kb_F_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1225 +kb_I_50h_v3.dat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1226 +kb_NA_50h_v3.dat<br>
  1227 +
  1228 +</p>
  1229 +
  1230 +<p style="padding-top: 0pt; text-align: left;" class="Body">The
  1231 +point spread function (PSF) definition is also read from these files.
  1232 +So far, the <span style="font-weight: bold;">PSF is a
  1233 +simple&nbsp;Gaussian</span>. The energy dependent Gaussian
  1234 +width is defined by
  1235 +the r68 parameter in Konrad's response files.</p>
  1236 +
  1237 +<br>
  1238 +
  1239 +<p style="padding-top: 0pt; text-align: left;" class="Body"><span style="font-weight: bold;">Lifetime
  1240 +is assumed to be 100%</span>. I'm not sure whether lifetime is
  1241 +folded in the
  1242 +effective areas of Konrad's response files, if not, a corresponding
  1243 +correction should be applied to all source fluxes obtained with the
  1244 +ctatools.
  1245 +</p>
  1246 +
  1247 +<br>
  1248 +
  1249 +<p style="padding-top: 0pt; text-align: left;" class="Body">Finally,
  1250 +if
  1251 +you want to have the log file also dumped to the screen as the
  1252 +executable runs, add <span style="font-family: Courier New,Courier,monospace;">debug=yes</span>
  1253 +on the command line, e.g.
  1254 +</p>
  1255 +
  1256 +<p class="Code">&gt; ctlike debug=yes
  1257 +</p>
  1258 +
  1259 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  1260 +And now: <span style="font-weight: bold;">enjoy playing
  1261 +with ctatools</span>.
  1262 +</p>
  1263 +
  1264 +<br>
  1265 +
  1266 +<br>
  1267 +
  1268 +<p class="Title"><a name="Getting_Help"></a>Getting
  1269 +Help</p>
  1270 +
  1271 +<p style="padding-top: 0pt; text-align: left;" class="Body">
  1272 +Any questions, bug reports, or suggested enhancements related to
  1273 +ctatools and GammaLib&nbsp;should be submitted
  1274 +to <a href="mailto:knodlseder@cesr.fr">knodlseder@cesr.fr</a>
  1275 +.
  1276 +</p>
  1277 +
  1278 +</body>
  1279 +</html>