Skip to content

Commit

Permalink
Handle missing wheel data
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Nov 7, 2023
1 parent 476b130 commit bca1fe2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions task_qc_viewer/ViewEphysQC.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ def tv_double_clicked(self):
if self.wheel:
idx = np.searchsorted(self.wheel['re_ts'], np.array([start - dt / 10,
finish + dt / 10]))
max_val = np.max(self.wheel['re_pos'][idx[0]:idx[1]])
min_val = np.min(self.wheel['re_pos'][idx[0]:idx[1]])
self.wplot.canvas.ax2.set_ylim(min_val - 1, max_val + 1)
period = self.wheel['re_pos'][idx[0]:idx[1]]
if period.size == 0:
_logger.warning('No wheel data during trial #%i', ind.row())
else:
min_val, max_val = np.min(period), np.max(period)
self.wplot.canvas.ax2.set_ylim(min_val - 1, max_val + 1)
self.wplot.canvas.ax2.set_xlim(start - dt / 10, finish + dt / 10)
self.wplot.canvas.ax.set_xlim(start - dt / 10, finish + dt / 10)

Expand Down

0 comments on commit bca1fe2

Please sign in to comment.