Commit df87c6c1f1559359ff22559d425f4c71de8a926b
1 parent
0c61eac8
Added some improvements to csiactobs
Showing
1 changed file
with
3 additions
and
2 deletions
cscripts/csiactobs.py
| @@ -495,7 +495,7 @@ class csiactobs(ctools.cscript): | @@ -495,7 +495,7 @@ class csiactobs(ctools.cscript): | ||
| 495 | 495 | ||
| 496 | # Handle background | 496 | # Handle background |
| 497 | index = -1 | 497 | index = -1 |
| 498 | - bkg_mod_hierarchy = self.m_bkg_mod_hiera | 498 | + bkg_mod_hierarchy = list(self.m_bkg_mod_hiera) |
| 499 | for version in self.m_bkg_hiera: | 499 | for version in self.m_bkg_hiera: |
| 500 | n = formats.count(version) | 500 | n = formats.count(version) |
| 501 | if n > 0: | 501 | if n > 0: |
| @@ -508,7 +508,8 @@ class csiactobs(ctools.cscript): | @@ -508,7 +508,8 @@ class csiactobs(ctools.cscript): | ||
| 508 | if self.logTerse(): | 508 | if self.logTerse(): |
| 509 | self.log("Warning: observation "+str(obs_id)+" has no background information (file=\""+bkgfile+"\"). IRF background cannot be used\n") | 509 | self.log("Warning: observation "+str(obs_id)+" has no background information (file=\""+bkgfile+"\"). IRF background cannot be used\n") |
| 510 | bkgfile = "" | 510 | bkgfile = "" |
| 511 | - bkg_mod_hierarchy.remove("irf") | 511 | + if "irf" in bkg_mod_hierarchy: |
| 512 | + bkg_mod_hierarchy.remove("irf") | ||
| 512 | 513 | ||
| 513 | # Close hdu index file | 514 | # Close hdu index file |
| 514 | hduindx.close() | 515 | hduindx.close() |