#!/usr/bin/python # # Werner Lustermann # ETH Zurich # from ROOT import * # get the MARS library loaded gSystem.Load( '/data02/scratch/Mars_20111207_2145_from_data/libmars.so' ) from ROOT import * from numpy import loadtxt from callisto2 import callisto FACT_map_file_name = 'FACTmap111030.txt' df_extension = '.fits' # extension/format of the data file gzip = '.gz' # are the data compressed ? if not use '' data_path = '/data00/fact-construction/raw/' # path to the data res_path = '~/res/' # path to the storage of the results res_tag = '_callisto' # tag added to the filename with the results res_ext = '.root' # extension of the filename with the results rl_name = 'runlist_julia_dec2011.txt' # name of the file (inluding path) to the runlist # rl ... runlist rl = loadtxt( rl_name, dtype={'names':('drsf','df','dd','mm','yyyy'), 'formats': ('S3','S3','S2','S2','S4') } ) for run in rl: print 'processing run: ', run dp = data_path + run['yyyy'] + '/' + run['mm'] + '/' + run['dd'] + '/' fnd = run['yyyy'] + run['mm'] + run['dd'] + '_' data_file_name = dp + fnd + run['df'] + df_extension + gzip drs_file_name = dp + fnd + run['drsf'] + '.drs' + df_extension + gzip res_file_name = res_path + fnd + run['df'] + res_tag + res_ext print data_file_name print drs_file_name print res_file_name print # call the mars macro (converted to python) for doing the job callisto( drs_file_name, data_file_name, FACT_map_file_name, res_file_name ) print 'no matter what you do eventually it will be finished'