Skip to content

Commit

Permalink
Handle empty bnc data in task qc plot
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Oct 18, 2023
1 parent 1cea107 commit 8bc2118
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions task_qc_viewer/task_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ def create_plots(self, axes,
bnc2 = self.extractor.audio_ttls
trial_data = self.extractor.data

plots.squares(bnc1['times'], bnc1['polarities'] * 0.4 + 1, ax=axes, color='k')
plots.squares(bnc2['times'], bnc2['polarities'] * 0.4 + 2, ax=axes, color='k')
if bnc1['times'].size:
plots.squares(bnc1['times'], bnc1['polarities'] * 0.4 + 1, ax=axes, color='k')
if bnc2['times'].size:
plots.squares(bnc2['times'], bnc2['polarities'] * 0.4 + 2, ax=axes, color='k')
linestyle = linestyle or random.choices(('-', '--', '-.', ':'), k=len(trial_events))

if self.extractor.bpod_ttls is not None:
Expand Down

0 comments on commit 8bc2118

Please sign in to comment.