Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91459791
plot_rheobase_amps.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
Mon, Nov 11, 08:15
Size
1 KB
Mime Type
text/x-python
Expires
Wed, Nov 13, 08:15 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22266221
Attached To
R4670 PySONIC (old)
plot_rheobase_amps.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo
# @Date: 2018-04-30 21:06:10
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2018-05-08 14:41:56
''' Plot neuron-specific rheobase acoustic amplitudes for various duty cycles. '''
import
sys
import
logging
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
PointNICE.utils
import
logger
,
InputError
,
getNeuronsDict
,
si_format
from
PointNICE.solvers
import
SolverUS
# Set logging level
logger
.
setLevel
(
logging
.
INFO
)
# Set plot parameters
fs
=
15
# font size
ps
=
100
# scatter point size
lw
=
2
# linewidth
# Define input parameters
Fdrive
=
500e3
# Hz
a
=
32e-9
# m
DCs
=
np
.
arange
(
1
,
101
)
/
1e2
neurons
=
[
'RS'
,
'FS'
,
'LTS'
,
'RE'
,
'TC'
]
# Initialize figure
fig
,
ax
=
plt
.
subplots
()
ax
.
set_xlabel
(
'Duty cycle (%)'
,
fontsize
=
fs
)
ax
.
set_ylabel
(
'Rheobase amplitude (kPa)'
,
fontsize
=
fs
)
for
item
in
ax
.
get_xticklabels
()
+
ax
.
get_yticklabels
():
item
.
set_fontsize
(
fs
)
ax
.
set_yscale
(
'log'
)
ax
.
set_ylim
([
10
,
600
])
# Loop through neuron types
for
n
in
neurons
:
neuron
=
getNeuronsDict
()[
n
]()
try
:
# Find and plot rheobase amplitudes for duty cycles
solver
=
SolverUS
(
a
,
neuron
,
Fdrive
)
logger
.
info
(
'Computing
%s
neuron rheobase amplitudes at
%s
Hz'
,
neuron
.
name
,
si_format
(
Fdrive
))
Athrs
=
solver
.
findRheobaseAmps
(
neuron
,
Fdrive
,
DCs
,
neuron
.
VT
)
ax
.
plot
(
DCs
*
1e2
,
Athrs
*
1e-3
,
label
=
'{} neuron'
.
format
(
neuron
.
name
))
except
InputError
as
err
:
logger
.
error
(
err
)
sys
.
exit
(
1
)
ax
.
legend
()
fig
.
tight_layout
()
plt
.
show
()
Event Timeline
Log In to Comment