Skip to content

Commit

Permalink
fix for offline case with different metrics file
Browse files Browse the repository at this point in the history
  • Loading branch information
mayofaulkner committed Jan 12, 2024
1 parent d00989b commit 5e92d9a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion atlaselectrophysiology/plot_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,12 @@ def get_autocorr(self, clust_idx):
autocorr = xcorr(self.data['spikes']['times'][idx], self.data['spikes']['clusters'][idx],
AUTOCORR_BIN_SIZE, AUTOCORR_WIN_SIZE)

return autocorr[0, 0, :], self.data['clusters'].metrics.cluster_id[self.clust_id[clust_idx]]
if self.data['clusters'].get('metrics', {}).get('cluster_id', None) is None:
clust_id = self.clust_id[clust_idx]
else:
clust_id = self.data['clusters'].metrics.cluster_id[self.clust_id[clust_idx]]

return autocorr[0, 0, :], clust_id

def get_template_wf(self, clust_idx):
template_wf = (self.data['clusters']['waveforms'][self.clust_id[clust_idx], :, 0])
Expand Down

0 comments on commit 5e92d9a

Please sign in to comment.