source: branches/MetisMQI/script/analizzaRisultati.py @ 30

Last change on this file since 30 was 29, checked in by gnappo, 14 years ago

Taggata versione per la demo e aggiunto branch.

  • Property svn:executable set to *
File size: 695 bytes
Line 
1#!/usr/bin/python
2
3import statistics
4import sys
5import re
6from re import split
7from math import sqrt
8import os
9
10basedir = sys.argv[1]
11
12filesList = [basedir + file for file in os.listdir(basedir) if (re.match('.*dat$', file) and not re.match('^output.*', file))]
13
14results = []
15for file in filesList:
16    inp = open(file,"r")
17    values = []
18    for line in inp.readlines():
19        values.append(float(line))
20    inp.close()
21    print "File ",file," acquisito."
22    results.append(statistics.mean(values))
23variance = statistics.variance(results, mode = "Unbiased")
24confidence = sqrt(variance / len(results)) * 1.6449
25print "Average: ",statistics.mean(results)," Confidence interval: ",confidence
Note: See TracBrowser for help on using the repository browser.