Changeset 362

Show
Ignore:
Timestamp:
12/08/08 18:35:59 (3 years ago)
Author:
LaurentPerrinet
Message:

Small fixes on example/single _neuron and sfn2008 / corrected ylabel in isi plot

Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/sfn2008/sfn_example_simulated_data.py

    r350 r362  
    2828 
    2929# isi distribution 
    30 hs = s.isi_hist() 
    31 pylab.figure() 
    32 pylab.plot(hs[1],hs[0]) 
     30hs = s.isi_hist(bins=20, display=True) 
    3331 
    3432 
  • trunk/examples/sfn2008/sfn_example_stgen.py

    r350 r362  
    2929print "Spiketrain 1:" 
    3030print "mean rate: %f" % st1.mean_rate() 
    31 print "coefficient of variance: %f" % st1.cv_isi() 
     31print "coefficient of variation: %f" % st1.cv_isi() 
    3232print "fano factor: %f" % st1.fano_factor_isi() 
    3333 
     
    3535print "Spiketrain 2:" 
    3636print "mean rate: %f" % st2.mean_rate() 
    37 print "coefficient of variance: %f" % st2.cv_isi() 
     37print "coefficient of variation: %f" % st2.cv_isi() 
    3838print "fano factor: %f" % st2.fano_factor_isi() 
    3939 
  • trunk/examples/single_neuron/CRF_neuron_vs_signal.py

    r326 r362  
    2727 
    2828 
    29 N_exp_snr = 25 
     29N_exp_snr = 20 
    3030N_exp_noise = 9 
    3131 
  • trunk/src/__init__.py

    r358 r362  
    33========== 
    44 
    5 NeuroTools is not a neural simulator, but rather a collection of tools 
     5NeuroTools is not a neural simulator, but a collection of tools 
    66to support all tasks associated with a neural simulation project which 
    77are not handled by the simulation engine. 
     
    4242######################################################### 
    4343 
    44 # The nice thing would be to gathered every non standard 
     44# The nice thing would be to gather every non standard 
    4545# dependency here, in order to centralize the warning 
    4646# messages and the check 
  • trunk/src/signals.py

    r358 r362  
    316316        can use the average irregularity across all neurons. 
    317317         
     318        http://en.wikipedia.org/wiki/Coefficient_of_variation 
     319         
    318320        See also 
    319321            isi, cv_kl 
     
    351353        """ 
    352354        isi = self.isi() / 1000. 
    353         if len(isi) == 0: 
     355        if len(isi) < 2: 
    354356            logging.debug("Warning, a CV can't be computed because there are not enough spikes") 
    355357            return numpy.nan 
     
    357359            if newnum: 
    358360                proba_isi, xaxis = numpy.histogram(isi, bins=bins, normed=True, new=True) 
    359                 #xaxis = xaxis[:len(xaxis)-1] 
     361                xaxis = xaxis[:-1] 
    360362            else: 
    361363                proba_isi, xaxis = numpy.histogram(isi, bins=bins, normed=True) 
     
    374376         
    375377        The Fano Factor is defined as the variance of the isi divided by the mean of the isi 
     378         
     379        http://en.wikipedia.org/wiki/Fano_factor 
    376380         
    377381        See also 
     
    11691173        if newnum: 
    11701174            values, xaxis = numpy.histogram(isis, bins=bins, normed=True, new=newnum) 
    1171             xaxis = xaxis[:len(xaxis)-1] 
     1175            xaxis = xaxis[:-1] 
    11721176        else: 
    11731177            values, xaxis = numpy.histogram(isis, bins=bins, normed=True) 
     
    11771181        else: 
    11781182            xlabel = "Inter Spike Interval (ms)" 
    1179             ylabel = "% of Neurons" 
     1183            ylabel = "Probability" 
    11801184            set_labels(subplot, xlabel, ylabel) 
    11811185            subplot.plot(xaxis, values, **kwargs) 
     1186            subplot.yticks([]) # arbitrary units 
    11821187            pylab.draw() 
    11831188 
     
    12631268        if newnum: 
    12641269            values, xaxis = numpy.histogram(cvs, bins=bins, normed=True, new=newnum) 
    1265             xaxis = xaxis[:len(xaxis)-1] 
     1270            xaxis = xaxis[:-1] 
    12661271        else: 
    12671272            values, xaxis = numpy.histogram(cvs, bins=bins, normed=True) 
     
    14121417            if newnum: 
    14131418                values, xaxis = numpy.histogram(rates, nbins, normed=True, new=newnum) 
    1414                 xaxis = xaxis[:len(xaxis)-1] 
     1419                xaxis = xaxis[:-1] 
    14151420            else: 
    14161421                values, xaxis = numpy.histogram(rates, nbins, normed=True)