Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81248679
ESTIM_batch.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, Sep 4, 23:22
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Sep 6, 23:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20392850
Attached To
R4670 PySONIC (old)
ESTIM_batch.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Date: 2017-08-24 11:55:07
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2018-03-15 15:36:58
""" Run batch electrical simulations of specific "point-neuron" models. """
import
sys
import
os
import
logging
import
numpy
as
np
from
PointNICE.utils
import
logger
,
InputError
from
PointNICE.solvers
import
setBatchDir
,
checkBatchLog
,
runEStimBatch
from
PointNICE.plt
import
plotBatch
# Set logging level
logger
.
setLevel
(
logging
.
INFO
)
# Neurons
neurons
=
[
'LeechP'
]
# Stimulation parameters
stim_params
=
{
'amps'
:
[
2.0
],
# mA/m2
'durations'
:
np
.
array
([
20
,
40
,
60
,
80
,
100
,
150
,
200
,
250
,
300
])
*
1e-3
,
# s
'PRFs'
:
np
.
array
([
0.1
,
0.2
,
0.5
,
1.0
,
2.0
,
5.0
,
10.0
])
*
1e3
,
# Hz
'DCs'
:
np
.
array
([
1
,
2
,
5
,
10
,
25
,
50
,
75
,
100
])
*
1e-2
}
stim_params
[
'offsets'
]
=
350e-3
-
stim_params
[
'durations'
]
# s
try
:
# Select output directory
batch_dir
=
setBatchDir
()
log_filepath
,
_
=
checkBatchLog
(
batch_dir
,
'E-STIM'
)
# Run E-STIM batch
pkl_filepaths
=
runEStimBatch
(
batch_dir
,
log_filepath
,
neurons
,
stim_params
)
pkl_dir
,
_
=
os
.
path
.
split
(
pkl_filepaths
[
0
])
# Plot resulting profiles
# plotBatch(pkl_dir, pkl_filepaths)
except
InputError
as
err
:
logger
.
error
(
err
)
sys
.
exit
(
1
)
Event Timeline
Log In to Comment