Beispiel #1
0
from netpyne import sim

from netpyne import specs 

specs.SimConfig()

file_name = 'SimpleNet.net.nml'

simConfig = specs.SimConfig()  # dictionary to store simConfig

# Simulation parameters
simConfig.duration = 1000 # Duration of the simulation, in ms
simConfig.dt = 0.025 # Internal integration timestep to use
simConfig.verbose = True

simConfig.recordCells = ['all']  # which cells to record from
simConfig.recordTraces = {'Vsoma':{'sec':'soma','loc':0.5,'var':'v'}}
simConfig.filename = 'SimpleNet'  # Set file output name
simConfig.saveDat = True # save traces


simConfig.plotRaster = True # Whether or not to plot a raster
simConfig.plotCells = ['all'] # plot recorded traces for this list of cells

sim.importNeuroML2SimulateAnalyze(file_name,simConfig)
Beispiel #2
0
simConfig.plotWeightChanges = False  # whether to plot weight changes (shown in conn matrix)
#simConfig.plot3dArch = True # plot 3d architecture

# Saving
simConfig.filename = 'TestL23.txt'  # Set file output name
simConfig.saveFileStep = simConfig.dt  # step size in ms to save data to disk
# simConfig.saveDat = True # save to dat file

###############################################################################
# IMPORT & RUN
###############################################################################

print("Running a NetPyNE based simulation for %sms (dt: %sms) at %s degC" %
      (simConfig.duration, simConfig.dt, h.celsius))

gids = sim.importNeuroML2SimulateAnalyze(nml2_file_name, simConfig)

print("Finished simulation")

###############################################################################
#   Saving data (this ensures the data gets saved in the format/files
#   as specified in the LEMS <Simulation> element)
###############################################################################

if sim.rank == 0:
    print(
        "Saving to file: Sim_TestL23.CG3D_L23PyrRS.v.dat (ref: Volts_file__CG3D_L23PyrRS)"
    )

    # Column: t
    col_Volts_file__CG3D_L23PyrRS_t = [
simConfig.plotWeightChanges = False # whether to plot weight changes (shown in conn matrix)
#simConfig.plot3dArch = True # plot 3d architecture

# Saving
simConfig.filename = 'TestL23.txt'  # Set file output name
simConfig.saveFileStep = simConfig.dt # step size in ms to save data to disk
# simConfig.saveDat = True # save to dat file


###############################################################################
# IMPORT & RUN
###############################################################################

print("Running a NetPyNE based simulation for %sms (dt: %sms) at %s degC"%(simConfig.duration, simConfig.dt, h.celsius))

gids = sim.importNeuroML2SimulateAnalyze(nml2_file_name,simConfig)

print("Finished simulation")


###############################################################################
#   Saving data (this ensures the data gets saved in the format/files 
#   as specified in the LEMS <Simulation> element)
###############################################################################


if sim.rank==0: 
    print("Saving to file: Sim_TestL23.CG3D_L23PyrRS.v.dat (ref: Volts_file__CG3D_L23PyrRS)")

 
    # Column: t