diff --git a/enrico/fitmaker.py b/enrico/fitmaker.py index f86f584..59a7b88 100755 --- a/enrico/fitmaker.py +++ b/enrico/fitmaker.py @@ -19,7 +19,7 @@ class FitMaker(Loggin.Message): """Collection of functions to prepare/run the GTLIKE fit - and compute an upper limit is needed""" + and compute an upper limit if needed""" def __init__(self, obs, config): super(FitMaker,self).__init__() Loggin.Message.__init__(self) @@ -42,7 +42,7 @@ def GenerateFits(self): """Run the different ST tools and compute the fits files First it runs the tools that are common to the binned and unbinned analysis chain then it run the specific - tools following the choise of the user""" + tools following the choice of the user""" #Run the tools common to binned and unbinned chain self._log('gtselect', 'Select data from library')#run gtselect @@ -54,8 +54,19 @@ def GenerateFits(self): self.obs.DiffResps()#run gtdiffresp self._log('gtbin', 'Create a count map') self.obs.Gtbin() - self._log('gtltcube', 'Make live time cube')#run gtexpcube - self.obs.ExpCube() + # Produces ltcube depending on whether the variable below is empty + # otherwise uses the one provided in the string (i.e. gtltcube + # will not even be called) + if self.config['file']['ltcube'] == "": + self._log('gtltcube', 'Make live time cube')#run gtexpcube + self.obs.ExpCube() + else: + self._log('gtltcube', 'Make live time cube') + print "Skipping creation of live time cube: it was generated before" + print self.config['file']['ltcube'] + + + #Choose between the binned of the unbinned analysis if self.config['analysis']['likelihood'] == 'binned': #binned analysis chain diff --git a/enrico/gtfunction.py b/enrico/gtfunction.py index 11dc06d..deece59 100755 --- a/enrico/gtfunction.py +++ b/enrico/gtfunction.py @@ -15,11 +15,11 @@ class Observation: # init function of the Observation class. # folder : folder where the produced fits files will be stored. - # configuration is the confi of enrico (contains the variable) + # configuration is the config of enrico (contains the variables) def __init__(self,folder,Configuration,tag=""): - #Read the configuration object and init all the variable + #Read the configuration object and init all variables self.Configuration = Configuration inttag = "_"+Configuration['file']['tag'] if not(tag==""): @@ -32,7 +32,11 @@ def __init__(self,folder,Configuration,tag=""): #Fits files self.eventfile = folder+'/'+self.srcname+inttag+"_Evt.fits" - self.Cubename = folder+'/'+self.srcname+inttag+"_ltCube.fits" + if Configuration['file']['ltcube'] == "": + self.Cubename = folder+'/'+self.srcname+inttag+"_ltCube.fits" + else: + self.Cubename = Configuration['file']['ltcube'] + self.Mapname = folder+'/'+self.srcname+inttag+"_ExpMap.fits" self.BinnedMapfile = folder+'/'+self.srcname+inttag+"_BinnedMap.fits" self.cmapfile = folder+'/'+self.srcname+inttag+"_CountMap.fits" @@ -279,7 +283,7 @@ def ExpCube(self): expCube['zmax']=self.Configuration['analysis']['zmax'] expCube['phibins']=self.Configuration['space']['phibins'] expCube['clobber'] = self.clobber - expCube.run() + expCube.run() def ExpMap(self): "Run gtexpmap for unbinned analysis"