File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
element_array_ephys/readers Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ def get_best_channel(self, unit):
129
129
130
130
def extract_spike_depths (self ):
131
131
""" Reimplemented from https://github.com/cortex-lab/spikes/blob/master/analysis/ksDriftmap.m """
132
+
132
133
if 'pc_features' in self .data :
133
134
ycoords = self .data ['channel_positions' ][:, 1 ]
134
135
pc_features = self .data ['pc_features' ][:, 0 , :] # 1st PC only
@@ -143,8 +144,9 @@ def extract_spike_depths(self):
143
144
# center of mass is sum(coords.*features)/sum(features)
144
145
self ._data ['spike_depths' ] = (np .sum (spk_feature_ycoord * pc_features ** 2 , axis = 1 )
145
146
/ np .sum (pc_features ** 2 , axis = 1 ))
146
- else :
147
- self ._data ['spike_depths' ] = None
147
+ else :
148
+ self ._data ['spike_depths' ] = None
149
+
148
150
# ---- extract spike sites ----
149
151
max_site_ind = np .argmax (np .abs (self .data ['templates' ]).max (axis = 1 ), axis = 1 )
150
152
spike_site_ind = max_site_ind [self .data ['spike_templates' ]]
You can’t perform that action at this time.
0 commit comments