def Analysis(folder, config, configgeneric=None, tag="", convtyp='-1', verbose=1): import os from enrico import utils from enrico.gtfunction import Observation from enrico.fitmaker import FitMaker import Loggin mes = Loggin.Message() """ run an analysis""" Obs = Observation(folder, config, tag=tag) if verbose: utils._log('SUMMARY: ' + tag) Obs.printSum() FitRunner = FitMaker(Obs, config) ##Class if config['Spectrum']['FitsGeneration'] == 'yes': FitRunner.FirstSelection( configgeneric) #Generates fits files for the coarse selection FitRunner.GenerateFits( ) #Generates fits files for the rest of the products return FitRunner
def Analysis(folder, config, configgeneric=None, tag="", convtyp='-1', verbose = 1): mes = Loggin.Message() """ run an analysis""" # If there are no xml files, create it and print a warning <--- This should be here? #if len(glob.glob(config['file']['xml'].replace('.xml','*.xml')))==0: if len(glob.glob(config['file']['xml']))==0: #.replace('.xml','*.xml')))==0: mes.warning("Xml not found, creating one for the given config %s" %config['file']['xml']) XmlMaker(config) Obs = Observation(folder, config, tag=tag) if verbose: utils._log('SUMMARY: ' + tag) Obs.printSum() FitRunner = FitMaker(Obs, config)##Class if config['Spectrum']['FitsGeneration'] == 'yes': FitRunner.FirstSelection(configgeneric) #Generates fits files for the coarse selection FitRunner.GenerateFits() #Generates fits files for the rest of the products return FitRunner