File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,8 @@ def make(self, key):
533533 # -- Spike-sites and Spike-depths --
534534 spike_sites = np .array ([channel2electrodes [s ]['electrode' ]
535535 for s in kilosort_dataset .data ['spike_sites' ]])
536- spike_depths = kilosort_dataset .data ['spike_depths' ]
536+ spike_depths = kilosort_dataset .data ['spike_depths' ] \
537+ if 'pc_features' in kilosort_dataset .data else None
537538
538539 # -- Insert unit, label, peak-chn
539540 units = []
@@ -551,7 +552,7 @@ def make(self, key):
551552 'spike_times' : unit_spike_times ,
552553 'spike_count' : spike_count ,
553554 'spike_sites' : spike_sites [kilosort_dataset .data ['spike_clusters' ] == unit ],
554- 'spike_depths' : spike_depths [kilosort_dataset .data ['spike_clusters' ] == unit ]})
555+ 'spike_depths' : spike_depths [kilosort_dataset .data ['spike_clusters' ] == unit ] if spike_depths else None })
555556
556557 self .insert1 (key )
557558 self .Unit .insert ([{** key , ** u } for u in units ])
Original file line number Diff line number Diff line change @@ -532,7 +532,8 @@ def make(self, key):
532532 # -- Spike-sites and Spike-depths --
533533 spike_sites = np .array ([channel2electrodes [s ]['electrode' ]
534534 for s in kilosort_dataset .data ['spike_sites' ]])
535- spike_depths = kilosort_dataset .data ['spike_depths' ]
535+ spike_depths = kilosort_dataset .data ['spike_depths' ] \
536+ if 'pc_features' in kilosort_dataset .data else None
536537
537538 # -- Insert unit, label, peak-chn
538539 units = []
@@ -550,7 +551,7 @@ def make(self, key):
550551 'spike_times' : unit_spike_times ,
551552 'spike_count' : spike_count ,
552553 'spike_sites' : spike_sites [kilosort_dataset .data ['spike_clusters' ] == unit ],
553- 'spike_depths' : spike_depths [kilosort_dataset .data ['spike_clusters' ] == unit ]})
554+ 'spike_depths' : spike_depths [kilosort_dataset .data ['spike_clusters' ] == unit ] if spike_depths else None })
554555
555556 self .insert1 (key )
556557 self .Unit .insert ([{** key , ** u } for u in units ])
You can’t perform that action at this time.
0 commit comments