Esempio n. 1
0
    def on_click(self, event):

        if event.inaxes == self.ax:

            self.params = model.parameters_one()
            self.g_inh = model.params['g_inh_0']

            length = self.system.N_output(self.CYCLES)
            self.t = self.system.dt * np.arange(length)
            self.trajectory = np.zeros((length, self.num_osci), float)

            for i in xrange(self.num_osci):
                self.li[i].set_data(self.t, self.trajectory[:, i] - i * 2.)

            ticks = np.asarray(self.t[::self.t.size / 10], dtype=int)
            self.ax.set_xticks(ticks)
            self.ax.set_xticklabels(ticks)
            self.ax.set_xlim(self.t[0], self.t[-1])

            self.fig.canvas.draw()

            self.anim = animation.FuncAnimation(
                self.fig,
                self.compute_step,
                init_func=self.init,
                frames=self.trajectory.shape[0],
                interval=0,
                blit=True,
                repeat=False)
Esempio n. 2
0
    def on_click(self, event):

        if event.inaxes == self.ax:

            self.params = model.parameters_one()
            self.g_inh = model.params["g_inh_0"]

            length = self.system.N_output(self.CYCLES)
            self.t = self.system.dt * np.arange(length)
            self.trajectory = np.zeros((length, self.num_osci), float)

            for i in xrange(self.num_osci):
                self.li[i].set_data(self.t, self.trajectory[:, i] - i * 2.0)

            ticks = np.asarray(self.t[:: self.t.size / 10], dtype=int)
            self.ax.set_xticks(ticks)
            self.ax.set_xticklabels(ticks)
            self.ax.set_xlim(self.t[0], self.t[-1])

            self.fig.canvas.draw()

            self.anim = animation.FuncAnimation(
                self.fig,
                self.compute_step,
                init_func=self.init,
                frames=self.trajectory.shape[0],
                interval=0,
                blit=True,
                repeat=False,
            )
Esempio n. 3
0
    def compute_step(self, idx):

        self.params = model.parameters_one()
        self.g_inh = model.params['g_inh_0']

        model.step_n_em(self.state, self.params, self.g_inh,
                        self.system.dt / float(self.system.stride),
                        self.system.stride)

        self.trajectory[idx, :] = self.state[::model.N_EQ1]

        if self.pulsed:
            self.trajectory[idx - 1, self.pulsed - 1] = -0.1
            self.trajectory[idx, self.pulsed - 1] = 0.1
            self.pulsed = 0

        for i in xrange(self.num_osci):
            self.li[i].set_data(self.t, self.trajectory[:, i] - 2. * i)

        return self.li
Esempio n. 4
0
    def compute_step(self, idx):

        self.params = model.parameters_one()
        self.g_inh = model.params["g_inh_0"]

        model.step_n_em(
            self.state, self.params, self.g_inh, self.system.dt / float(self.system.stride), self.system.stride
        )

        self.trajectory[idx, :] = self.state[:: model.N_EQ1]

        if self.pulsed:
            self.trajectory[idx - 1, self.pulsed - 1] = -0.1
            self.trajectory[idx, self.pulsed - 1] = 0.1
            self.pulsed = 0

        for i in xrange(self.num_osci):
            self.li[i].set_data(self.t, self.trajectory[:, i] - 2.0 * i)

        return self.li