-
Notifications
You must be signed in to change notification settings - Fork 0
/
dantien.py
49 lines (38 loc) · 1.13 KB
/
dantien.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
'''
Dantien application
'''
from itertools import product
import glumpy
def dantien(feed_func, layout, update_rate=5):
ts = TimeSeries(feed_func)
cols = len(layout[0])
rows = len(layout)
fig = glumpy.figure()
for x, y in product(range(cols), range(rows)):
cons = layout[y][x]
subfig = fig.add_figure(cols=cols, rows=rows, position=[x,rows-y-1])
cons(subfig, ts)
@fig.timer(update_rate)
def update(_):
ts.eat()
@fig.event('on_idle')
def idle(_):
fig.redraw()
glumpy.show()
if __name__ == '__main__':
import sys
from views import Cube, Spectrogram, SeriesPlot, FFTPlot, \
Spectrogram3D, Scaleogram, Blank as _, SpectrogramAxis
from model import TimeSeries
import feeders
if len(sys.argv) >= 2 and sys.argv[1] == '--modeeg':
feed = feeders.mk_modeeg(sys.stdin) # read modeeg data from stdin
else:
feed = feeders.random_positive_sinoids
layout = [
# [FFTPlot, SeriesPlot],
[SpectrogramAxis, Spectrogram],
# [Spectrogram3D, _], #Scaleogram],
]
dantien(feed, layout)