Commit 47dab4bf0f0e1b47c4e541e7bddcab383b0fb560

Authored by Jürgen Knödlseder
1 parent e52762ef

Forward statistic in cspull to likelihood fitted

cscripts/cspull.py
... ... @@ -153,15 +153,16 @@ class cspull(ctools.csobservation):
153 153  
154 154 # Get number of energy bins and On source name and initialise
155 155 # some parameters
156   - nbins = self['enumbins'].integer()
157   - onsrc = self['onsrc'].string()
158   - edisp = self['edisp'].boolean()
159   - emin = None
160   - emax = None
161   - binsz = 0.0
162   - npix = 0
163   - proj = 'TAN'
164   - coordsys = 'CEL'
  156 + nbins = self['enumbins'].integer()
  157 + onsrc = self['onsrc'].string()
  158 + edisp = self['edisp'].boolean()
  159 + statistic = self['statistic'].string()
  160 + emin = None
  161 + emax = None
  162 + binsz = 0.0
  163 + npix = 0
  164 + proj = 'TAN'
  165 + coordsys = 'CEL'
165 166  
166 167 # If we have a On source name then set On region radius
167 168 if gammalib.toupper(onsrc) != 'NONE':
... ... @@ -214,16 +215,18 @@ class cspull(ctools.csobservation):
214 215 models = self.obs().models()
215 216 for model in models:
216 217 like = ctools.cterror(obs)
217   - like['srcname'] = model.name()
218   - like['edisp'] = edisp
219   - like['debug'] = self._logDebug()
220   - like['chatter'] = self['chatter'].integer()
  218 + like['srcname'] = model.name()
  219 + like['edisp'] = edisp
  220 + like['statistic'] = statistic
  221 + like['debug'] = self._logDebug()
  222 + like['chatter'] = self['chatter'].integer()
221 223 like.run()
222 224 else:
223 225 like = ctools.ctlike(obs)
224   - like['edisp'] = edisp
225   - like['debug'] = self._logDebug()
226   - like['chatter'] = self['chatter'].integer()
  226 + like['edisp'] = edisp
  227 + like['statistic'] = statistic
  228 + like['debug'] = self._logDebug()
  229 + like['chatter'] = self['chatter'].integer()
227 230 like.run()
228 231  
229 232 # Store results
... ...
src/support/support.cpp
... ... @@ -28,12 +28,9 @@
28 28 #ifdef HAVE_CONFIG_H
29 29 #include <config.h>
30 30 #endif
31   -//#include <cstdlib> // std::getenv() function
32   -//#include <cstdio> // std::fopen(), etc. functions
33 31 #include "GammaLib.hpp"
34 32 #include "GCTALib.hpp"
35 33 #include "support.hpp"
36   -//#include "GTools.hpp"
37 34  
38 35 /* __ Method name definitions ____________________________________________ */
39 36  
... ...