Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81249851
ASTIM_lookups.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:32
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Sep 6, 23:32 (2 d)
Engine
blob
Format
Raw Data
Handle
20536884
Attached To
R4670 PySONIC (old)
ASTIM_lookups.py
View Options
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Date: 2017-06-02 17:50:10
# @Email: theo.lemaire@epfl.ch
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2018-03-15 16:20:17
""" Create lookup tables for different acoustic frequencies. """
import
logging
import
numpy
as
np
import
PointNICE
from
PointNICE.utils
import
logger
,
InputError
from
PointNICE.neurons
import
*
# Set logging level
logger
.
setLevel
(
logging
.
INFO
)
# BLS diameter (m)
a
=
32e-9
# Channel mechanisms
neurons
=
[
CorticalRS
()]
# Stimulation parameters
freqs
=
np
.
array
([
20.
,
100.
,
500.
,
1000.
,
2000.
,
3000.
,
4000.
])
*
1e3
# Hz
amps
=
np
.
logspace
(
np
.
log10
(
0.1
),
np
.
log10
(
600
),
num
=
50
)
*
1e3
# Pa
amps
=
np
.
insert
(
amps
,
0
,
0.0
)
# adding amplitude 0
logger
.
info
(
'Starting batch lookup creation'
)
for
neuron
in
neurons
:
# Create a SolverUS instance (with dummy frequency parameter)
solver
=
PointNICE
.
SolverUS
(
a
,
neuron
,
0.0
)
# Create lookup file
try
:
solver
.
createLookup
(
neuron
,
freqs
,
amps
)
logger
.
info
(
'
%s
Lookup table successfully created'
,
neuron
.
name
)
except
InputError
as
err
:
logger
.
error
(
err
)
Event Timeline
Log In to Comment