本文整理汇总了Python中attrdict.AttrDict.spike_times方法的典型用法代码示例。如果您正苦于以下问题:Python AttrDict.spike_times方法的具体用法?Python AttrDict.spike_times怎么用?Python AttrDict.spike_times使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类attrdict.AttrDict
的用法示例。
在下文中一共展示了AttrDict.spike_times方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: readkwikinfo
# 需要导入模块: from attrdict import AttrDict [as 别名]
# 或者: from attrdict.AttrDict import spike_times [as 别名]
def readkwikinfo(kwik, grupete=3):
model = KwikModel(kwik) # load kwik model from file
spiketimes = model.spike_times # extract the absolute spike times
clusters = model.cluster_groups # extract the cluster names
sample_rate = model.sample_rate # extract sampling freq
spikedata = {} # initialise dictionary
for cluster in clusters.keys():
clustergroup = clusters[cluster]
if clustergroup==grupete: # only look at specified type of cluster, 0 = noise, 1 = MUA, 2 = GOOD, 3 = unsorted
spiketimematrix = AttrDict({'spike_times': np.zeros(len(spiketimes[where(model.spike_clusters==cluster)]))})
spiketimematrix.spike_times = spiketimes[where(model.spike_clusters==cluster)]
spikedata[cluster] = spiketimematrix # data structure is a dictionary with attribute accessible spiketimes
# attribute accessible means that spikedata.spike_times works, normal dictionaries would be spikedata[spike_times]
model.close()
return spikedata, sample_rate