Exemplo n.º 1
0
    def show_torus(self, widget=None, event=None):
        self.dt, self.stride, self.N_output = self.system.dt, self.system.stride, self.system.N_output(
            self.traces.CYCLES)
        self.echo('computing using ' + PROCESSOR[self.USE_GPU] + ' ...')
        self.fig.canvas.draw()
        initial_phases = np.arange(
            0., 1., 1. / float(self.GRID)) + 1. / float(2 * self.GRID)
        X = self.system.load_initial_conditions(
            initial_phases)  # X[initial_condition, variable]
        t0 = time.time()
        D = computePhaseTrace[self.USE_GPU](self, X)
        self.echo("used %.2g sec" % (time.time() - t0))

        for j in xrange(len(self.ax.lines)):
            self.ax.lines.pop(0)

        for d in D:

            try:
                last = d[-1, :]
                tl.plot_phase_3D(d[:, 0],
                                 d[:, 1],
                                 d[:, 2],
                                 self.ax,
                                 c=tl.clmap_patterns(last[1], last[0]),
                                 PI=0.5,
                                 lw=0.25)

            except:
                pass

        self.fig.canvas.draw()
Exemplo n.º 2
0
	def click_torus(self, event):

		if event.button == 1:
			return

		x, y, z = self.ax.guess_coord(event.xdata, event.ydata)

		for z in np.arange(0., 1., 1./float(self.GRID)) + 1./float(2*self.GRID):
			t, V_j = self.traces.compute_traces(self.system.load_initial_condition(x, y, z))
			V_j = np.transpose(V_j)
			ti, d = tl.phase_difference(V_j, V_trigger=torus.V_trigger)
			last = d[-1, :]
			tl.plot_phase_3D(d[:, 0], d[:, 1], d[:, 2], self.ax, c=tl.clmap_patterns(last[1], last[0]), PI=0.5)

		self.fig.canvas.draw()
Exemplo n.º 3
0
	def show_torus(self, widget=None, event=None):
		self.dt, self.stride, self.N_output = self.system.dt, self.system.stride, self.system.N_output(self.traces.CYCLES)
		self.echo('computing using '+PROCESSOR[self.USE_GPU]+' ...')
		self.fig.canvas.draw()
		initial_phases = np.arange(0., 1., 1./float(self.GRID)) + 1./float(2*self.GRID)
		X = self.system.load_initial_conditions(initial_phases) # X[initial_condition, variable]
		t0 = time.time()
		D = computePhaseTrace[self.USE_GPU](self, X)
		self.echo("used %.2g sec" % (time.time()-t0))
	
		for j in xrange(len(self.ax.lines)):
			self.ax.lines.pop(0)
	
		for d in D:
	
			try:
				last = d[-1, :]
				tl.plot_phase_3D(d[:, 0], d[:, 1], d[:, 2], self.ax, c=tl.clmap_patterns(last[1], last[0]), PI=0.5, lw=0.25)
	
			except:
				pass
		
		self.fig.canvas.draw()