index_syn = perceptron_pop.synapses["learning"].addr['syntype'] == syn index_tot = index_syn & index_syn_neu this_syn = perceptron_pop.synapses["learning"][index_tot] stim = this_syn.spiketrains_poisson(165, duration=650) #stimulus virtual synapse post neuron index_syn_neu_virt = perceptron_pop.synapses["virtual_exc"].addr[ 'neu'] == neu syn_virt = perceptron_pop.synapses["virtual_exc"][index_syn_neu_virt] stim_v = syn_virt.spiketrains_poisson(100, duration=650) final_stim = pyNCS.pyST.merge_sequencers(stim_v, stim) nsetup.stimulate(final_stim, send_reset_event=False) # osc_a = pyAgilent.Agilent(host="172.19.10.159") osc_a._send_command('WAV:FORM RAW') osc_b = pyAgilent.Agilent(host="172.19.10.156") osc_b._send_command('WAV:FORM RAW') membrane = osc_b._read_data_from_channel(2) weight = osc_b._read_data_from_channel(1) pre = stim[1].raw_data()[:, 0] #osc_b._read_data_from_channel(3) up = osc_a._read_data_from_channel(2) dn = osc_a._read_data_from_channel(3) calc = osc_b._read_data_from_channel(4) time = np.linspace(0, 1000, len(membrane)) creq = osc_a._read_data_from_channel(4) post_exc = stim_v[1].raw_data()[:, 0] figure()
import pyAgilent from pylab import * import matplotlib import numpy as np import sys #init oscilloscope osc = pyAgilent.Agilent(host="172.19.10.159"); #osc._send_command('WAV:FORM ASC'); #osc._send_command('WAV:POIN:MODE RAW'); #osc._send_command('WAV:POINTS 2000000'); osc.engage() up = osc._read_data_from_channel(2) dn = osc._read_data_from_channel(1) amp = osc._read_data_from_channel(4) gout = osc._read_data_from_channel(3) time_up = np.linspace(0,5,len(up)) time_dn = np.linspace(0,5,len(dn)) time_amp = np.linspace(0,5,len(amp)) time_gout = np.linspace(0,5,len(gout)) np.savetxt('sine_100/time_up.txt', time_up ) np.savetxt('sine_100/up.txt', up) np.savetxt('sine_100/time_dn.txt', time_dn ) np.savetxt('sine_100/dn.txt', dn) np.savetxt('sine_100/time_amp.txt', time_amp ) np.savetxt('sine_100/amp.txt', amp) np.savetxt('sine_100/time_gout.txt', time_gout )