Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63722691
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
Wed, May 22, 02:16
Size
1 KB
Mime Type
text/x-python
Expires
Fri, May 24, 02:16 (2 d)
Engine
blob
Format
Raw Data
Handle
17810716
Attached To
R4670 PySONIC (old)
run_estim.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Date: 2017-08-24 11:55:07
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2019-06-12 12:24:26
''' Run E-STIM simulations of a specific point-neuron. '''
import
matplotlib.pyplot
as
plt
from
PySONIC.core
import
Batch
from
PySONIC.utils
import
logger
from
PySONIC.plt
import
SchemePlot
from
PySONIC.parsers
import
EStimParser
def
main
():
# Parse command line arguments
parser
=
EStimParser
()
args
=
parser
.
parse
()
logger
.
setLevel
(
args
[
'loglevel'
])
# Run E-STIM batch
logger
.
info
(
"Starting E-STIM simulation batch"
)
pkl_filepaths
=
[]
for
pneuron
in
args
[
'neuron'
]:
queue
=
pneuron
.
simQueue
(
args
[
'amp'
],
args
[
'tstim'
],
args
[
'toffset'
],
args
[
'PRF'
],
args
[
'DC'
],
)
for
item
in
queue
:
item
.
insert
(
0
,
args
[
'outputdir'
])
batch
=
Batch
(
pneuron
.
runAndSave
,
queue
)
pkl_filepaths
+=
batch
(
mpi
=
args
[
'mpi'
],
loglevel
=
args
[
'loglevel'
])
# Plot resulting profiles
if
args
[
'plot'
]
is
not
None
:
SchemePlot
(
pkl_filepaths
,
pltscheme
=
parser
.
parsePltScheme
(
args
))()
plt
.
show
()
if
__name__
==
'__main__'
:
main
()
Event Timeline
Log In to Comment