Exemplo n.º 1
0
 def display_pattern(self, t):
     if self.omega1 != -1:
         h = cos(self.omega1 * 2 * pi * t)
         s = sin(self.omega2 * pi * t + pi / 2)
         rgb = colorsys.hsv_to_rgb((h + 1) / 2, (s + 1) / 2, 1)
         self.CM = colormap.solid_colormap(rgb[0], rgb[1], rgb[2])
     teh_displayi(real(self.data + 1) / 2, self.CM)
     for i in range(0, self.speed):
         self.data = self.dynamics(self.data, self.scale)
     wakeup(0.005)
Exemplo n.º 2
0
 def display_pattern(self,t):
    if self.omega1 != -1:
       h = cos(self.omega1*2*pi*t)
       s = sin(self.omega2*pi*t+pi/2)
       rgb = colorsys.hsv_to_rgb((h+1)/2,(s+1)/2,1)
       self.CM = colormap.solid_colormap(rgb[0],rgb[1],rgb[2])
    teh_displayi(real(self.data+1)/2,self.CM)
    for i in range(0,self.speed):
      self.data = self.dynamics(self.data, self.scale)
    wakeup(0.005)
Exemplo n.º 3
0
def unnecessary():
   from time import sleep as wakeup
   global dt;
   global data;
   global alpha;
   global beta;
   global t;
   t=t+1;
   teh_displayi(real(data+1)/2);
   #imdisplayi(real(data+1)/2,sockets,mapping)
   #imdisplayi(abs(data),sockets)
   for i in range(0,10):
     data = dynamics(data);
   #data[23,0] = 0;
   wakeup(0.005)
Exemplo n.º 4
0
    def display_pattern(self, t):
       if self.omega1 != -1:
          h = cos(self.omega1*2*pi*t)
          s = sin(self.omega2*pi*t+pi/2)
          rgb = colorsys.hsv_to_rgb((h+1)/2,(s+1)/2,1)
          self.CM = colormap.solid_colormap(rgb[0],rgb[1],rgb[2])
       teh_displayi(sin(self.data),self.CM)

       c = poisson.rvs(self.mu,size=1)
       for i in range(0,c):
          x = floor(N*random.rand())
          y = floor(M*random.rand())
          self.d0[x][y] += 3.14159265
    
       self.data = self.dynamics(self.data)
       wakeup(0.005)
Exemplo n.º 5
0
        data[floor(x[0,i]),floor(x[1,i])] = 1;
    return data;


from time import sleep as wakeup
import time;
h = 0;
s = 0;

t0 = time.time();
t = time.time();

Ker = [[0.0064,    0.0318,    0.0730,    0.0730,    0.0318,    0.0064],
    [0.0318,    0.1583,    0.3629,    0.3629,    0.1583,    0.0318],
    [0.0730,    0.3629,    0.8320,    0.8320,    0.3629,    0.0730],
    [0.0730,    0.3629,    0.8320,    0.8320,    0.3629,    0.0730],
    [0.0318,    0.1583,    0.3629,    0.3629,    0.1583,    0.0318],
    [0.0064,    0.0318,    0.0730,    0.0730,    0.0318,    0.0064]];

n=0;
while t < t0 + duration:
   from time import sleep as wakeup
   n=n+1;
   for i in range(0,1):
       data = dynamics();
   dA = correlate2d(data,array(Ker),boundary='fill');
   data = dA[3:N+3,3:M+3];

   teh_displayi(flipud(data),colormap.BLUE_COLORMAP);
   wakeup(0.005)
Exemplo n.º 6
0
 def display_pattern(self, t):
     teh_displayi((1 + self.data / 5) / 2, CM)
     self.data = self.dynamics()
     wakeup(0.005)
Exemplo n.º 7
0
 def display_pattern(self,t):
     teh_displayi((1+self.data/5)/2,CM)
     self.data = self.dynamics()
     wakeup(0.005)