From 39bdcd2a16f4ac7aed41558b2ba87d77990c201e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Kn=C3=B6dlseder?= Date: Sun, 26 Mar 2023 16:00:49 +0200 Subject: [PATCH] Use separate drwsuffix and drwmethod --- modules/comscripts/comobsbin.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/comscripts/comobsbin.py b/modules/comscripts/comobsbin.py index bb1aaf85..dcdf900d 100755 --- a/modules/comscripts/comobsbin.py +++ b/modules/comscripts/comobsbin.py @@ -503,23 +503,24 @@ def _generate_dri(self, obs, ebounds): drwnames = [] engindex = [] - # Get DRW method in lower case + # Get DRW method and suffix in lower case drwmethod = gammalib.tolower(self['drwmethod'].string()) - if drwmethod == 'phibar': - drwmethod += '%d' % (self['timebin'].real()) + drwsuffix = drwmethod + if drwsuffix == 'phibar': + drwsuffix += '%d' % (self['timebin'].real()) # Generate one DRW for each energy boundary for i in range(ebounds.size()): # Set DRW filename in output folder drwname = '%s/%s%s_drw-%s%s_%6.6d-%6.6dkeV.fits' % \ - (self['outfolder'].string(), obs.id(), dri_prefix, drwmethod, + (self['outfolder'].string(), obs.id(), dri_prefix, drwsuffix, self._drw_suffix, ebounds.emin(i).keV(), ebounds.emax(i).keV()) drwfile = gammalib.GFilename(drwname) # Set DRW filename in global data store drwname_global = '%s/%s%s_drw-%s%s_%6.6d-%6.6dkeV.fits' % \ - (self._global_datastore, obs.id(), dri_prefix, drwmethod, + (self._global_datastore, obs.id(), dri_prefix, drwsuffix, self._drw_suffix, ebounds.emin(i).keV(), ebounds.emax(i).keV()) drwfile_global = gammalib.GFilename(drwname_global)