Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
5be6954f
Commit
5be6954f
authored
Jan 31, 2019
by
thomas.forbriger
Browse files
croposplot [WP]: test case produces lines in diagram
parent
60695137
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/python/visu/croposplot.py
View file @
5be6954f
...
...
@@ -87,7 +87,8 @@ def main(argv=None):
argv
=
sys
.
argv
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hvo:'
,
[
'help'
])
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hvo:g'
,
[
'help'
,
'nologlog'
,
'nologx'
,
'nology'
,
'grid'
])
except
getopt
.
GetoptError
as
err
:
print
(
err
.
msg
)
exit
(
0
)
...
...
@@ -96,6 +97,10 @@ def main(argv=None):
global
DEBUG
DEBUG
=
False
outfile
=
'x11'
nologlog
=
False
nologx
=
False
nology
=
False
grid
=
False
for
(
opt
,
arg
)
in
opts
:
if
opt
==
'-v'
:
...
...
@@ -104,6 +109,14 @@ def main(argv=None):
DEBUG
=
True
elif
opt
==
'-o'
:
outfile
=
arg
elif
opt
in
(
"-g"
,
"--grid"
):
grid
=
True
elif
opt
in
(
"--nologlog"
):
nologlog
=
True
elif
opt
in
(
"--nologx"
):
nologx
=
True
elif
opt
in
(
"--nology"
):
nology
=
True
elif
(
opt
==
'-h'
)
or
(
opt
==
'--help'
):
help
()
exit
(
0
)
...
...
@@ -124,11 +137,34 @@ def main(argv=None):
Figure
=
plt
.
figure
()
plt
.
grid
(
grid
)
# using logscale if desired
if
nologx
and
nology
:
nologlog
=
True
if
nology
and
not
nologlog
:
if
verbose
:
sys
.
stdout
.
write
(
"specplot: Using log scaling for x-axis ...
\n
"
)
plt
.
semilogx
()
elif
nologx
and
not
nologlog
:
if
verbose
:
sys
.
stdout
.
write
(
"specplot: Using log scaling for y-axis ...
\n
"
)
plt
.
semilogy
()
elif
not
nologlog
:
if
verbose
:
sys
.
stdout
.
write
(
"specplot: Using loglog scaling ...
\n
"
)
plt
.
loglog
()
else
:
if
verbose
:
sys
.
stdout
.
write
(
"specplot: Disable logscale ...
\n
"
)
for
specfile
in
args
:
if
verbose
:
print
(
'read file %s'
%
specfile
)
data
=
np
.
loadtxt
(
specfile
,
unpack
=
False
)
for
i
in
range
(
1
,
len
(
data
[
0
,:])
-
1
):
for
i
in
range
(
1
,
len
(
data
[
0
,:])):
if
verbose
:
print
(
'plot curve %d'
%
i
)
plt
.
plot
(
data
[:,
0
],
data
[:,
i
])
if
outfile
==
'x11'
:
...
...
src/ts/wf/testcases/Makefile.croposp
View file @
5be6954f
...
...
@@ -14,17 +14,20 @@
all
:
cpsd1.bin cpsd2.bin cpsd3.bin
CPSD_NSAMPLESRAW
=
10000
CPSD_NSAMPLESRAW
=
1000
#
CPSD_NSAMPLESRAW=1000
CPSD_DT
=
0.1
CPSD_DUR
=
8640.
CPSD_DUR
=
864.
#
CPSD_DUR=864.
# create raw time series
CPSD_SIGGENOPT
=
-v
-o
-n
$(CPSD_NSAMPLESRAW)
-d
$(CPSD_DT)
-T
$(CPSD_DUR)
-ot
bin
CPSD_AMP1
=
1.e-3
CPSD_AMP2
=
1.e-4
CPSD_AMP3
=
3.e-3
CPSD_AMPBG
=
4.
CPSD_AMPBG
=
4.e-5
# location of plot tool
CROPOSPLOT
=
../../../python/visu/croposplot.py
cpsd1raw.bin
:
siggenx 12
$@
$(CPSD_SIGGENOPT)
-a
$(CPSD_AMP1)
...
...
@@ -84,6 +87,12 @@ cpsd3.bin: cpsd3hd.bin
psd.xxx
:
cpsd1.bin cpsd2.bin cpsd3.bin
croposp
--DEBUG
--verbose
--overwrite
--itype
bin
--trim
\
--log
10
\
--datetolerance
0.1
-psd
$@
$^
psd.pdf
:
psd.xxx
$(CROPOSPLOT)
-v
--grid
-o
$@
$<
%.pdp
:
%.pdf; evince $<; /bin/rm -fv $<
# ----- END OF Makefile.croposp -----
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment