本文整理汇总了Python中simulation.Simulation.dump_data方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.dump_data方法的具体用法?Python Simulation.dump_data怎么用?Python Simulation.dump_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulation.Simulation
的用法示例。
在下文中一共展示了Simulation.dump_data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single deep LTS cell and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = DeepLTS(DeepLTS.prototype, sim.model.path + "/DeepLTS")
config.LOGGER.debug(("Created cell: %s" % mycell.path))
vm_table = mycell.comp[mycell.presyn].insertRecorder("Vm_deepLTS", "Vm", sim.data)
pulsegen = mycell.soma.insertPulseGen(
"pulsegen", sim.model, firstLevel=3e-10, firstDelay=100e-3, firstWidth=200e-3
)
sim.schedule()
if mycell.has_cycle():
config.LOGGER.warning("WARNING!! CYCLE PRESENT IN CICRUIT.")
sim.run(0.5)
sim.dump_data("data")
mycell.dump_cell("deepLTS.txt")
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
mus_t = linspace(0, sim.simtime * 1e3, len(mus_vm))
try:
nrn_vm = config.pylab.loadtxt("../nrn/mydata/Vm_deepLTS.plot")
nrn_t = nrn_vm[:, 0]
nrn_vm = nrn_vm[:, 1]
config.pylab.plot(nrn_t, nrn_vm, "y-", label="nrn vm")
except IOError:
print "NEURON Data not available."
config.pylab.plot(mus_t, mus_vm, "g-.", label="mus vm")
config.pylab.legend()
config.pylab.title("DeepLTS")
config.pylab.show()
示例2: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single deep basket cell and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = DeepBasket(DeepBasket.prototype, sim.model.path + "/DeepBasket")
print "Created cell:", mycell.path
vm_table = mycell.comp[mycell.presyn].insertRecorder("Vm_deepbask", "Vm", sim.data)
ca_conc_path = mycell.soma.path + "/CaPool"
ca_table = None
if config.context.exists(ca_conc_path):
ca_conc = moose.CaConc(ca_conc_path)
ca_table = moose.Table("Ca_deepbask", sim.data)
ca_table.stepMode = 3
ca_conc.connect("Ca", ca_table, "inputRequest")
kc_path = mycell.soma.path + "/KC"
gk_table = None
if config.context.exists(kc_path):
gk_table = moose.Table("gkc", sim.data)
gk_table.stepMode = 3
kc = moose.HHChannel(kc_path)
kc.connect("Gk", gk_table, "inputRequest")
pymoose.showmsg(ca_conc)
pulsegen = mycell.soma.insertPulseGen(
"pulsegen", sim.model, firstLevel=3e-10, firstDelay=100e-3, firstWidth=200e-3
)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(500e-3)
t2 = datetime.now()
delta = t2 - t1
print "simulation time: ", delta.seconds + 1e-6 * delta.microseconds
sim.dump_data("data")
mycell.dump_cell("deepbask.txt")
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
nrn_vm = config.pylab.loadtxt("../nrn/mydata/Vm_deepbask.plot")
nrn_t = nrn_vm[:, 0]
mus_t = linspace(0, nrn_t[-1], len(mus_vm))
nrn_vm = nrn_vm[:, 1]
nrn_ca = config.pylab.loadtxt("../nrn/mydata/Ca_deepbask.plot")
nrn_ca = nrn_ca[:, 1]
config.pylab.plot(nrn_t, nrn_vm, "y-", label="nrn vm")
config.pylab.plot(mus_t, mus_vm, "g-.", label="mus vm")
# if ca_table:
# ca_array = config.pylab.array(ca_table)
# config.pylab.plot(nrn_t, -nrn_ca, 'r-', label='nrn (-)ca')
# config.pylab.plot(mus_t, -ca_array, 'b-.', label='mus (-)ca')
# print config.pylab.amax(ca_table)
config.pylab.legend()
config.pylab.title("DeepBasket")
config.pylab.show()
示例3: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single thalamocortical relay cell
and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = TuftedRS(TuftedRS.prototype, sim.model.path + "/TuftedRS")
print 'MOOSE: Created cell:', mycell.path
vm_table = mycell.comp[cls.presyn].insertRecorder('Vm_tuftRS', 'Vm', sim.data)
# ca_conc_path = mycell.soma.path + '/CaPool'
# ca_table = None
# if config.context.exists(ca_conc_path):
# ca_conc = moose.CaConc(ca_conc_path)
# ca_table = moose.Table('Ca_tuftRS', sim.data)
# ca_table.stepMode = 3
# ca_conc.connect('Ca', ca_table, 'inputRequest')
# kc_path = mycell.soma.path + '/KC'
# gk_table = None
# if config.context.exists(kc_path):
# gk_table = moose.Table('gkc', sim.data)
# gk_table.stepMode = 3
# kc = moose.HHChannel(kc_path)
# kc.connect('Gk', gk_table, 'inputRequest')
# pymoose.showmsg(ca_conc)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=1e-9, firstDelay=100e-3, firstWidth=200e-3)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(500e-3)
t2 = datetime.now()
delta = t2 - t1
print 'MOOSE: simulation time: ', delta.seconds + 1e-6 * delta.microseconds
sim.dump_data('data')
# mycell.dump_cell('tuftRS.txt')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_tuftRS.plot')
nrn_t = nrn_vm[:, 0]
mus_t = linspace(0, nrn_t[-1], len(mus_vm))
nrn_vm = nrn_vm[:, 1]
# nrn_ca = config.pylab.loadtxt('../nrn/mydata/Ca_tuftRS.plot')
# nrn_ca = nrn_ca[:,1]
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
# if ca_table:
# ca_array = config.pylab.array(ca_table)
# config.pylab.plot(nrn_t, -nrn_ca, 'r-', label='nrn (-)ca')
# config.pylab.plot(mus_t, -ca_array, 'b-.', label='mus (-)ca')
# print config.pylab.amax(ca_table)
config.pylab.legend()
config.pylab.title('tuftedRS')
config.pylab.show()
示例4: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single spiny stellate cell and plots the Vm and
[Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
proto = TraubCell.read_proto("SpinyStellate.p", "SpinyStellate_1", SpinyStellate.chan_params)
print 'Model path', sim.model.path , 'proto', proto
mycell = SpinyStellate(proto, sim.model.path + "/SpinyStellate")
print 'Cell created'
for handler in config.LOGGER.handlers:
handler.flush()
mycell.soma.x0 = 0.0
mycell.soma.y0 = 0.0
mycell.soma.z0 = 0.0
mycell.soma.x = 0.0
mycell.soma.y = 0.0
mycell.soma.z = mycell.soma.length
# mycellview = MyCellView(mycell)
config.LOGGER.debug('Created cell: %s' % (mycell.path))
# for neighbour in mycell.soma.neighbours('raxial'):
# print 'RAXIAL', neighbours.path()
# for neighbour in mycell.soma.neighbours('axial'):
# print 'AXIAL', neighbour.path()
vm_table = mycell.comp[mycell.presyn].insertRecorder('Vm_spinstell', 'Vm', sim.data)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=3e-10, firstDelay=50e-3, firstWidth=50e-3)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(200e-3)
t2 = datetime.now()
delta = t2 - t1
print 'simulation time: ', delta.seconds + 1e-6 * delta.microseconds
sim.dump_data('data')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
mus_t = linspace(0, sim.simtime * 1e3, len(mus_vm))
try:
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_spinstell.plot')
nrn_t = nrn_vm[:, 0]
nrn_vm = nrn_vm[:, 1]
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
except IOError:
print 'NEURON Data not available.'
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
config.pylab.legend()
config.pylab.show()
示例5: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single spiny stellate cell and plots the Vm and
[Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
proto = TraubCell.read_proto("SpinyStellate.p", "SpinyStellate_1", SpinyStellate.chan_params)
print 'Model path', sim.model.path , 'proto', proto
mycell = SpinyStellate(proto, sim.model.path + "/SpinyStellate")
print 'Cell created'
for handler in config.LOGGER.handlers:
handler.flush()
config.LOGGER.debug('Created cell: %s' % (mycell.path))
# for neighbour in mycell.soma.neighbours('raxial'):
# print 'RAXIAL', neighbours.path()
# for neighbour in mycell.soma.neighbours('axial'):
# print 'AXIAL', neighbour.path()
vm_table = mycell.comp[mycell.presyn].insertRecorder('Vm_spinstell', 'Vm', sim.data)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=3e-10, firstDelay=100e-3, firstWidth=200e-3)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
config.LOGGER.warning("WARNING!! CYCLE PRESENT IN CICRUIT.")
t1 = datetime.now()
sim.run(0.5)
t2 = datetime.now()
delta = t2 - t1
config.BENCHMARK_LOGGER.info('simulation time: %g' % (delta.seconds + 1e-6 * delta.microseconds))
for msg in moose.Neutral('/model/SpinyStellate/solve').inMessages():
print msg
for msg in moose.Neutral('/model/SpinyStellate/solve').outMessages():
print msg
sim.dump_data('data')
# mycell.dump_cell('spinstell.txt')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
mus_t = linspace(0, sim.simtime*1e3, len(mus_vm))
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
try:
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_spinstell.plot')
nrn_t = nrn_vm[:, 0]
nrn_vm = nrn_vm[:, 1]
nrn_ca = config.pylab.loadtxt('../nrn/mydata/Ca_spinstell.plot')
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
except IOError:
pass
config.pylab.legend(loc=0)
config.pylab.title('spinystellate')
config.pylab.show()
示例6: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single tufted intrinsically bursting cell and
plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = TuftedIB(TuftedIB.prototype, sim.model.path + "/TuftedIB")
print 'Created cell:', mycell.path
vm_table = mycell.comp[mycell.presyn].insertRecorder('Vm_tuftIB', 'Vm', sim.data)
ca_conc_path = mycell.soma.path + '/CaPool'
ca_table = None
if config.context.exists(ca_conc_path):
ca_conc = moose.CaConc(ca_conc_path)
ca_table = moose.Table('Ca_tuftIB', sim.data)
ca_table.stepMode = 3
ca_conc.connect('Ca', ca_table, 'inputRequest')
kc_path = mycell.soma.path + '/KC'
gk_table = None
if config.context.exists(kc_path):
gk_table = moose.Table('gkc', sim.data)
gk_table.stepMode = 3
kc = moose.HHChannel(kc_path)
kc.connect('Gk', gk_table, 'inputRequest')
pymoose.showmsg(ca_conc)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=0.3e-9, firstDelay=0.0, firstWidth=50e-3)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(200e-3)
t2 = datetime.now()
delta = t2 - t1
print 'simulation time: ', delta.seconds + 1e-6 * delta.microseconds
sim.dump_data('data')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
mus_t = linspace(0, sim.simtime * 1e3, len(mus_vm))
try:
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_deepLTS.plot')
nrn_t = nrn_vm[:, 0]
nrn_vm = nrn_vm[:, 1]
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
except IOError:
print 'NEURON Data not available.'
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
config.pylab.legend()
config.pylab.show()
示例7: test_full_model
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_full_model(simtime, simdt=1e-4, plotdt=1e-3, cell_count=None):
"""Setup and run the full Traub model"""
sim = Simulation('traub')
net = []
scale = 10
if cell_count is None:
cell_count = CELL_COUNT
network = Network(sim, cell_count)
network.setup_random_recording(0.05) # record from 5% of cells
sim.schedule(simdt=simdt, plotdt=plotdt, gldt=1e10)
sim.run(time=simtime)
sim.dump_data(config.data_dir, True)
示例8: inject_test
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def inject_test(celltype, current_list, simtime=2.0):
test_data = {}
sim = Simulation(celltype)
for ii, current in enumerate(current_list):
test_data[ii] = setup_model(ii, celltype, current, sim)
sim.schedule()
sim.run(simtime)
sim.dump_data('data')
timeseries = np.linspace(0, simtime, len(test_data[0]['Vm']))
for ii, current in enumerate(current_list):
color = cmap(ii*1.0/len(current_list), len(current_list))
plt.plot(timeseries * 1e3, np.array(test_data[ii]['Vm']) * 1e3, color=color, label='%g nA' % (current * 1e9))
plt.legend()
plt.show()
示例9: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single superficial pyramidal regular spiking
cell and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
sim.simdt = 5e-6
sim.plotdt = 1e-4
mycell = SupPyrRS(SupPyrRS.prototype, sim.model.path + "/SupPyrRS")
config.LOGGER.info('Created cell: %s' % (mycell.path))
vm_table = mycell.comp[mycell.presyn].insertRecorder('Vm_suppyrRS', 'Vm', sim.data)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=0.3e-9, firstDelay=100e-3, firstWidth=200e-3)
sim.schedule()
if mycell.has_cycle():
config.LOGGER.warning("WARNING!! CYCLE PRESENT IN CICRUIT.")
t1 = datetime.now()
sim.run(500e-3)
t2 = datetime.now()
sim.dump_data('data')
delta = t2 - t1
config.BENCHMARK_LOGGER.info('simulation time: %g' % (delta.seconds + 1e-6 * delta.microseconds))
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
mus_t = linspace(0, sim.simtime*1e3, len(mus_vm))
try:
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_suppyrrs.plot')
nrn_t = nrn_vm[:, 0]
nrn_vm = nrn_vm[:, 1]
# nrn_ca = config.pylab.loadtxt('../nrn/mydata/Ca_suppyrrs.plot')
# nrn_ca = nrn_ca[:,1]
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
except IOError:
pass
data = config.pylab.zeros((len(mus_vm), 2))
data[:, 0] = mus_t[:]
data[:, 1] = mus_vm[:]
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
# if ca_table:
# ca_array = config.pylab.array(ca_table)
# config.pylab.plot(nrn_t, -nrn_ca, 'r-', label='nrn (-)ca')
# config.pylab.plot(mus_t, -ca_array, 'b-.', label='mus (-)ca')
# print config.pylab.amax(ca_table)
config.pylab.legend()
config.pylab.title('suppyrRS')
config.pylab.show()
示例10: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single nRT cell and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = SupBasket(SupBasket.prototype, sim.model.path + "/SupBasket")
print "Created cell:", mycell.path
vm_table = mycell.comp[mycell.presyn].insertRecorder("Vm_supbask", "Vm", sim.data)
pulsegen = mycell.soma.insertPulseGen(
"pulsegen", sim.model, firstLevel=3e-10, firstDelay=100e-3, firstWidth=200e-3
)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(500e-3)
t2 = datetime.now()
delta = t2 - t1
print "simulation time: ", delta.seconds + 1e-6 * delta.microseconds
sim.dump_data("data")
mycell.dump_cell("supbask.txt")
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
nrn_vm = config.pylab.loadtxt("../nrn/mydata/Vm_supbask.plot")
nrn_t = nrn_vm[:, 0]
mus_t = linspace(0, nrn_t[-1], len(mus_vm))
nrn_vm = nrn_vm[:, 1]
nrn_ca = config.pylab.loadtxt("../nrn/mydata/Ca_supbask.plot")
nrn_ca = nrn_ca[:, 1]
config.pylab.plot(nrn_t, nrn_vm, "y-", label="nrn vm")
config.pylab.plot(mus_t, mus_vm, "g-.", label="mus vm")
# if ca_table:
# ca_array = config.pylab.array(ca_table)
# config.pylab.plot(nrn_t, -nrn_ca, 'r-', label='nrn (-)ca')
# config.pylab.plot(mus_t, -ca_array, 'b-.', label='mus (-)ca')
# print config.pylab.amax(ca_table)
config.pylab.legend()
config.pylab.title("supbasket")
config.pylab.show()
示例11: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single superficial LTS cell and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = SupLTS(SupLTS.prototype, sim.model.path + "/SupLTS")
print 'Created cell:', mycell.path
vm_table = mycell.comp[mycell.presyn].insertRecorder('Vm_supLTS', 'Vm', sim.data)
ca_conc_path = mycell.soma.path + '/CaPool'
ca_table = None
if config.context.exists(ca_conc_path):
ca_conc = moose.CaConc(ca_conc_path)
ca_table = moose.Table('Ca_supLTS', sim.data)
ca_table.stepMode = 3
ca_conc.connect('Ca', ca_table, 'inputRequest')
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=3e-10, firstDelay=100e-3, firstWidth=200e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(500e-3)
t2 = datetime.now()
delta = t2 - t1
print 'simulation time: ', delta.seconds + 1e-6 * delta.microseconds
sim.dump_data('data')
mycell.dump_cell('supLTS.txt')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_supLTS.plot')
nrn_t = nrn_vm[:, 0]
mus_t = linspace(0, sim.simtime*1e3, len(mus_vm))
nrn_vm = nrn_vm[:, 1]
nrn_ca = config.pylab.loadtxt('../nrn/mydata/Ca_supLTS.plot')
nrn_ca = nrn_ca[:,1]
title = 'SupLTS:'
config.pylab.title(title)
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
config.pylab.legend()
config.pylab.title('supLTS')
config.pylab.show()
示例12: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single thalamocortical relay cell
and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
sim.simdt = 5e-6
sim.plotdt = 0.5e-4
mycell = TCR(TCR.prototype, sim.model.path + "/TCR")
# for ii in range(1, mycell.num_comp):
# mycell.comp[ii].Em = -57e-3
print 'Created cell:', mycell.path
vm_table_presyn = mycell.comp[mycell.presyn].insertRecorder('Vm_TCR', 'Vm', sim.data)
vm_table_soma = mycell.soma.insertRecorder('TCR_soma_Vm', 'Vm', sim.data)
print 'Tables created:', vm_table_soma.path, vm_table_presyn.path
stim_table = moose.Table('%s/stimulus' % (sim.data.path))
stim_table.stepMode = 3
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=-1e-9, firstDelay=100e-3, firstWidth=100e-3)
pulsegen.secondDelay = 200e-3
pulsegen.secondWidth = 100e-3
pulsegen.secondLevel = 0.3e-9
pulsegen.count = 3
pulsegen.delay[2] = 1e9
# pulsegen.count = 4
# for ii in range(pulsegen.count):
# pulsegen.delay[ii] = 0.025
# pulsegen.level[ii] = 1e-9
# pulsegen.width[ii] = 100e-6
# pulsegen.delay[0]= 3.0
stim_table.connect('inputRequest', pulsegen, 'output')
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(0.5)
t2 = datetime.now()
delta = t2 - t1
print 'simulation time: ', delta.seconds + 1e-6 * delta.microseconds
sim.dump_data('data')
示例13: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single superficial axo-axonic cell and plots
the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = SupAxoaxonic(SupAxoaxonic.prototype, sim.model.path + "/SupAxoaxonic")
print 'Created cell:', mycell.path
vm_table = mycell.comp[mycell.presyn].insertRecorder('Vm_supaxax', 'Vm', sim.data)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=3e-10, firstDelay=100e-3, firstWidth=200e-3)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(500e-3)
t2 = datetime.now()
delta = t2 - t1
print 'simulation time: ', delta.seconds + 1e-6 * delta.microseconds
sim.dump_data('data')
mycell.dump_cell('supaxax.txt')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_supaxax.plot')
nrn_t = nrn_vm[:, 0]
mus_t = linspace(0, nrn_t[-1], len(mus_vm))
nrn_vm = nrn_vm[:, 1]
nrn_ca = config.pylab.loadtxt('../nrn/mydata/Ca_supaxax.plot')
nrn_ca = nrn_ca[:,1]
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
# if ca_table:
# ca_array = config.pylab.array(ca_table)
# config.pylab.plot(nrn_t, -nrn_ca, 'r-', label='nrn (-)ca')
# config.pylab.plot(mus_t, -ca_array, 'b-.', label='mus (-)ca')
# print config.pylab.amax(ca_table)
config.pylab.legend()
config.pylab.title('supaxoaxonic')
config.pylab.show()
示例14: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single nRT cell and plots the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = nRT(nRT.prototype, sim.model.path + "/nRT")
config.LOGGER.info('Created cell: %s' % (mycell.path))
vm_table = mycell.comp[mycell.presyn].insertRecorder('Vm_nRT', 'Vm', sim.data)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=3e-10, firstDelay=100.0e-3, firstWidth=200e-3)
# pulsegen1 = mycell.soma.insertPulseGen('pulsegen1', sim.model, firstLevel=3e-7, firstDelay=150e-3, firstWidth=10e-3)
sim.schedule()
if mycell.has_cycle():
config.LOGGING.warning("WARNING!! CYCLE PRESENT IN CICRUIT.")
t1 = datetime.now()
sim.run(500e-3)
t2 = datetime.now()
delta = t2 - t1
config.LOGGER.info('simulation time: %g' % (delta.seconds + 1e-6 * delta.microseconds))
sim.dump_data('data')
mycell.dump_cell('nRT.txt')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
mus_t = linspace(0, sim.simtime*1e3, len(mus_vm))
try:
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_nRT.plot')
print 'Here', nrn_vm.shape
nrn_t = nrn_vm[:, 0]
nrn_vm = nrn_vm[:, 1]
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
except IOError:
pass
print mus_vm.shape, mus_t.shape
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
config.pylab.legend()
config.pylab.title('nRT')
config.pylab.show()
示例15: test_single_cell
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import dump_data [as 别名]
def test_single_cell(cls):
"""Simulates a single nontufted regular spiking cell and plots
the Vm and [Ca2+]"""
config.LOGGER.info("/**************************************************************************")
config.LOGGER.info(" *")
config.LOGGER.info(" * Simulating a single cell: %s" % (cls.__name__))
config.LOGGER.info(" *")
config.LOGGER.info(" **************************************************************************/")
sim = Simulation(cls.__name__)
mycell = NontuftedRS(NontuftedRS.prototype, sim.model.path + "/NontuftedRS")
print 'Created cell:', mycell.path
vm_table = mycell.comp[NontuftedRS.presyn].insertRecorder('Vm_nontuftRS', 'Vm', sim.data)
pulsegen = mycell.soma.insertPulseGen('pulsegen', sim.model, firstLevel=1e-9, firstDelay=100e-3, firstWidth=200e-3)
sim.schedule()
if mycell.has_cycle():
print "WARNING!! CYCLE PRESENT IN CICRUIT."
t1 = datetime.now()
sim.run(0.5)
t2 = datetime.now()
delta = t2 - t1
print 'simulation time: ', delta.seconds + 1e-6 * delta.microseconds
sim.dump_data('data')
if config.has_pylab:
mus_vm = config.pylab.array(vm_table) * 1e3
mus_t = linspace(0, sim.simtime*1e3, len(mus_vm))
config.pylab.plot(mus_t, mus_vm, 'g-.', label='mus vm')
try:
nrn_vm = config.pylab.loadtxt('../nrn/mydata/Vm_nontuftRS.plot')
nrn_t = nrn_vm[:, 0]
nrn_vm = nrn_vm[:, 1]
config.pylab.plot(nrn_t, nrn_vm, 'y-', label='nrn vm')
except IOError:
pass
config.pylab.legend()
config.pylab.title('nontuftedRS')
config.pylab.show()