Created
July 7, 2016 12:22
-
-
Save ozturkib/07d2f151a6420c2d4bc35e6745e25f71 to your computer and use it in GitHub Desktop.
Accessin spike indices and times attributes in SpikeGeneratorGroup object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on 7 Jul 2016 | |
@author: io517@york.ac.uk | |
''' | |
import brian2 | |
print("brian_version : " + str(brian2.__version__)) | |
from brian2 import * | |
indices = np.array([0, 2, 1]) | |
times = np.array([1, 2, 3])*1*ms | |
G = SpikeGeneratorGroup(3, indices, times) | |
#In order to access spike indices in SpikeGeneratorGroup object, "neuron_index" attribute should be used. | |
print("indices : " + str(G.neuron_index[:])) | |
#In order to access spike times in SpikeGeneratorGroup object, "spike_time" attribute should be used. | |
print("times : " + str(G.spike_time[:])) | |
Minput = SpikeMonitor(G) | |
run(10*ms) | |
print("Monitored times : " + str(Minput.t[:])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output :