本文整理汇总了Python中neo.core.SpikeTrain.annotations['side']方法的典型用法代码示例。如果您正苦于以下问题:Python SpikeTrain.annotations['side']方法的具体用法?Python SpikeTrain.annotations['side']怎么用?Python SpikeTrain.annotations['side']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neo.core.SpikeTrain
的用法示例。
在下文中一共展示了SpikeTrain.annotations['side']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: proc_src_condition_unit_repetition
# 需要导入模块: from neo.core import SpikeTrain [as 别名]
# 或者: from neo.core.SpikeTrain import annotations['side'] [as 别名]
def proc_src_condition_unit_repetition(sweep, damaIndex, timeStamp, sweepLen,
side, ADperiod, respWin, filename):
'''Get the repetion for a unit in a condition in a src file that has been
processed by the official matlab function. See proc_src for details'''
damaIndex = damaIndex.astype('int32')
if len(sweep):
times = np.array([res[0, 0] for res in sweep['time']])
shapes = np.concatenate([res.flatten()[np.newaxis][np.newaxis] for res
in sweep['shape']], axis=0)
trig2 = np.array([res[0, 0] for res in sweep['trig2']])
else:
times = np.array([])
shapes = np.array([[[]]])
trig2 = np.array([])
times = pq.Quantity(times, units=pq.ms, dtype=np.float32)
t_start = pq.Quantity(0, units=pq.ms, dtype=np.float32)
t_stop = pq.Quantity(sweepLen, units=pq.ms, dtype=np.float32)
trig2 = pq.Quantity(trig2, units=pq.ms, dtype=np.uint8)
waveforms = pq.Quantity(shapes, dtype=np.int8, units=pq.mV)
sampling_period = pq.Quantity(ADperiod, units=pq.us)
train = SpikeTrain(times=times, t_start=t_start, t_stop=t_stop,
trig2=trig2, dtype=np.float32, timestamp=timeStamp,
dama_index=damaIndex, side=side, copy=True,
respwin=respWin, waveforms=waveforms,
file_origin=filename)
train.annotations['side'] = side
train.sampling_period = sampling_period
return train