-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.py
35 lines (29 loc) · 1.02 KB
/
init.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from netpyne import sim
from itertools import product
from npvec import npvec
import numpy as np
import matplotlib.pyplot as plt
cfg, netParams = sim.readCmdLineArgs()
sim.create(simConfig = cfg, netParams = netParams)
# store stims in dictionary
stimd = { 'ic': {},'vc': {},'pls': {} }
for isi in cfg.isis:
ipulse = npvec(cfg.duration, cfg.dt, 0)
deltas = []
delta = cfg.dur[0]
while delta < cfg.duration:
deltas.append(delta)
delta = delta + isi
ipulse.plsf_train(deltas, 5, 0.25)
stimd['pls'][isi] = sim.h.Vector(ipulse.vector)
# last iclampv t used (all same)
t = sim.h.Vector(ipulse.t)
# Choi
# Membrane potential was set by constant current injection
# (−13.74 pA for −70 mV, −7.24 pA for −65 mV, 9.55 pA for −55 mV, and 25.64 pA for −50 mV)
for cell in sim.net.cells:
tags = cell.tags['cellType']
if tags['stim'] == 'pls':
stimd['pls'][tags['val']].play(cell.stims[0]['hObj']._ref_amp, t, True)
sim.simulate() # calls runSim() and gatherData()
#sim.analyze()