From 297614c4dc0c3d06f500b2e5cf8245063e6b360b Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 8 Nov 2018 17:15:39 +0100 Subject: [PATCH] Correct test for the existence of parameters in obsutils.get_onoff_obs() --- cscripts/obsutils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cscripts/obsutils.py b/cscripts/obsutils.py index de83772..0fdb003 100755 --- a/cscripts/obsutils.py +++ b/cscripts/obsutils.py @@ -815,13 +815,13 @@ def get_onoff_obs(cls, obs, nthreads=0): inexclusion = 'NONE' use_irf_bkg = True - # Set inmodel, srcname, inexclusion and use_irf_bkg if possible - if 'inmodel' in cls: + # Set inmodel, srcname, inexclusion and use_irf_bkg if they are available + if cls.has_par('inmodel'): if cls['inmodel'].is_valid(): inmodel = cls['inmodel'].value() - if 'srcname' in cls: + if cls.has_par('srcname'): srcname = cls['srcname'].value() - if 'inexclusion' in cls: + if cls.has_par('inexclusion'): if cls['inexclusion'].is_valid(): inexclusion = cls['inexclusion'].value() if cls.has_par('use_irf_bkg'): -- libgit2 0.21.4