From f987bdd7bc3d8b312a9a19df17012f5c775d718d Mon Sep 17 00:00:00 2001 From: Zach McKenzie <92116279+zm711@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:54:56 -0500 Subject: [PATCH] skip un-needed waveforms. --- src/spikeanalysis/intrinsic_plotter.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/spikeanalysis/intrinsic_plotter.py b/src/spikeanalysis/intrinsic_plotter.py index e31a59a..8025849 100644 --- a/src/spikeanalysis/intrinsic_plotter.py +++ b/src/spikeanalysis/intrinsic_plotter.py @@ -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]