Skip to content
Snippets Groups Projects
Commit 8d3c9c1c authored by ferrari's avatar ferrari
Browse files

Fix bug

parent d810a468
No related branches found
No related tags found
No related merge requests found
...@@ -388,14 +388,14 @@ class Callback(object): ...@@ -388,14 +388,14 @@ class Callback(object):
ax_group.signal.axes.set_xlabel(f'Sig man:{ipi_man:.5f}') ax_group.signal.axes.set_xlabel(f'Sig man:{ipi_man:.5f}')
else: else:
cell = ax_group[cell_num] cell = ax_group[cell_num]
cell.cursors.set_xdata((event.xdata, event.xdata)) cell.cursors[0].set_xdata((event.xdata, event.xdata))
cell.cursors.set_visible(True) cell.cursors[0].set_visible(True)
lim_min = max(int(self.sr/1e3*(event.xdata-IPIPK)), 0) lim_min = max(int(self.sr/1e3*(event.xdata-IPIPK)), 0)
ipi_auto = np.argmax(cell.axes.get_data()[1][lim_min:int(self.sr/1e3*(event.xdata+IPIPK))]) + lim_min ipi_auto = np.argmax(cell.im.get_data()[1][lim_min:int(self.sr/1e3*(event.xdata+IPIPK))]) + lim_min
col = 'ipi_' + ('corr' if cell_num == 2 else 'ceps') col = 'ipi_' + ('corr' if cell_num == 2 else 'ceps')
self.df[self.offset[self.curr_ind[group_num], 0]][col + '_man'] = event.xdata self.df[self.offset[self.curr_ind[group_num], 0]][col + '_man'] = event.xdata
self.df[self.offset[self.curr_ind[group_num], 0]][col + '_auto'] = ipi_auto*1e3/self.sr self.df[self.offset[self.curr_ind[group_num], 0]][col + '_auto'] = ipi_auto*1e3/self.sr
cell.set_xlabel(f'{"Corr" if cell_num == 2 else "Ceps"} man:{event.xdata:.3f} ' cell.axes.set_xlabel(f'{"Corr" if cell_num == 2 else "Ceps"} man:{event.xdata:.3f} '
f'auto:{ipi_auto*1e3/self.sr:.3f}') f'auto:{ipi_auto*1e3/self.sr:.3f}')
plt.draw() plt.draw()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment