From df87c6c1f1559359ff22559d425f4c71de8a926b Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 10 Feb 2016 18:22:19 +0100 Subject: [PATCH] Added some improvements to csiactobs --- cscripts/csiactobs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cscripts/csiactobs.py b/cscripts/csiactobs.py index 26c6967..e8b2020 100755 --- a/cscripts/csiactobs.py +++ b/cscripts/csiactobs.py @@ -495,7 +495,7 @@ class csiactobs(ctools.cscript): # Handle background index = -1 - bkg_mod_hierarchy = self.m_bkg_mod_hiera + bkg_mod_hierarchy = list(self.m_bkg_mod_hiera) for version in self.m_bkg_hiera: n = formats.count(version) if n > 0: @@ -508,7 +508,8 @@ class csiactobs(ctools.cscript): if self.logTerse(): self.log("Warning: observation "+str(obs_id)+" has no background information (file=\""+bkgfile+"\"). IRF background cannot be used\n") bkgfile = "" - bkg_mod_hierarchy.remove("irf") + if "irf" in bkg_mod_hierarchy: + bkg_mod_hierarchy.remove("irf") # Close hdu index file hduindx.close() -- libgit2 0.21.4