channel_ids = recording.get_channel_ids()
fs = recording.get_sampling_frequency()
num_chan = recording.get_num_channels()

print('Channel ids:', channel_ids)
print('Sampling frequency:', fs)
print('Number of channels:', num_chan)

unit_ids = sorting_true.get_unit_ids()
spike_train = sorting_true.get_unit_spike_train(unit_id=unit_ids[0])

print('Unit ids:', unit_ids)
print('Spike train of first unit:', spike_train)

print('Available sorters', ss.available_sorters())
print('Installed sorters', ss.installed_sorters())

print(ss.get_default_params('mountainsort4'))
print(ss.get_default_params('klusta'))

recording_f = st.preprocessing.bandpass_filter(recording,
                                               freq_min=300,
                                               freq_max=6000)
recording_cmr = st.preprocessing.common_reference(recording_f,
                                                  reference='median')

sorting_KL = ss.run_klusta(recording=recording_cmr)

print('Units found by Klusta:', sorting_KL.get_unit_ids())

snrs = st.validation.compute_snrs(sorting_KL, recording_cmr)
Esempio n. 2
0
# First, let's create a toy example:

recording, sorting_true = se.example_datasets.toy_example(duration=10, seed=0)

##############################################################################
# Check available sorters
# --------------------------
#

print(ss.available_sorters())

##############################################################################
# This will list the sorters available through SpikeInterface. To see which sorters are installed on the machine
# you can run:

print(ss.installed_sorters())

##############################################################################
# Change sorter parameters
# -----------------------------------
#

default_ms4_params = ss.Mountainsort4Sorter.default_params()
print(default_ms4_params)

##############################################################################
#  Parameters can be changed either by passing a full dictionary, or by
# passing single arguments.

# Mountainsort4 spike sorting
default_ms4_params['detect_threshold'] = 4