This commit is contained in:
tillraab 2019-09-11 14:05:08 +02:00
parent 35b545b5f0
commit 876e64a16c

View File

@ -30,6 +30,7 @@ class plot():
self.fig = plt.figure(figsize=(20 / 2.54, 12 / 2.54), facecolor='white')
self.fig.canvas.mpl_connect('key_press_event', self.keypress)
self.axs = []
plt.show(block=False)
def create_axis(self):
gs = gridspec.GridSpec(self.n_rows, self.n_cols)
@ -326,26 +327,6 @@ def main():
Plot.create_axis()
# fig = plt.figure(figsize =(20/2.54, 12/2.54), facecolor='white')
# axs = []
# gs = gridspec.GridSpec(n_rows, n_cols)
# for y in range(n_rows):
# for x in range(n_cols):
# ax = plt.subplot(gs[y, x])
#
# if not y == n_rows -1:
# ax.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False)
#
# if not x == 0:
# ax.tick_params(axis='y', which='both', left=False, right=False, labelleft=False)
# ax.set_ylim(-max_v, max_v)
#
# axs.append(ax)
#
# gs.update(left=0.05, bottom=0.05, top=1, right=1, hspace=0, wspace=0)
# ax = np.hstack(ax)
# channel_handle = []
init_fig = True
try:
@ -388,21 +369,12 @@ def main():
channel_data = list(map(lambda x : data[x::channels][:250], channel_array))
channel_std = list(map(lambda x : np.std(data[x::channels][:250]), channel_array))
power_channel = int(np.argmax(channel_std))
# print(power_channel)
max = np.max(np.hstack(channel_data))
min = np.min(np.hstack(channel_data))
if init_fig == True:
for ch in channel_array:
try:
h, = Plot.axs[ch].plot(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch], color='k')
except:
embed()
quit()
# axs[ch].set_ylim(min - channel_std[power_channel], max + channel_std[power_channel])
# axs[ch].set_ylim(min, max)
Plot.channel_handle.append(h)
plt.show(block=False)
init_fig = False
else:
for ch in channel_array:
@ -410,15 +382,6 @@ def main():
Plot.fig.canvas.draw()
# np.array(data[last_idx:], dtype=np.float32).tofile(f)
# np.array(data[:index], dtype=np.float32).tofile(f)
if index == -1:
pass
else:
pass
# np.array(data[last_idx:index], dtype=np.float32).tofile(f)
if index == -1:
last_idx = len(data)
else: