Last change
on this file since 28 was
25,
checked in by gnappo, 14 years ago
|
Piccola modifica al generatore pseudo casuale da cui è possibile farsi restituire il seme. Aggiunta di alcuni script per analizzare l'output e creazione struttura directory provvisioria per l'output.
|
-
Property svn:executable set to
*
|
File size:
695 bytes
|
Rev | Line | |
---|
[25] | 1 | #!/usr/bin/python |
---|
| 2 | |
---|
| 3 | import statistics |
---|
| 4 | import sys |
---|
| 5 | import re |
---|
| 6 | from re import split |
---|
| 7 | from math import sqrt |
---|
| 8 | import os |
---|
| 9 | |
---|
| 10 | basedir = sys.argv[1] |
---|
| 11 | |
---|
| 12 | filesList = [basedir + file for file in os.listdir(basedir) if (re.match('.*dat$', file) and not re.match('^output.*', file))] |
---|
| 13 | |
---|
| 14 | results = [] |
---|
| 15 | for 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)) |
---|
| 23 | variance = statistics.variance(results, mode = "Unbiased") |
---|
| 24 | confidence = sqrt(variance / len(results)) * 1.6449 |
---|
| 25 | print "Average: ",statistics.mean(results)," Confidence interval: ",confidence |
---|
Note: See
TracBrowser
for help on using the repository browser.