Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63104838
run_estim.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 17, 19:41
Size
1 KB
Mime Type
text/x-python
Expires
Sun, May 19, 19:41 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17732677
Attached To
R4670 PySONIC (old)
run_estim.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Email: theo.lemaire@epfl.ch
# @Date: 2017-08-24 11:55:07
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2020-04-17 20:12:56
''' Run E-STIM simulations of a specific point-neuron. '''
from
PySONIC.core
import
Batch
,
PointNeuron
from
PySONIC.utils
import
logger
from
PySONIC.parsers
import
EStimParser
def
main
():
# Parse command line arguments
parser
=
EStimParser
()
args
=
parser
.
parse
()
logger
.
setLevel
(
args
[
'loglevel'
])
sim_inputs
=
parser
.
parseSimInputs
(
args
)
simQueue_func
=
{
5
:
'simQueue'
,
6
:
'simQueueBurst'
}[
len
(
sim_inputs
)]
# Run E-STIM batch
logger
.
info
(
"Starting E-STIM simulation batch"
)
queue
=
getattr
(
PointNeuron
,
simQueue_func
)(
*
sim_inputs
,
outputdir
=
args
[
'outputdir'
],
overwrite
=
args
[
'overwrite'
])
output
=
[]
for
pneuron
in
args
[
'neuron'
]:
batch
=
Batch
(
pneuron
.
simAndSave
if
args
[
'save'
]
else
pneuron
.
simulate
,
queue
)
output
+=
batch
(
mpi
=
args
[
'mpi'
],
loglevel
=
args
[
'loglevel'
])
# Plot resulting profiles
if
args
[
'plot'
]
is
not
None
:
parser
.
parsePlot
(
args
,
output
)
if
__name__
==
'__main__'
:
main
()
Event Timeline
Log In to Comment