Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92066716
plot_timeseries.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
Sun, Nov 17, 02:03
Size
1 KB
Mime Type
text/x-python
Expires
Tue, Nov 19, 02:03 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22370811
Attached To
R4670 PySONIC (old)
plot_timeseries.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Email: theo.lemaire@epfl.ch
# @Date: 2017-02-13 12:41:26
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2019-06-15 19:13:46
''' Plot temporal profiles of specific simulation output variables. '''
import
matplotlib.pyplot
as
plt
from
PySONIC.utils
import
logger
from
PySONIC.plt
import
ComparativePlot
,
SchemePlot
from
PySONIC.parsers
import
Parser
def
main
():
# Parse command line arguments
parser
=
Parser
()
parser
.
addHideOutput
()
parser
.
addInputFiles
()
parser
.
addOutputDir
(
dep_key
=
'save'
)
parser
.
addCompare
()
parser
.
addSave
()
parser
.
addFigureExtension
()
parser
.
addSamplingRate
()
parser
.
addSpikes
()
parser
.
addPatches
()
parser
.
addCmap
()
parser
.
addCscale
()
args
=
parser
.
parse
()
logger
.
setLevel
(
args
[
'loglevel'
])
# Plot appropriate graph
if
args
[
'compare'
]:
if
args
[
'plot'
]
==
[
'all'
]
or
args
[
'plot'
]
is
None
:
logger
.
error
(
'Specific variables must be specified for comparative plots'
)
return
for
pltvar
in
args
[
'plot'
]:
try
:
comp_plot
=
ComparativePlot
(
args
[
'inputfiles'
],
pltvar
)
comp_plot
.
render
(
spikes
=
args
[
'spikes'
],
frequency
=
args
[
'sr'
],
patches
=
args
[
'patches'
],
cmap
=
args
[
'cmap'
],
cscale
=
args
[
'cscale'
])
except
KeyError
as
e
:
logger
.
error
(
e
)
return
else
:
scheme_plot
=
SchemePlot
(
args
[
'inputfiles'
],
pltscheme
=
args
[
'pltscheme'
])
scheme_plot
.
render
(
title
=
True
,
save
=
args
[
'save'
],
directory
=
args
[
'outputdir'
],
fig_ext
=
args
[
'figext'
],
spikes
=
args
[
'spikes'
],
frequency
=
args
[
'sr'
])
if
not
args
[
'hide'
]:
plt
.
show
()
if
__name__
==
'__main__'
:
main
()
Event Timeline
Log In to Comment