forked from elaird/hcalraw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multi.py
executable file
·55 lines (43 loc) · 1.35 KB
/
multi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python
import sys
import graphs
import look
from options import opts
from configuration.sw import fedList
def main(options, runs=[]):
roots = []
feds1s = []
feds2s = []
for run in runs:
if run == 239895:
options.hhmm = 2212
else:
options.hhmm = None
options.file1 = ""
options.file2 = ""
if not look.main(options, [run], quiet=True):
roots.append(options.outputFile)
feds1s.append(fedList(options.feds1))
feds2s.append(fedList(options.feds2))
plot(roots, feds1s, feds2s)
def plot(roots, feds1s, feds2s):
for i, stem in enumerate(graphs.all_pages):
graphs.makeSummaryPdfMulti(inputFiles=roots,
feds1s=feds1s,
feds2s=feds2s,
pdf="output/%d_%s.pdf" % (1 + i, stem),
pages=[stem],
)
def runs(file=None):
out = []
for i, lineRaw in enumerate(file):
line = lineRaw.strip()
if line.startswith("#"):
continue
try:
out.append(int(line))
except ValueError:
print "skipping line %d: '%s'" % (i, line)
return out
if __name__ == "__main__":
main(opts()[0], runs(sys.stdin))