Commit 29226bbd0203bea2e3502111769f8c65d3633992
1 parent
694b5725
Read emin and emax parameters in cspull only when required
Showing
1 changed file
with
11 additions
and
2 deletions
cscripts/cspull.py
| @@ -320,10 +320,19 @@ class cspull(ctools.cscript): | @@ -320,10 +320,19 @@ class cspull(ctools.cscript): | ||
| 320 | if self._logNormal(): | 320 | if self._logNormal(): |
| 321 | self._log.header2('Trial '+str(seed-self._seed+1)) | 321 | self._log.header2('Trial '+str(seed-self._seed+1)) |
| 322 | 322 | ||
| 323 | + # If we have a binned obeservation then specify the lower and | ||
| 324 | + # upper energy limit | ||
| 325 | + if self._enumbins > 0: | ||
| 326 | + emin = self['emin'].real() | ||
| 327 | + emax = self['emax'].real() | ||
| 328 | + else: | ||
| 329 | + emin = None | ||
| 330 | + emax = None | ||
| 331 | + | ||
| 323 | # Simulate events | 332 | # Simulate events |
| 324 | obs = obsutils.sim(self._obs, | 333 | obs = obsutils.sim(self._obs, |
| 325 | - emin=self['emin'].real(), | ||
| 326 | - emax=self['emax'].real(), | 334 | + emin=emin, |
| 335 | + emax=emax, | ||
| 327 | nbins=self._enumbins, | 336 | nbins=self._enumbins, |
| 328 | seed=seed, | 337 | seed=seed, |
| 329 | binsz=self._binsz, | 338 | binsz=self._binsz, |