From 876e64a16ce0f1e7efa2e3fee92eed032d1a6a23 Mon Sep 17 00:00:00 2001 From: tillraab Date: Wed, 11 Sep 2019 14:05:08 +0200 Subject: [PATCH] bf --- electrode_check.py | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/electrode_check.py b/electrode_check.py index 4ed71ed..d836741 100644 --- a/electrode_check.py +++ b/electrode_check.py @@ -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,36 +369,18 @@ 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) + h, = Plot.axs[ch].plot(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch], color='k') Plot.channel_handle.append(h) - plt.show(block=False) + init_fig = False else: for ch in channel_array: Plot.channel_handle[ch].set_data(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch]) 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)