source: fact/tools/pyscripts/run2.py@ 13419

Last change on this file since 13419 was 12717, checked in by lusterma, 13 years ago
added callisto2.py, run2.py and runlist_20111124.txt as example on how to run a MARS script on a list of files
File size: 1.5 KB
Line 
1#!/usr/bin/python
2#
3# Werner Lustermann
4# ETH Zurich
5#
6from ROOT import *
7
8# get the MARS library loaded
9gSystem.Load( '/data02/scratch/Mars_20111207_2145_from_data/libmars.so' )
10from ROOT import *
11
12from numpy import loadtxt
13
14from callisto2 import callisto
15
16FACT_map_file_name = 'FACTmap111030.txt'
17
18df_extension = '.fits' # extension/format of the data file
19gzip = '.gz' # are the data compressed ? if not use ''
20
21data_path = '/data00/fact-construction/raw/' # path to the data
22res_path = '~/res/' # path to the storage of the results
23res_tag = '_callisto' # tag added to the filename with the results
24res_ext = '.root' # extension of the filename with the results
25
26rl_name = 'runlist_julia_dec2011.txt' # name of the file (inluding path) to the runlist
27# rl ... runlist
28rl = loadtxt( rl_name, dtype={'names':('drsf','df','dd','mm','yyyy'), 'formats': ('S3','S3','S2','S2','S4') } )
29
30for 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
44print 'no matter what you do eventually it will be finished'
Note: See TracBrowser for help on using the repository browser.