Spikes from a Population of SpikeSourceArray? are not retrieved by getSpikes() if they are set after creation of the population. The following piece of code illustrates this:
from pyNN.neuron import *
setup(quit_on_end = False)
stim1 = Population(1, SpikeSourceArray, cellparams = {'spike_times': [10.,20.,30.,40.]})
stim2 = Population(1, SpikeSourceArray)
stim2.set('spike_times', [10.,20.,30.,40.])
stim1.record()
stim2.record()
run(100.)
end()
print 'stim1: ', stim1.getSpikes()
print 'stim2: ', stim2.getSpikes()
Output:
stim1: [[ 0. 10.]
[ 0. 20.]
[ 0. 30.]
[ 0. 40.]]
stim2: []
Spikes from the stim1 are recorded, but not from stim2. The only difference is that for stim1, spike_times are set when creating the Population, while for stim2 they are set manually using Population.set().
Note that both Populations produce spikes as desired. They are just not recorded when using Population.set.
Cheers,
Michael