Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Wei Ren
Waveform_Extractor
Commits
986386c2
Commit
986386c2
authored
Oct 21, 2017
by
Daniel Johnson
Browse files
Add end to plots
parent
e28530db
Changes
1
Show whitespace changes
Inline
Side-by-side
POWER/plot.py
View file @
986386c2
...
...
@@ -40,6 +40,7 @@ import numpy as np
import
matplotlib
import
matplotlib.pyplot
as
plt
import
sys
import
os
run_name
=
sys
.
argv
[
1
]
...
...
@@ -51,34 +52,43 @@ py_hplus = python_strain[:, 1]
py_phase
=
python_phase
[:,
1
]
py_amp
=
python_amp
[:,
1
]
cur_max_time
=
python_strain
[
0
][
0
]
cur_max_amp
=
abs
(
pow
(
python_strain
[
0
][
1
],
2
))
+
abs
(
pow
(
python_strain
[
0
][
2
],
2
))
for
i
in
python_strain
[:]:
cur_time
=
i
[
0
]
cur_amp
=
abs
(
pow
(
i
[
1
],
2
))
+
abs
(
pow
(
i
[
2
],
2
))
if
(
cur_amp
>
cur_max_amp
):
cur_max_amp
=
cur_amp
cur_max_time
=
cur_time
run_name_without_resolution
=
run_name
.
split
(
"_"
)[
0
]
matplotlib
.
rcParams
.
update
({
'font.size'
:
12
})
matplotlib
.
rcParams
.
update
({
'font.family'
:
'serif'
})
plt
.
title
(
run_name_without_resolution
)
plt
.
plot
(
py_t
,
py_hplus
)
plt
.
xlim
((
0
,
None
))
plt
.
xlim
((
0
,
cur_max_time
+
200
))
plt
.
ylabel
(
'${\mathfrak{R}} [h(t)]$'
)
plt
.
xlabel
(
'Time [M]'
)
plt
.
savefig
(
"./Extrapolated_Strain/"
+
run_name
+
"/strain_plot_l2_m2.png"
)
plt
.
savefig
(
"./Extrapolated_Strain/"
+
run_name
+
"/
"
+
run_name
+
"_
strain_plot_l2_m2.png"
)
plt
.
close
()
matplotlib
.
rcParams
.
update
({
'font.size'
:
12
})
matplotlib
.
rcParams
.
update
({
'font.family'
:
'serif'
})
plt
.
title
(
run_name_without_resolution
)
plt
.
plot
(
py_t
,
py_phase
)
plt
.
xlim
((
0
,
None
))
plt
.
xlim
((
0
,
cur_max_time
+
200
))
plt
.
ylabel
(
'Phase'
)
plt
.
xlabel
(
'Time [M]'
)
plt
.
savefig
(
"./Extrapolated_Strain/"
+
run_name
+
"/phase_plot_l2_m2.png"
)
plt
.
savefig
(
"./Extrapolated_Strain/"
+
run_name
+
"/
"
+
run_name
+
"_
phase_plot_l2_m2.png"
)
plt
.
close
()
matplotlib
.
rcParams
.
update
({
'font.size'
:
12
})
matplotlib
.
rcParams
.
update
({
'font.family'
:
'serif'
})
plt
.
title
(
run_name_without_resolution
)
plt
.
plot
(
py_t
,
py_amp
)
plt
.
xlim
((
0
,
None
))
plt
.
xlim
((
0
,
cur_max_time
+
200
))
plt
.
ylabel
(
'Amplitude'
)
plt
.
xlabel
(
'Time [M]'
)
plt
.
savefig
(
"./Extrapolated_Strain/"
+
run_name
+
"/amplitude_plot_l2_m2.png"
)
plt
.
savefig
(
"./Extrapolated_Strain/"
+
run_name
+
"/
"
+
run_name
+
"_
amplitude_plot_l2_m2.png"
)
plt
.
close
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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