1 | #!/usr/bin/python
|
---|
2 | #
|
---|
3 | # Werner Lustermann
|
---|
4 | # ETH Zurich
|
---|
5 | #
|
---|
6 | from ROOT import *
|
---|
7 |
|
---|
8 | # get the MARS library loaded
|
---|
9 | gSystem.Load( '/data02/scratch/Mars_20111207_2145_from_data/libmars.so' )
|
---|
10 | from ROOT import *
|
---|
11 |
|
---|
12 | from numpy import loadtxt
|
---|
13 |
|
---|
14 | from callisto2 import callisto
|
---|
15 |
|
---|
16 | FACT_map_file_name = 'FACTmap111030.txt'
|
---|
17 |
|
---|
18 | df_extension = '.fits' # extension/format of the data file
|
---|
19 | gzip = '.gz' # are the data compressed ? if not use ''
|
---|
20 |
|
---|
21 | data_path = '/data00/fact-construction/raw/' # path to the data
|
---|
22 | res_path = '~/res/' # path to the storage of the results
|
---|
23 | res_tag = '_callisto' # tag added to the filename with the results
|
---|
24 | res_ext = '.root' # extension of the filename with the results
|
---|
25 |
|
---|
26 | rl_name = 'runlist_julia_dec2011.txt' # name of the file (inluding path) to the runlist
|
---|
27 | # rl ... runlist
|
---|
28 | rl = loadtxt( rl_name, dtype={'names':('drsf','df','dd','mm','yyyy'), 'formats': ('S3','S3','S2','S2','S4') } )
|
---|
29 |
|
---|
30 | for run in rl:
|
---|
31 | print 'processing run: ', run
|
---|
32 | dp = data_path + run['yyyy'] + '/' + run['mm'] + '/' + run['dd'] + '/'
|
---|
33 | fnd = run['yyyy'] + run['mm'] + run['dd'] + '_'
|
---|
34 | data_file_name = dp + fnd + run['df'] + df_extension + gzip
|
---|
35 | drs_file_name = dp + fnd + run['drsf'] + '.drs' + df_extension + gzip
|
---|
36 | res_file_name = res_path + fnd + run['df'] + res_tag + res_ext
|
---|
37 | print data_file_name
|
---|
38 | print drs_file_name
|
---|
39 | print res_file_name
|
---|
40 | print
|
---|
41 | # call the mars macro (converted to python) for doing the job
|
---|
42 | callisto( drs_file_name, data_file_name, FACT_map_file_name, res_file_name )
|
---|
43 |
|
---|
44 | print 'no matter what you do eventually it will be finished'
|
---|