-
Notifications
You must be signed in to change notification settings - Fork 50
/
c302_AWC.py
49 lines (32 loc) · 1.48 KB
/
c302_AWC.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import c302
import sys
import neuroml.writers as writers
def setup(parameter_set,
generate=False,
target_directory='examples',
data_reader="SpreadsheetDataReader"):
exec('from parameters_%s import ParameterisedModel'%parameter_set, globals())
params = ParameterisedModel()
cells = ['RIAL', 'RIAR', 'SMDVL', 'SMDVR', 'SMDDL', 'SMDDR', 'AIYL', 'AIYR', 'AWCL', 'AWCR']
#cells = None
cells_to_stimulate = []
reference = "c302_%s_AWC"%parameter_set
nml_doc = None
if generate:
nml_doc = c302.generate(reference,
params,
cells=cells,
cells_to_stimulate=cells_to_stimulate,
duration=800,
dt=0.1,
target_directory = target_directory)
stim_amplitude = "0.6nA"
c302.add_new_input(nml_doc, "AWCL", "100ms", "100ms", stim_amplitude, params)
c302.add_new_input(nml_doc, "AWCR", "500ms", "100ms", stim_amplitude, params)
nml_file = target_directory+'/'+reference+'.net.nml'
writers.NeuroMLWriter.write(nml_doc, nml_file) # Write over network file written above...
print("(Re)written network file to: "+nml_file)
return cells, cells_to_stimulate, params, [], nml_doc
if __name__ == '__main__':
parameter_set = sys.argv[1] if len(sys.argv)==2 else 'A'
setup(parameter_set, generate=True)