Ejemplo n.º 1
0
 def select_units(self, unit_ids, renamed_unit_ids=None):
     from spikeinterface import UnitsSelectionSorting
     sub_sorting = UnitsSelectionSorting(self,
                                         unit_ids,
                                         renamed_unit_ids=renamed_unit_ids)
     return sub_sorting
print(sorting2.get_property('firing_rate'))

##############################################################################
# You can also get a a sorting with a subset of unit. Properties are
# propagated to the new object:

sorting3 = sorting2.select_units(unit_ids=[1, 4])
print(sorting3)

print(sorting3.get_property('firing_rate'))

# which is equivalent to
from spikeinterface import UnitsSelectionSorting

sorting3 = UnitsSelectionSorting(sorting2, unit_ids=[1, 4])

###############################################################################
# A sorting can be "dumped" (exported) to:
#  * a dict
#  * a json file
#  * a pickle file
#
# The "dump" operation is lazy, i.e., the spike trains are not exported.
# Only the information about how to reconstruct the sorting are dumped:

from spikeinterface import load_extractor
from pprint import pprint

d = sorting2.to_dict()
pprint(d)