- Timestamp:
- 10/30/10 21:49:11 (19 months ago)
- Location:
- trunk/examples/stgen
- Files:
-
- 2 modified
-
inh_2Dmarkov_psth.py (modified) (3 diffs)
-
inh_gamma_psth.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/stgen/inh_2Dmarkov_psth.py
r405 r473 9 9 10 10 11 import numpy 11 import numpy,sys 12 12 from NeuroTools import stgen 13 13 from pylab import zeros_like, plot … … 35 35 t_stop = 1000.0 36 36 37 trials = 10000 37 trials = 5000 38 print "Running %d trials of %.2f milliseconds" % (trials, t_stop) 39 for i in xrange(trials): 40 if i%100==0: 41 print "%d" % i, 42 sys.stdout.flush() 43 st = stg.inh_2Dadaptingmarkov_generator(a,bq,tau_s,tau_r,qrqs,t,t_stop,array=True) 44 psth[1:]+=numpy.histogram(st,t)[0] 38 45 39 for i in xrange(trials): 40 st = stg.inh_2Dadaptingmarkov_generator(a,bq,tau_s,tau_r,qrqs,t,t_stop,array=True) 41 psth+=numpy.histogram(st,t, new=False)[0] 46 print "\n" 42 47 43 48 # normalize … … 46 51 psth/= dt*float(trials)/1000.0 47 52 53 # this is for correct 'steps' plotting only 54 psth[0] = psth[1] 55 48 56 plot(t,psth,linestyle='steps') 49 57 -
trunk/examples/stgen/inh_gamma_psth.py
r435 r473 7 7 from NeuroTools import stgen 8 8 from pylab import zeros_like, plot 9 9 import sys 10 10 11 11 dt = 10.0 … … 27 27 stg = stgen.StGen() 28 28 29 for i in xrange(10000): 29 trials = 5000 30 tsim = 1000.0 31 print "Running %d trials of %.2f milliseconds" % (trials, tsim) 32 for i in xrange(trials): 33 if i%100==0: 34 print "%d" % i, 35 sys.stdout.flush() 30 36 st = stg.inh_gamma_generator(a,b,t,1000.0,array=True) 31 psth+=numpy.histogram(st,t,new=False)[0] 37 psth[1:]+=numpy.histogram(st,t)[0] 38 39 print "\n" 32 40 33 41 # normalize … … 36 44 psth/= dt*10000.0/1000.0 37 45 46 # this is for plotting only 47 psth[0] = psth[1] 48 38 49 plot(t,psth,linestyle='steps') 39 50
