Hi,
if I understand correctly, you want to have some post-synaptic current
be a rectangular pulse over a certain time, right? You can implement
this using two synaptic pathways
(
http://brian2.readthedocs.io/en/stable/user/synapses.html#multiple-pathways):
the first one makes the current go up and the second one makes the
current go down again. With the delay of the second pathway you set the
width of the pulse. Something along these lines (here for a 2.5ms long
pulse):
synapses = Synapses(inp, target,
on_pre={'synapse_on': 'I_syn += 1',
'synapse_off': 'I_syn -= 1'})
synapses.connect()
synapses.synapse_off.delay=2.5*ms
Best,
Marcel