Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64585868
plot_effective_variables.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, May 27, 23:32
Size
1 KB
Mime Type
text/x-python
Expires
Wed, May 29, 23:32 (2 d)
Engine
blob
Format
Raw Data
Handle
17928240
Attached To
R4670 PySONIC (old)
plot_effective_variables.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Email: theo.lemaire@epfl.ch
# @Date: 2017-02-15 15:59:37
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2020-02-03 21:21:58
''' Plot the effective variables as a function of charge density with color code. '''
import
numpy
as
np
import
logging
import
matplotlib.pyplot
as
plt
from
PySONIC.plt
import
plotEffectiveVariables
from
PySONIC.utils
import
logger
from
PySONIC.parsers
import
MechSimParser
# Set logging level
logger
.
setLevel
(
logging
.
INFO
)
def
main
():
parser
=
MechSimParser
()
parser
.
addNeuron
()
parser
.
addNColumns
()
parser
.
addNLevels
()
parser
.
defaults
[
'neuron'
]
=
'RS'
parser
.
defaults
[
'radius'
]
=
np
.
nan
parser
.
defaults
[
'freq'
]
=
np
.
nan
parser
.
defaults
[
'amp'
]
=
np
.
nan
args
=
parser
.
parse
()
for
k
in
[
'charge'
,
'embedding'
,
'Cm0'
,
'Qm0'
,
'fs'
,
'mpi'
,
'pltscheme'
,
'plot'
]:
del
args
[
k
]
logger
.
setLevel
(
args
[
'loglevel'
])
# Restrict radius, frequency and amplitude to single values
for
k
in
[
'radius'
,
'freq'
,
'amp'
]:
if
len
(
args
[
k
])
>
1
:
logger
.
error
(
f
'multiple {k} values not allowed'
)
val
=
args
[
k
][
0
]
if
np
.
isnan
(
val
):
args
[
k
]
=
None
else
:
args
[
k
]
=
val
for
pneuron
in
args
[
'neuron'
]:
plotEffectiveVariables
(
pneuron
,
a
=
args
[
'radius'
],
f
=
args
[
'freq'
],
A
=
args
[
'amp'
],
zscale
=
args
[
'cscale'
],
cmap
=
args
[
'cmap'
],
ncolmax
=
args
[
'ncol'
],
nlevels
=
args
[
'nlevels'
])
plt
.
show
()
if
__name__
==
'__main__'
:
main
()
Event Timeline
Log In to Comment