Changeset 313 for trunk/src/signals.py

Show
Ignore:
Timestamp:
11/10/08 14:37:36 (4 years ago)
Author:
pierre
Message:

Module docstrings for io, and fix the cv ticket

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/signals.py

    r311 r313  
    99------- 
    1010 
    11 SpikeTrain       - An object representing a spike train, for one cell. Useful for plots,  
     11SpikeTrain       - object representing a spike train, for one cell. Useful for plots,  
    1212                   calculations such as ISI, CV, mean rate(), ... 
    13 SpikeList        - An object representing the activity of a population of neurons. Functions as a 
     13SpikeList        - object representing the activity of a population of neurons. Functions as a 
    1414                   dictionary of SpikeTrain objects, with methods to compute firing rate, 
    1515                   ISI, CV, cross-correlations, and so on.  
    16 AnalogSignal     - An object representing an analog signal, with its data. Can be used to do  
     16AnalogSignal     - object representing an analog signal, with its data. Can be used to do  
    1717                   threshold detection, event triggered averages, ... 
    18 AnalogSignalList - A list of AnalogSignal objects, again with methods such as mean, std, plot,  
     18AnalogSignalList - list of AnalogSignal objects, again with methods such as mean, std, plot,  
    1919                   and so on 
    20 VmList           - An AnalogSignalList object used for Vm traces 
    21 ConductanceList  - An AnalogSignalList object used for conductance traces 
    22 CurrentList      - An AnalogSignalList object used for current traces 
     20VmList           - AnalogSignalList object used for Vm traces 
     21ConductanceList  - AnalogSignalList object used for conductance traces 
     22CurrentList      - AnalogSignalList object used for current traces 
    2323 
    2424Functions 
     
    2828                       Can also load data in a different format, but then you have 
    2929                       to write your own File object that will know how to read the data (see io.py) 
    30 load_vmlist          - Function to load a VmList object (inherits from AnalogSignalList) from a file. 
     30load_vmlist          - function to load a VmList object (inherits from AnalogSignalList) from a file. 
    3131                       Same comments on format as previously. 
    32 load_currentlist     - Function to load a CurrentList object (inherits from AnalogSignalList) from a file. 
     32load_currentlist     - function to load a CurrentList object (inherits from AnalogSignalList) from a file. 
    3333                       Same comments on format as previously. 
    34 load_conductancelist - Function to load a ConductanceList object (inherits from AnalogSignalList) from a file. 
     34load_conductancelist - function to load a ConductanceList object (inherits from AnalogSignalList) from a file. 
    3535                       Same comments on format as previously. load_conductancelist returns two  
    3636                       ConductanceLists, one for the excitatory conductance and one for the inhibitory conductance 
    37 load                 - A generic loader for all the previous load methods. 
     37load                 - a generic loader for all the previous load methods. 
    3838""" 
    3939 
     
    308308            return numpy.std(isi)/numpy.mean(isi) 
    309309        else: 
    310             raise Exception("No spikes in the SpikeTrain !") 
     310            print "Warning, a CV can't be computed because there are not enough spikes" 
     311            return nan 
    311312 
    312313    def fano_factor_isi(self): 
     
    11321133            cv_isi_hist, cv_local, cv_kl 
    11331134        """ 
    1134         cvs_isi = [] 
     1135        cvs_isi = numpy.empty(self.N) 
    11351136        for id in self.id_list(): 
    1136             isi = self.spiketrains[id].isi() 
    1137             if len(isi) > 1: 
    1138                 cvs_isi.append(numpy.std(isi)/numpy.mean(isi)) 
    1139         if len(cvs_isi) > 0: 
    1140             return numpy.array(cvs_isi) 
    1141         else: 
    1142             raise Exception("No isi can be computed in the SpikeList !") 
     1137            cvs_isi[id] = self.spiketrains[id].cv_isi() 
     1138        return cvs_isi 
     1139 
    11431140 
    11441141