Ejemplo n.º 1
0
    def addSinClamp(self, loc, amp, delay, dur, bias, freq, phase):
        """
        Injects a sinusoidal current at a given lcoation

        Parameters
        ----------
        loc: dict, tuple or :class:`neat.MorphLoc`
            The location of the current.
        amp: float
            The amplitude of the current (nA)
        delay: float
            The delay of the current onset (ms)
        dur: float
            The duration of the current (ms)
        bias: float
            Constant baseline added to the sinusoidal waveform (nA)
        freq: float
            Frequency of the sinusoid (Hz)
        phase: float
            Phase of the sinusoid (rad)
        """
        loc = MorphLoc(loc, self)
        # create the current clamp
        iclamp = h.SinClamp(self.sections[loc['node']](loc['x']))
        iclamp.delay = delay + self.t_calibrate  # ms
        iclamp.dur = dur  # ms
        iclamp.pkamp = amp  # nA
        iclamp.bias = bias  # nA
        iclamp.freq = freq  # Hz
        iclamp.phase = phase  # rad
        # store the iclamp
        self.iclamps.append(iclamp)
Ejemplo n.º 2
0
 def addSinClamp(self, loc, amp, delay, dur, bias, freq, phase):
     loc = MorphLoc(loc, self)
     # create the current clamp
     iclamp = h.SinClamp(self.sections[loc['node']](loc['x']))
     iclamp.delay = delay + self.t_calibrate  # ms
     iclamp.dur = dur  # ms
     iclamp.pkamp = amp  # nA
     iclamp.bias = bias  # nA
     iclamp.freq = freq  # Hz
     iclamp.phase = phase  # rad
     # store the iclamp
     self.iclamps.append(iclamp)
Ejemplo n.º 3
0
ASSIGNED {
	i (nA)
	toff (ms)
  t0 (ms)
}

INITIAL {
	i = 0
  toff = -1
}

NET_RECEIVE(weight (uS)) {
  t0 = t
	toff = t + dur
}

BREAKPOINT {
  at_time(t0)
  at_time(toff)
  i = 0
  if (t0 < t && t < toff) {
    i = amp * sin(PI * ((t - t0) / dur))
  }
}
###
sec = h.Section(name=sec)
sine = h.SinClamp(sec(0.5))

sine.dur = 1
sine.amp = 0.1