Commit 627f993683520beb0bc9758f8f03156c1ce958c2

Authored by knodlseder
1 parent 6e619596

debug memory usage

Showing 1 changed file with 9 additions and 9 deletions
scripts/cstsdist.py
@@ -390,10 +390,10 @@ class cstsdist(GApplication): @@ -390,10 +390,10 @@ class cstsdist(GApplication):
390 390
391 # Fit background only 391 # Fit background only
392 sim.models(self.bkg_model) 392 sim.models(self.bkg_model)
393 - like = obsutils.fit(sim, log=self.m_log, debug=self.m_debug)  
394 - result_bgm = like.obs().models().copy()  
395 - LogL_bgm = like.opt().value()  
396 - npred_bgm = like.obs().npred() 393 + like_bgm = obsutils.fit(sim, log=self.m_log, debug=self.m_debug)
  394 + result_bgm = like_bgm.obs().models()
  395 + LogL_bgm = like_bgm.opt().value()
  396 + npred_bgm = like_bgm.obs().npred()
397 397
398 # Write background fit results 398 # Write background fit results
399 if self.logExplicit(): 399 if self.logExplicit():
@@ -413,12 +413,12 @@ class cstsdist(GApplication): @@ -413,12 +413,12 @@ class cstsdist(GApplication):
413 413
414 # Fit background and test source 414 # Fit background and test source
415 sim.models(self.full_model) 415 sim.models(self.full_model)
416 - like = obsutils.fit(sim, log=self.m_log, debug=self.m_debug)  
417 - result_all = like.obs().models().copy()  
418 - LogL_all = like.opt().value()  
419 - npred_all = like.obs().npred() 416 + like_all = obsutils.fit(sim, log=self.m_log, debug=self.m_debug)
  417 + result_all = like_all.obs().models()
  418 + LogL_all = like_all.opt().value()
  419 + npred_all = like_all.obs().npred()
420 ts = 2.0*(LogL_bgm-LogL_all) 420 ts = 2.0*(LogL_bgm-LogL_all)
421 - 421 +
422 # Write background and test source fit results 422 # Write background and test source fit results
423 if self.logExplicit(): 423 if self.logExplicit():
424 self.log.header3("Background and test source model fit") 424 self.log.header3("Background and test source model fit")