Changes between Version 6 and Version 7 of signals
- Timestamp:
- 11/10/08 10:47:48 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
signals
v6 v7 15 15 ------------ 16 16 17 A spike train is a sorted vector of spike times, which is the result of a simulation or a quired by measurement.17 A spike train is a sorted vector of spike times, which is the result of a simulation or acquired by measurement. 18 18 It has therefore some attributes, like ``t_start`` and ``t_stop``, which must in general 19 19 be specified by the user, as they can not be inferred from the data. 21 21 **Note:** the standard time unit used by NeuroTools is milliseconds. 22 22 23 When several spike trains are gathered, they are collected in a ``SpikeList`` object, which is effectively a diction nary23 When several spike trains are gathered, they are collected in a ``SpikeList`` object, which is effectively a dictionary 24 24 of spike trains, the id of the cells being used as a key. See the ``SpikeList`` class for more details. 25 25 88 88 All the ``SpikeTrain`` objects within the ``SpikeList`` will share the same ``t_start`` and ``t_stop``. 89 89 90 Rather than calling the ``SpikeList`` constructor, a more comm mon way to create a ``SpikeList`` in NeuroTools is to use the ``load_spikelist()`` or the ``load()`` functions.90 Rather than calling the ``SpikeList`` constructor, a more common way to create a ``SpikeList`` in NeuroTools is to use the ``load_spikelist()`` or the ``load()`` functions. 91 91 If you have generated your data with PyNN_, you can use the loading functions made for this purpose. For example if 92 92 you have recorded the spikes of a population in a file "spikes.dat", then one can load it as a ``SpikeList`` as follows:: 95 95 96 96 Using this syntax, the header information contained in the file is used to create the population, and ``t_start`` and ``t_stop`` are 97 infer ed automatically as the min and the max of all the ``SpikeTrains`` within the ``SpikeList``.97 inferred automatically as the min and the max of all the ``SpikeTrains`` within the ``SpikeList``. 98 98 If you want to keep the control on the parameters while creating the ``SpikeList``, do the following:: 99 99 115 115 print spktrain.isi() 116 116 117 As you can see in the example, one can navig uate and iterate over a ``SpikeList`` object and have access to117 As you can see in the example, one can navigate and iterate over a ``SpikeList`` object and have access to 118 118 all the ``SpikeTrain``\s within the object. To have an explicit list of all the ids contained in the ``SpikeList``, 119 119 use the function ``id_list()``:: 133 133 134 134 >>> subspklist = spklist.time_slice(500,1500) 135 >>> subspklist = spklist.id_slice(50) # Will select 50 random sid within spklist.id_list()135 >>> subspklist = spklist.id_slice(50) # Will select 50 random id within spklist.id_list() 136 136 >>> subspklist = spklist.id_slice([2,3,5,6]) 137 137 138 If you want to select only cells mat hcing a particular criteria within the ``SpikeList``, you can use the138 If you want to select only cells matching a particular criteria within the ``SpikeList``, you can use the 139 139 ``select_ids`` method:: 140 140 166 166 ``NeuroTools.signals`` also handles analog signals. These are generally also 167 167 recorded during a simulation or experiment, such as for example a Vm trace, a conductance or a current. Such a signal is 168 defin ied by a number of values between ``t_start`` and ``t_stop`` with a time step ``dt``.168 defined by a number of values between ``t_start`` and ``t_stop`` with a time step ``dt``. 169 169 170 170 The ``AnalogSignal`` class 210 210 and additional parameters like ``t_start``, ``t_stop``, and the list of all the recorded ids. The last three parameters 211 211 can't be inferred from the data safely, so it's better if they are specified by the user. Nevertheless, the most 212 comm mon way to create ``AnalogSignal``\s in NeuroTools is to use the ``load_analogsignal()`` or ``load()`` functions, as212 common way to create ``AnalogSignal``\s in NeuroTools is to use the ``load_analogsignal()`` or ``load()`` functions, as 213 213 explained below. Currently, the constructor of the ``AnalogSignalList`` is mainly tuned to be used with these load functions, 214 214 and it is therefore not so simple to create one from a list of ``AnalogSignal``\s:: 256 256 >>> vm = load(StandardPickleFile("vm.dat"),'v) # Read the pickle file 257 257 258 Note that for the moment, there is a slight dis inction for the conductance files, since the ``load`` function is258 Note that for the moment, there is a slight distinction for the conductance files, since the ``load`` function is 259 259 tuned for PyNN. Since PyNN saves exc/inh conductances in the same file, the ``load`` function, called on a file 260 260 generated by PyNN, will return two ``AnalogSignalList`` :: 264 264 .. _PyNN: http://neuralensemble.org/PyNN/ 265 265 266 266 267 }}}

