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] +")"
41 def traite1ligne(numl):
45 splitee = l[numl].split(" ")
46 for x in l[numl].split(" "):
51 for i in range(len(stl)):
53 if stl[i].find('/') != -1:
57 r = str(float(stl[idxdiv].split("/")[0])/100)
58 sti += "& " + stl[idxdiv-1][:5] + " (" + r[0:5]+")"
61 st += label[0] + traite1ligne(0)
62 st += label[1] + traite1ligne(1)
63 st += label[2] + traite1ligne(4)
64 st += label[3] + traite1ligne(5)
65 st += label[4] + traite1ligne(6)
66 st += label[5] + traite1ligne(7)
67 st += label[6] + traitenlignes(8,155)
68 st += label[7] + traite1ligne(156)
69 st += label[8] + traite1ligne(157)
70 st += label[9] + traite1ligne(185)
71 st += label[10] + traitenlignes(185,186)
72 st += label[11] + traite1ligne(187)
73 st += label[12] + traitenlignes(2,3)
74 st += label[13] + traitenlignes(159,166)
75 st += label[14] + traitenlignes(167,184)