1 lf = ['finalAnalysisReport_jf_oldci_stable_b_4bit.txt', 'finalAnalysisReport_jf_oldci_stable_b_6bit.txt','finalAnalysisReport_jf_oldci_stable_b_8bit.txt']
3 lf = ['finalAnalysisReportFTTCS_4.txt']
6 fd =[open(f,"r") for f in lf]
8 lignes=[fdi.readlines()[7:] for fdi in fd]
10 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 *"]
12 endl="\\\\ \\hline \n"
19 def traitenlignes(num1,num2):
22 #calcul des moyennes mv ms
24 for j in range(num1,num2+1):
27 for x in l[j].split(" "):
32 for i in range(len(stl)):
33 if stl[i].find('/') != -1:
35 mv += float(stl[idxdiv-1])
36 rate = stl[idxdiv].split("/")
37 ms += float(rate[0])/float(rate[1])
39 #sti += "& " + str(mv/(num2-num1+1))[:5] + " (" + str(ms/(num2-num1+1))[0:5] +")"
40 sti += "& " + str(mv/(num2-num1+1))[:5] + "/" + str(round(100*ms/(num2-num1+1)))[0:2]
46 def traite1ligne(numl):
50 splitee = l[numl].split(" ")
51 for x in l[numl].split(" "):
56 for i in range(len(stl)):
58 if stl[i].find('/') != -1:
62 r = str(round(float(stl[idxdiv].split("/")[0])))
63 #ti += "& " + stl[idxdiv-1][:5] + " (" + r[0:5]+")"
64 sti += "& " + stl[idxdiv-1][:5] + "/" + r[0:2]
67 st += label[0] + traite1ligne(0)
68 st += label[1] + traite1ligne(1)
69 st += label[2] + traite1ligne(4)
70 st += label[3] + traite1ligne(5)
71 st += label[4] + traite1ligne(6)
72 st += label[5] + traite1ligne(7)
73 st += label[6] + traitenlignes(8,155)
74 st += label[7] + traite1ligne(156)
75 st += label[8] + traite1ligne(157)
76 st += label[9] + traite1ligne(185)
77 st += label[10] + traitenlignes(185,186)
78 st += label[11] + traite1ligne(187)
79 st += label[12] + traitenlignes(2,3)
80 st += label[13] + traitenlignes(159,166)
81 st += label[14] + traitenlignes(167,184)