Changeset 172 for trunk/examples/retina/benchmark_linear.py
- Timestamp:
- 05/12/08 18:49:09 (4 years ago)
- Files:
-
- 1 modified
-
trunk/examples/retina/benchmark_linear.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/retina/benchmark_linear.py
r170 r172 14 14 """ 15 15 16 import os, datetime, numpy, pylab, shelve16 import os, sys, numpy, pylab, shelve 17 17 import progressbar # see http://projects.scipy.org/pipermail/scipy-dev/2008-January/008200.html 18 18 from NeuroTools.parameters import * 19 19 20 N, N_exp = 100 , 1520 N, N_exp = 1000, 6 21 21 p = ParameterSet({}) 22 t_smooth = 10. # ms. integration time to show fiber activity 22 t_smooth = 100. # ms. integration time to show fiber activity 23 from retina import * 24 retina = Retina(N) 23 25 24 results = shelve.open('results/benchmark_linear') 26 name = sys.argv[0].split('.')[0] # name of the current script withpout the '.py' part 27 results = shelve.open('results/mat-' + name) 25 28 try: 26 29 #boing # to force recomputing … … 30 33 31 34 except: 32 from retina import *33 34 retina = Retina(N)35 35 snr = retina.params['snr']* numpy.linspace(0.1,2.0,N_exp) 36 36 p.snr = ParameterRange(list(snr)) … … 44 44 temporal_ON, temporal_OFF = [],[] 45 45 46 pbar=progressbar.ProgressBar(widgets=[ "calculating", " ", progressbar.Percentage(), ' ',46 pbar=progressbar.ProgressBar(widgets=[name, " ", progressbar.Percentage(), ' ', 47 47 progressbar.Bar(), ' ', progressbar.ETA()], maxval=N_exp) 48 48 for i_exp,experiment in enumerate(p.iter_inner()): … … 58 58 pbar.update(i_exp) 59 59 60 61 results = retina.params 60 62 61 results['lower_edges'] = lower_edges 63 62 results['temporal_ON'] = temporal_ON … … 66 65 pbar.finish() 67 66 67 results.close() 68 68 69 69 ############################################################################### … … 88 88 #pylab.subplot(121) 89 89 #pylab.title('time course')# ON 90 pylab.xticks( numpy.round(numpy.linspace(0, re sults.simtime, 5),0) )90 pylab.xticks( numpy.round(numpy.linspace(0, retina.params.simtime, 5),0) ) 91 91 pylab.ylabel('Firing frequency (Hz)') 92 92 pylab.xlabel('time (ms)') … … 103 103 #pylab.legend() 104 104 105 pylab.savefig('results/ benchmark_linear.pdf') #, dpi=300) #106 #pylab.savefig('results/benchmark_linear.png', dpi=300) # 105 pylab.savefig('results/fig-' + name + '.pdf') 106 pylab.savefig('results/fig-' + name + '.png', dpi = 300) 107 107 108 results.close() 108 #TODO: make a plot showing it's the right point process with a histogram
