[or-cvs] r15618: -bug in histogram naming scheme "skipping unreadable file" f (torflow/branches/gsoc2008/tools/BTAnalysis)
fallon at seul.org
fallon at seul.org
Thu Jul 3 06:54:37 UTC 2008
Author: fallon
Date: 2008-07-03 02:54:37 -0400 (Thu, 03 Jul 2008)
New Revision: 15618
Modified:
torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py
Log:
-bug in histogram naming scheme "skipping unreadable file" fixed
Modified: torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py
===================================================================
--- torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py 2008-07-03 06:13:12 UTC (rev 15617)
+++ torflow/branches/gsoc2008/tools/BTAnalysis/shufflebt.py 2008-07-03 06:54:37 UTC (rev 15618)
@@ -204,8 +204,8 @@
def shuffle(sort,truncate,filename,newfile):
if not sort and truncate is None: return
- #sortlocation = '/usr/local/bin/sort' #peculiarity of fallon's system
- sortlocation = 'sort'
+ sortlocation = '/usr/local/bin/sort' #peculiarity of fallon's system
+ #sortlocation = 'sort'
if sort and truncate:
cmd = sortlocation + ' -R ' + filename + ' | head -n ' + truncate + ' > ' + newfile
elif sort and not truncate:
@@ -244,15 +244,17 @@
newfile = os.path.join(dirname , os.path.basename(filename) + '.shuffled')
else:
newfile = filename
+ print newfile
# shuffle, create new file
shuffle(sort,truncate,filename,newfile)
# create histogram from file
s = Stats(newfile)
if not sort and not truncate:
- s.makehistogram(res,newfile,os.path.join(dirname ,os.path.basename(newfile )+ '.res' + str(res) + '.hist'))
+ histfilename = os.path.join(dirname ,os.path.basename(newfile )+ '.res' + str(res) + '.hist')
else:
- s.makehistogram(res,newfile,newfile + '.res' + str(res) +'.hist')
+ histfilename = newfile + '.res' + str(res) +'.hist'
+ s.makehistogram(res,newfile,histfilename)
mean = s.mean()
stddev = s.stddev()
median = s.median()
@@ -302,7 +304,8 @@
plotstr += pareto(parK,mode*10,modeN,'pareto')
plotstr += exp(modeMean*10,mode*10,modeN,'expShifted')
- plotstr += "plot '" + newfile + ".hist' using 2,\\\n"
+ # plotstr += "plot '" + newfile + ".hist' using 2,\\\n"
+ plotstr += "plot '" + histfilename + "' using 2,\\\n"
plotstr += "pareto(x) title '" + "Shifted Pareto', \\\n"
plotstr += "expShifted(x) title '" + "Shifted Exp' \n"
@@ -313,8 +316,8 @@
f.close()
# plot the file
- p = popen2.Popen4('gnuplot ' + plotname)
- #p = popen2.Popen4('gp4.2 ' + plotname) #peculiarity of fallon's system
+ #p = popen2.Popen4('gnuplot ' + plotname)
+ p = popen2.Popen4('gp4.2 ' + plotname) #peculiarity of fallon's system
p.wait()
for err in p.fromchild:
More information about the tor-commits
mailing list