Skip to content

Commit

Permalink
skip un-needed waveforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 authored Nov 6, 2023
1 parent 8a58d7c commit f987bdd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/spikeanalysis/intrinsic_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,22 @@ def plot_waveforms(self, sp: SpikeData):
A SpikeData object which has raw waveform values loaded"""

waveforms = sp.waveforms

sp.reload_data()
if len(sp._cids) != np.shape(waveforms)[0]: # if not same need to run set_qc
sp.set_qc()
if len(sp._cids) != np.shape(waveforms)[0]: # still not same need to index waveforms
waveforms = waveforms[sp._qc_threshold, ...]

try:
noise = sp.noise
except AttributeError:
noise = np.array([])

mean_waveforms = np.nanmean(waveforms, axis=1)

for cluster in range(np.shape(waveforms)[0]):
if self._cids[cluster] in noise:
pass
max_val = np.argwhere(mean_waveforms[cluster] == np.min(mean_waveforms[cluster]))[0]
max_channel = max_val[0]

Expand Down

0 comments on commit f987bdd

Please sign in to comment.