From 7d8694b576b7f8dea7263ca7ae350bbc4357c8cb Mon Sep 17 00:00:00 2001 From: tillraab Date: Wed, 11 Sep 2019 12:01:02 +0200 Subject: [PATCH] bf --- electrode_check.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/electrode_check.py b/electrode_check.py index 28dcf01..e80769c 100644 --- a/electrode_check.py +++ b/electrode_check.py @@ -60,6 +60,8 @@ def read_cfg(cfg_file, now, init_read=False): n_rows = int(line.split(':')[1].strip()) elif "AISampleRate" in line: samplerate = int(float(line.split(':')[-1].strip().replace('kHz', '')) * 1000) + elif "AIMaxVolt" in line: + max_v = float(line.split(':')[1].strip().replace('mV', '')) channels = n_rows * n_cols ### alter information and re-write ### @@ -75,7 +77,7 @@ def read_cfg(cfg_file, now, init_read=False): cfg_f.write(line) cfg_f.close() - return channels, samplerate, n_cols, n_rows + return channels, samplerate, n_cols, n_rows, max_v # for line in cfg: # if 'Columns1' in line: @@ -171,7 +173,7 @@ def main(): # cfgfile = os.path.join(path, 'fishgrid.cfg') # read and edit config file - channels, rate, n_cols, n_rows = read_cfg(init_cfgfile, now) + channels, rate, n_cols, n_rows, max_v = read_cfg(init_cfgfile, now) # file = os.path.join(path, 'traces-grid1.raw') # f = open(file, 'wb') @@ -290,7 +292,10 @@ def main(): 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) @@ -344,7 +349,7 @@ def main(): if init_fig == True: for ch in channel_array: h, = axs[ch].plot(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch], color='k') - axs[ch].set_ylim(min - channel_std[power_channel], max + channel_std[power_channel]) + # axs[ch].set_ylim(min - channel_std[power_channel], max + channel_std[power_channel]) # axs[ch].set_ylim(min, max) channel_handle.append(h) plt.show(block=False)