Browse Source

plot_presets.py,preset.csv : Initial commit.

master
kevin 7 years ago
parent
commit
a223bdbfed
2 changed files with 103 additions and 0 deletions
  1. 70
    0
      src/kc/data/gen_mod/plot_presets.py
  2. 33
    0
      src/kc/data/gen_mod/preset.csv

+ 70
- 0
src/kc/data/gen_mod/plot_presets.py View File

@@ -0,0 +1,70 @@
1
+import numpy as np
2
+from mpl_toolkits.mplot3d import Axes3D
3
+import matplotlib.pyplot as plt
4
+import csv
5
+
6
+plt.switch_backend('TkAgg')
7
+
8
+"""
9
+def randrange(n, vmin, vmax):
10
+    return (vmax - vmin)*np.random.rand(n) + vmin
11
+
12
+fig = plt.figure()
13
+ax = fig.add_subplot(111, projection='3d')
14
+n = 100
15
+for c, m, zl, zh in [('r', 'o', -50, -25), ('b', '^', -30, -5)]:
16
+    xs = randrange(n, 23, 32)
17
+    ys = randrange(n, 0, 100)
18
+    zs = randrange(n, zl, zh)
19
+    ax.scatter(xs, ys, zs, c=c, marker=m)
20
+
21
+ax.set_xlabel('X Label')
22
+ax.set_ylabel('Y Label')
23
+ax.set_zlabel('Z Label')
24
+
25
+plt.show()
26
+"""
27
+
28
+
29
+
30
+fn = "preset.csv"
31
+
32
+fig = plt.figure()
33
+ax = fig.add_subplot(111, projection='3d')
34
+ax.set_xlabel('Threshold')
35
+ax.set_ylabel('Lower')
36
+ax.set_zlabel('Upper')
37
+
38
+
39
+with open(fn) as f:
40
+    rd = csv.reader(f)
41
+
42
+    rd.next()
43
+
44
+    for x in rd:
45
+        label = x[0]
46
+        ch    = x[1]
47
+        mode  = x[2]
48
+        thresh= x[3]
49
+        upr   = x[4]
50
+        lwr   = x[5]
51
+        offs  = x[6]
52
+
53
+        c = 'b'
54
+        if float(mode)==4:
55
+            c = 'g'
56
+        if float(mode)==0:
57
+            c = 'r'
58
+            
59
+        lbl = "%s-%s" % (label,ch)
60
+
61
+        x = float(thresh)
62
+        y = float(lwr)
63
+        z = float(upr)
64
+        ax.scatter(x,y,z,c=c)
65
+
66
+        ax.text(x,y,z,  '%s' % (lbl), size=10, zorder=1,  color='k')
67
+        
68
+
69
+plt.show()
70
+        

+ 33
- 0
src/kc/data/gen_mod/preset.csv View File

@@ -0,0 +1,33 @@
1
+Preset,Channel,Mode,Threshold,Upper,Lower,Offset,CGain,WetDry,WGain
2
+A,L,1.000000,60.000000,-1.100000,2.000000,,6.000000,1.000000,1.750000,
3
+A,R,1.000000,60.000000,-0.990000,2.000000,,6.000000,1.000000,1.750000,
4
+B,L,1.000000,77.000000,-0.500000,3.000000,,10.000000,,1.750000,
5
+B,R,1.000000,74.000000,-0.500000,2.000000,,10.000000,,1.750000,
6
+C,L,1.000000,80.000000,-0.500000,5.000000,,11.000000,1.000000,,
7
+C,R,1.000000,80.000000,-0.500000,5.000000,,11.000000,1.000000,,
8
+D,L,1.000000,70.000000,-3.900000,4.000000,,9.000000,1.000000,,
9
+D,R,1.000000,70.000000,-4.500000,4.000000,,9.000000,1.000000,,
10
+F_1,L,1.000000,50.000000,-3.000000,1.000000,,6.000000,1.000000,2.000000,
11
+F_1,R,1.000000,50.000000,-3.000000,1.000000,,6.000000,1.000000,2.000000,
12
+F_2,L,1.000000,60.000000,-3.000000,1.000000,,6.000000,1.000000,2.000000,
13
+F_2,R,1.000000,60.000000,-3.000000,1.000000,,6.000000,1.000000,2.000000,
14
+F_3,L,1.000000,55.000000,-3.000000,1.000000,,6.000000,1.000000,2.000000,
15
+F_3,R,1.000000,55.000000,-3.000000,1.000000,,6.000000,1.000000,2.000000,
16
+F_4,L,1.000000,55.000000,-5.000000,1.000000,,6.000000,1.000000,2.000000,
17
+F_4,R,1.000000,55.000000,-5.000000,1.000000,,6.000000,1.000000,2.000000,
18
+G,L,4.000000,60.000000,-0.700000,8.000000,20.000000,10.000000,1.000000,,
19
+G,R,4.000000,64.000000,-0.700000,8.000000,20.000000,10.000000,1.000000,,
20
+G_A,L,4.000000,50.000000,-0.700000,2.000000,40.000000,10.000000,1.000000,,
21
+G_A,R,4.000000,54.000000,-0.700000,2.000000,40.000000,10.000000,1.000000,,
22
+G_1_A,L,4.000000,50.000000,-0.700000,8.000000,20.000000,10.000000,1.000000,1.000000,
23
+G_1_A,R,4.000000,54.000000,-0.700000,2.000000,20.000000,10.000000,1.000000,1.000000,
24
+G_1_D,L,4.000000,40.000000,-0.400000,7.000000,60.000000,10.000000,1.000000,1.000000,
25
+G_1_D,R,4.000000,34.000000,-0.300000,5.000000,64.000000,10.000000,1.000000,1.000000,
26
+1, X,0, 40,-5.5,0.3,0
27
+2, X,0, 40,-5.5,8.0,0
28
+3, X,0, 40, 2.5,0.3,0
29
+4, X,0, 40, 2.5,8.0,0
30
+5, X,0, 95,-5.5,0.3,0
31
+6, X,0, 95,-5.5,8.0,0
32
+7, X,0, 95, 2.5,0.3,0
33
+8, X,0, 95, 2.5,8.0,0

Loading…
Cancel
Save