1 lf = ['finalAnalysisReport_jf_oldci_stable_b_4bit.txt', 'finalAnalysisReport_jf_oldci_stable_b_6bit.txt','finalAnalysisReport_jf_oldci_stable_b_8bit.txt']
3 fd =[open(f,"r") for f in lf]
5 lignes=[fdi.readlines()[7:] for fdi in fd]
7 label = ["Frequency (Monobit)","Frequency within a Block","Runs","Longest Run of Ones in a Block","Binary Matrix Rank","Discrete Fourier Transform (Spectral)","Non-overlapping Template Matching*","Overlapping Template Matching","Maurer's \"Universal Statistical\"","Linear Complexity","Serial* (m=10)","Approximate Entropy (m=10)","Cumulative Sums (Cusum) *","Random Excursions *","Random Excursions Variant *"]
16 def traitenlignes(num1,num2):
19 #calcul des moyennes mv ms
21 for j in range(num1,num2+1):
24 for x in l[j].split(" "):
29 for i in range(len(stl)):
30 if stl[i].find('/') != -1:
32 mv += float(stl[idxdiv-1])
33 rate = stl[idxdiv].split("/")
34 ms += float(rate[0])/float(rate[1])
36 #sti += "& " + str(mv/(num2-num1+1))[:5] + " (" + str(ms/(num2-num1+1))[0:5] +")"
37 sti += "& " + str(mv/(num2-num1+1))[:5] + "/" + str(round(100*ms/(num2-num1+1)))[0:2]
43 def traite1ligne(numl):
47 splitee = l[numl].split(" ")
48 for x in l[numl].split(" "):
53 for i in range(len(stl)):
55 if stl[i].find('/') != -1:
59 r = str(round(float(stl[idxdiv].split("/")[0])))
60 #ti += "& " + stl[idxdiv-1][:5] + " (" + r[0:5]+")"
61 sti += "& " + stl[idxdiv-1][:5] + "/" + r[0:2]
64 st += label[0] + traite1ligne(0)
65 st += label[1] + traite1ligne(1)
66 st += label[2] + traite1ligne(4)
67 st += label[3] + traite1ligne(5)
68 st += label[4] + traite1ligne(6)
69 st += label[5] + traite1ligne(7)
70 st += label[6] + traitenlignes(8,155)
71 st += label[7] + traite1ligne(156)
72 st += label[8] + traite1ligne(157)
73 st += label[9] + traite1ligne(185)
74 st += label[10] + traitenlignes(185,186)
75 st += label[11] + traite1ligne(187)
76 st += label[12] + traitenlignes(2,3)
77 st += label[13] + traitenlignes(159,166)
78 st += label[14] + traitenlignes(167,184)