Skip to content

Commit 40675f0

Browse files
author
chris-langfield
committed
filter units
1 parent cafba88 commit 40675f0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

atlaselectrophysiology/load_data.py

+9
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ def get_data(self):
263263

264264
data['clusters'] = self.one.load_object(self.eid, 'clusters', collection=self.probe_collection,
265265
attribute=['metrics', 'peakToTrough', 'waveforms', 'channels'])
266+
267+
# filter out low spike units
268+
min_firing_rate = 50. / 3600.
269+
include_cond = data['clusters'].metrics["firing_rate"] > min_firing_rate
270+
data['clusters'].metrics = data['clusters'].metrics[include_cond]
271+
include_idx = include_cond.to_numpy()
272+
for k, v in data['clusters'].items():
273+
data['clusters'][k] = v[include_idx]
274+
266275
data['clusters']['exists'] = True
267276

268277
data['channels'] = self.one.load_object(self.eid, 'channels', collection=self.probe_collection,

0 commit comments

Comments
 (0)