Changeset 97 for trunk/examples/retina/benchmark_noise.py
- Timestamp:
- 01/14/08 16:15:03 (4 years ago)
- Files:
-
- 1 modified
-
trunk/examples/retina/benchmark_noise.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/retina/benchmark_noise.py
r84 r97 5 5 ================== 6 6 7 Just studying how different background noise current is integrated by IAF_SFAneurons on one fiber.7 Just studying how different background noise current is integrated by the neurons on one fiber. 8 8 9 9 Laurent Perrinet, INCM, CNRS … … 13 13 """ 14 14 15 import os, datetime, numpy , pylab15 import os, datetime, numpy 16 16 import retina as model 17 17 import NeuroTools.benchmark as benchmark … … 29 29 """ 30 30 31 pylab.rcParams.update(pylab_params(fig_width_pt =497.9/2., ratio = 1))32 pylab.figure(num = 1, dpi=200, facecolor='w', edgecolor='k')33 34 Lmargin, Rmargin, dmargin, umargin = 0.15, 0.05, 0.15, 0.0535 pylab.axes([Lmargin, dmargin , 1.0 - Rmargin- Lmargin,1.0-umargin-dmargin]) # [left, bottom, width, height]36 31 37 32 params = benchmark.get('params') … … 40 35 noise_std, CRF = numpy.zeros(len(experiments)), numpy.zeros(len(experiments)) 41 36 for count, experiment in enumerate(experiments): 42 out_ON_DATA = benchmark.get('out',experiment)['out_ON_DATA'] .as_list_id_list_time()37 out_ON_DATA = benchmark.get('out',experiment)['out_ON_DATA']#.as_list_id_list_time() 43 38 noise_std[count] = benchmark.get('experiments')[experiment]['noise_std'] 44 CRF[count] = len(out_ON_DATA[0]) / N / N / simtime * 1000.039 CRF[count] = out_ON_DATA.mean_rate()#[0]) / N / N / simtime * 1000.0 45 40 46 41 42 import pylab 43 44 #pylab.rcParams.update(pylab_params(fig_width_pt =497.9/5, ratio = 1/1.2)) 45 pylab.figure(num = 1)#, dpi=200, facecolor='w', edgecolor='k') 46 47 #Lmargin, Rmargin, dmargin, umargin = 0.15, 0.05, 0.15, 0.05 48 #pylab.axes([Lmargin, dmargin , 1.0 - Rmargin- Lmargin,1.0-umargin-dmargin]) # [left, bottom, width, height] 49 47 50 #pylab.subplot(111) 48 pylab.plot(noise_std,CRF,'go') 51 idx_ = numpy.argsort(noise_std) # extract lines 52 pylab.plot(noise_std[idx_],CRF[idx_],'go-', label='line 1', linewidth=2) 49 53 pylab.ylabel('Firing Frequency (Hz)') 50 54 pylab.xlabel('Noise amplitude') 51 pylab.axis('tight')52 pylab.savefig(benchmark. name + '/benchmark_noise.png')#, dpi=300) #55 #pylab.axis('tight') 56 pylab.savefig(benchmark.filename + '/benchmark_noise.pdf')#, dpi=300) # 53 57 #command = 'epstopdf "%s" "%s"'% (pdffile, psfile) 54 58 #os.system(command)
