From 29226bbd0203bea2e3502111769f8c65d3633992 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 21 Jul 2016 18:51:52 +0200 Subject: [PATCH] Read emin and emax parameters in cspull only when required --- cscripts/cspull.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cscripts/cspull.py b/cscripts/cspull.py index 40de51e..8506322 100755 --- a/cscripts/cspull.py +++ b/cscripts/cspull.py @@ -320,10 +320,19 @@ class cspull(ctools.cscript): if self._logNormal(): self._log.header2('Trial '+str(seed-self._seed+1)) + # If we have a binned obeservation then specify the lower and + # upper energy limit + if self._enumbins > 0: + emin = self['emin'].real() + emax = self['emax'].real() + else: + emin = None + emax = None + # Simulate events obs = obsutils.sim(self._obs, - emin=self['emin'].real(), - emax=self['emax'].real(), + emin=emin, + emax=emax, nbins=self._enumbins, seed=seed, binsz=self._binsz, -- libgit2 0.21.4