new electrode check slow but works
This commit is contained in:
parent
2eb545fa88
commit
876ba42d7f
@ -226,7 +226,6 @@ def main():
|
|||||||
channel_data = list(map(lambda x : data[x::channels][:250], channel_array))
|
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))
|
channel_std = list(map(lambda x : np.std(data[x::channels][:250]), channel_array))
|
||||||
power_channel = int(np.argmax(channel_std))
|
power_channel = int(np.argmax(channel_std))
|
||||||
|
|
||||||
if init_fig == True:
|
if init_fig == True:
|
||||||
yspan = (np.min(channel_data[power_channel]) / gain, np.max(channel_data[power_channel]) / gain)
|
yspan = (np.min(channel_data[power_channel]) / gain, np.max(channel_data[power_channel]) / gain)
|
||||||
ylim = (yspan[0] - np.abs(np.diff(yspan)) * 0.2, yspan[1] + np.abs(np.diff(yspan))* 0.2)
|
ylim = (yspan[0] - np.abs(np.diff(yspan)) * 0.2, yspan[1] + np.abs(np.diff(yspan))* 0.2)
|
||||||
|
@ -22,21 +22,19 @@ class Live_plot():
|
|||||||
plt.show(block=False)
|
plt.show(block=False)
|
||||||
|
|
||||||
def create_axis(self):
|
def create_axis(self):
|
||||||
gs = gridspec.GridSpec(4, 4, left=0.1, bottom=0.05, right=1, top=0, hspace=0, wspace=0)
|
gs = gridspec.GridSpec(4, 4, left=0.1, bottom=0.05, right=1, top=1, hspace=0, wspace=0)
|
||||||
for x in range(4):
|
for x in range(4):
|
||||||
for y in range(4):
|
for y in range(4):
|
||||||
# for x in range(self.n_cols):
|
# for x in range(self.n_cols):
|
||||||
ax = plt.subplot(gs[y, x])
|
self.axs.append(self.fig.add_subplot(gs[y, x]))
|
||||||
|
|
||||||
if not y == 3:
|
if not y == 3:
|
||||||
ax.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False)
|
self.axs[-1].tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False)
|
||||||
|
|
||||||
if not x == 0:
|
if not x == 0:
|
||||||
ax.tick_params(axis='y', which='both', left=False, right=False, labelleft=False)
|
self.axs[-1].tick_params(axis='y', which='both', left=False, right=False, labelleft=False)
|
||||||
|
|
||||||
ax.set_ylim(-self.max_v, self.max_v)
|
self.axs[-1].set_ylim(-self.max_v, self.max_v)
|
||||||
|
|
||||||
self.axs.append(ax)
|
|
||||||
|
|
||||||
def DAQ_setup(self):
|
def DAQ_setup(self):
|
||||||
status = ScanStatus.IDLE
|
status = ScanStatus.IDLE
|
||||||
@ -152,13 +150,12 @@ class Live_plot():
|
|||||||
status, transfer_status = self.ai_device.get_scan_status()
|
status, transfer_status = self.ai_device.get_scan_status()
|
||||||
|
|
||||||
index = transfer_status.current_index
|
index = transfer_status.current_index
|
||||||
|
|
||||||
if (last_idx > index) and (index != -1):
|
if (last_idx > index) and (index != -1):
|
||||||
channel_array = np.arange(self.channels)
|
channel_array = np.arange(self.channels)
|
||||||
channel_data = list(map(lambda x: self.data[x::self.channels][:250], channel_array))
|
channel_data = list(map(lambda x: self.data[x::self.channels][:250], channel_array))
|
||||||
channel_std = list(map(lambda x: np.std(self.data[x::self.channels][:250]), channel_array))
|
channel_std = list(map(lambda x: np.std(self.data[x::self.channels][:250]), channel_array))
|
||||||
power_channel = int(np.argmax(channel_std))
|
power_channel = int(np.argmax(channel_std))
|
||||||
|
print('yay')
|
||||||
if init_fig == True:
|
if init_fig == True:
|
||||||
yspan = (np.min(channel_data[power_channel]) / self.gain, np.max(channel_data[power_channel]) / self.gain)
|
yspan = (np.min(channel_data[power_channel]) / self.gain, np.max(channel_data[power_channel]) / self.gain)
|
||||||
ylim = (yspan[0] - np.abs(np.diff(yspan)) * 0.2, yspan[1] + np.abs(np.diff(yspan)) * 0.2)
|
ylim = (yspan[0] - np.abs(np.diff(yspan)) * 0.2, yspan[1] + np.abs(np.diff(yspan)) * 0.2)
|
||||||
@ -210,5 +207,7 @@ def main():
|
|||||||
|
|
||||||
Plot.create_axis()
|
Plot.create_axis()
|
||||||
|
|
||||||
|
Plot.run()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
Loading…
Reference in New Issue
Block a user