本文整理汇总了Python中neo.io.nestio.NestIO.read_analogsignal方法的典型用法代码示例。如果您正苦于以下问题:Python NestIO.read_analogsignal方法的具体用法?Python NestIO.read_analogsignal怎么用?Python NestIO.read_analogsignal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neo.io.nestio.NestIO
的用法示例。
在下文中一共展示了NestIO.read_analogsignal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_id_column_none_multiple_neurons
# 需要导入模块: from neo.io.nestio import NestIO [as 别名]
# 或者: from neo.io.nestio.NestIO import read_analogsignal [as 别名]
def test_id_column_none_multiple_neurons(self):
"""
Tests if function correctly raises an error if the user tries to read
from a file which does not contain unit IDs, but data for multiple
units.
"""
filename = get_test_file_full_path(
ioclass=NestIO,
filename='0time-1255-0.gdf',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
with self.assertRaises(ValueError):
r.read_analogsignal(t_stop=1000. * pq.ms, lazy=False,
sampling_period=pq.ms,
id_column=None, time_column=0,
value_column=1)
r.read_segment(t_stop=1000. * pq.ms, lazy=False,
sampling_period=pq.ms, id_column_gdf=None,
time_column_gdf=0)
示例2: test_no_gid_no_time
# 需要导入模块: from neo.io.nestio import NestIO [as 别名]
# 或者: from neo.io.nestio.NestIO import read_analogsignal [as 别名]
def test_no_gid_no_time(self):
filename = get_test_file_full_path(
ioclass=NestIO,
filename='N1-0Vm-1267-0.dat',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
anasig = r.read_analogsignal(gid=None,
sampling_period=pq.ms, lazy=False,
id_column=None, time_column=None,
value_column=0, value_type='V_m')
self.assertEqual(anasig.annotations['id'], None)
self.assertEqual(len(anasig), 19)
示例3: test_single_gid
# 需要导入模块: from neo.io.nestio import NestIO [as 别名]
# 或者: from neo.io.nestio.NestIO import read_analogsignal [as 别名]
def test_single_gid(self):
filename = get_test_file_full_path(
ioclass=NestIO,
filename='N1-0gid-1time-2Vm-1265-0.dat',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
anasig = r.read_analogsignal(gid=1, t_stop=1000. * pq.ms,
time_unit=pq.CompoundUnit('0.1*ms'),
sampling_period=pq.ms, lazy=False,
id_column=0, time_column=1,
value_column=2, value_type='V_m')
assert anasig.annotations['id'] == 1
示例4: test_no_gid
# 需要导入模块: from neo.io.nestio import NestIO [as 别名]
# 或者: from neo.io.nestio.NestIO import read_analogsignal [as 别名]
def test_no_gid(self):
filename = get_test_file_full_path(
ioclass=NestIO,
filename='N1-0time-1Vm-1266-0.dat',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
anasig = r.read_analogsignal(gid=None, t_stop=1000. * pq.ms,
time_unit=pq.CompoundUnit('0.1*ms'),
sampling_period=pq.ms, lazy=False,
id_column=None, time_column=0,
value_column=1, value_type='V_m')
self.assertEqual(anasig.annotations['id'], None)
self.assertEqual(len(anasig), 19)
示例5: test_read_analogsignal
# 需要导入模块: from neo.io.nestio import NestIO [as 别名]
# 或者: from neo.io.nestio.NestIO import read_analogsignal [as 别名]
def test_read_analogsignal(self):
"""
Tests reading files in the 2 different formats:
- with GIDs, with times as floats
- with GIDs, with time as integer
"""
filename = get_test_file_full_path(
ioclass=NestIO,
filename='0gid-1time-2gex-3Vm-1261-0.dat',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
r.read_analogsignal(gid=1, t_stop=1000. * pq.ms,
sampling_period=pq.ms, lazy=False,
id_column=0, time_column=1,
value_column=2, value_type='V_m')
r.read_segment(gid_list=[1], t_stop=1000. * pq.ms,
sampling_period=pq.ms, lazy=False, id_column_dat=0,
time_column_dat=1, value_columns_dat=2,
value_types='V_m')
filename = get_test_file_full_path(
ioclass=NestIO,
filename='0gid-1time_in_steps-2Vm-1263-0.dat',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
r.read_analogsignal(gid=1, t_stop=1000. * pq.ms,
time_unit=pq.CompoundUnit('0.1*ms'),
sampling_period=pq.ms, lazy=False,
id_column=0, time_column=1,
value_column=2, value_type='V_m')
r.read_segment(gid_list=[1], t_stop=1000. * pq.ms,
time_unit=pq.CompoundUnit('0.1*ms'),
sampling_period=pq.ms, lazy=False, id_column_dat=0,
time_column_dat=1, value_columns_dat=2,
value_types='V_m')
filename = get_test_file_full_path(
ioclass=NestIO,
filename='0gid-1time-2Vm-1259-0.dat',
directory=self.local_test_dir, clean=False)
r = NestIO(filenames=filename)
r.read_analogsignal(gid=1, t_stop=1000. * pq.ms,
time_unit=pq.CompoundUnit('0.1*ms'),
sampling_period=pq.ms, lazy=False,
id_column=0, time_column=1,
value_column=2, value_type='V_m')
r.read_segment(gid_list=[1], t_stop=1000. * pq.ms,
time_unit=pq.CompoundUnit('0.1*ms'),
sampling_period=pq.ms, lazy=False, id_column_dat=0,
time_column_dat=1, value_columns_dat=2,
value_types='V_m')