Commit 996feeb587ce82e6da0c1ac6000fae538c8c0282

Authored by Jürgen Knödlseder
1 parent 9ec6a83a

Correctly carry over likelihood profile errors.

The old code did not carry over correctly the likelihood profile errors for the source component but simply kept the original curvature errors. This gave the impression that curvature errors were similar to likelihood profile errors. This has been fixed now.
Showing 1 changed file with 4 additions and 1 deletions
scripts/cspull.py
@@ -305,13 +305,16 @@ class cspull(ctools.cscript): @@ -305,13 +305,16 @@ class cspull(ctools.cscript):
305 305
306 # Fit model 306 # Fit model
307 if self.m_profile: 307 if self.m_profile:
308 - models = obs.models() 308 + models = obs.models()
  309 + new_models = gammalib.GModels()
309 for i in range(models.size()): 310 for i in range(models.size()):
310 model_name = models[i].name() 311 model_name = models[i].name()
311 like = obsutils.cterror(obs, model_name, \ 312 like = obsutils.cterror(obs, model_name, \
312 log=self.m_log, \ 313 log=self.m_log, \
313 debug=self.m_debug, 314 debug=self.m_debug,
314 chatter=self.m_chatter) 315 chatter=self.m_chatter)
  316 + new_models.append(like.obs().models()[i])
  317 + like.obs().models(new_models)
315 else: 318 else:
316 like = obsutils.fit(obs, edisp=self.m_edisp, \ 319 like = obsutils.fit(obs, edisp=self.m_edisp, \
317 log=self.m_log, \ 320 log=self.m_log, \