55import sys
66
77
8- def getSolutionStati (fname ):
9- with open (fname , 'r' ) as inf :
10- lis = inf .readlines ()
11- # find start of interesting data
12- totnew = 0
13- totchk = 0
14- gotnew = 0
15- gotchk = 0
16- chktraj = False
17- newtraj = False
18- for li in lis :
19- # check for new data for existing solns
20- if 'Checking trajectory at ' in li and chktraj is False :
21- thistraj = li
22- chktraj = True
23- totchk += 1
24- continue
25- if 'Checking trajectory at ' in li and chktraj is True :
26- spls = thistraj .strip ().split (' ' )
27- print (f'{ spls [3 ]} { spls [4 ]} no new data' )
28- totchk += 1
29- thistraj = li
30- chktraj = True
31- continue
32- if "New Trajectory solution failed" in li and chktraj is True :
33- spls = thistraj .strip ().split (' ' )
34- print (f'{ spls [3 ]} { spls [4 ]} no improvement' )
35- chktraj = False
36- continue
37- if "Shower:" in li and chktraj is True :
38- spls = thistraj .strip ().split (' ' )
39- spl2 = li .strip ().split (' ' )
40- try :
41- if spl2 [3 ] == '...' :
42- shwr = 'Spo'
43- else :
44- shwr = spl2 [3 ]
45- except :
46- if spl2 [1 ] == '...' :
47- shwr = 'Spo'
48- else :
49- shwr = spl2 [1 ]
50-
51- print (f'{ spls [3 ]} { spls [4 ]} updated as { shwr } ' )
52- gotchk += 1
53- chktraj = False
54- continue
55-
56- # check for new groups
57- if "Observations:" in li :
58- thistraj = None
59- newtraj = True
60- totnew += 1
61- continue
62- if "Observations:" not in li and newtraj is True and thistraj is None :
63- thistraj = li
64- continue
65- if "-------" in li and newtraj is True :
66- spls = thistraj .strip ().split (' ' )
67- print (f'{ spls [3 ]} { spls [4 ]} not matched' )
68- newtraj = False
69- thistraj = None
70- continue
71- if "Shower:" in li and newtraj is True :
72- spls = thistraj .strip ().split (' ' )
73- spl2 = li .strip ().split (' ' )
74- try :
75- if spl2 [3 ] == '...' :
76- shwr = 'Spo'
77- else :
78- shwr = spl2 [3 ]
79- except :
80- if spl2 [1 ] == '...' :
81- shwr = 'Spo'
82- else :
83- shwr = spl2 [1 ]
84- print (f'{ spls [3 ]} { spls [4 ]} solved as { shwr } ' )
85- gotnew += 1
86- newtraj = False
87- thistraj = None
88- continue
89- if "SOLVING RUN DONE" in li :
90- break
91-
92- return totnew , totchk , gotnew , gotchk
93-
94-
958def parseDistriblog (logname ):
969 lis = open (logname ,'r' ).readlines ()
9710 dta = [x for x in lis if ('added to fails' in x or ('saved' in x and 'to' in x )) and ('CorrelateEngine' in x or 'CorrelateRMS' in x )]
@@ -102,4 +15,4 @@ def parseDistriblog(logname):
10215
10316if __name__ == '__main__' :
10417 fname = sys .argv [1 ]
105- print ( parseDistriblog (fname ) )
18+ parseDistriblog (fname )
0 commit comments