Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81247949
ASTIM_titration_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:15
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Sep 6, 23:15 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20392849
Attached To
R4670 PySONIC (old)
ASTIM_titration_batch.py
View Options
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Date: 2017-02-13 18:16:09
# @Email: theo.lemaire@epfl.ch
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2018-03-15 17:03:43
""" Run batch acoustic titrations 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
,
titrateAStimBatch
from
PointNICE.plt
import
plotBatch
# Set logging level
logger
.
setLevel
(
logging
.
DEBUG
)
# Channels mechanisms
neurons
=
[
'RS'
]
# Stimulation parameters
stim_params
=
{
'freqs'
:
[
5e5
],
# Hz
# 'amps': [100e3], # Pa
'durations'
:
[
100e-3
],
# s
'PRFs'
:
[
1e2
],
# Hz
'DCs'
:
[
1.0
,
0.05
]
}
try
:
# Select output directory
batch_dir
=
setBatchDir
()
log_filepath
,
_
=
checkBatchLog
(
batch_dir
,
'A-STIM'
)
# Run titration batch
pkl_filepaths
=
titrateAStimBatch
(
batch_dir
,
log_filepath
,
neurons
,
stim_params
)
pkl_dir
,
_
=
os
.
path
.
split
(
pkl_filepaths
[
0
])
# Plot resulting profiles
plotBatch
(
pkl_dir
,
pkl_filepaths
,
{
'Q_m'
:
[
'Qm'
]})
except
InputError
as
err
:
logger
.
error
(
err
)
sys
.
exit
(
1
)
Event Timeline
Log In to Comment