-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathmakeplot.py
43 lines (36 loc) · 1.01 KB
/
makeplot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pathlib
import sys
import matplotlib.pyplot as plt
import vplot
import vplanet
# Path hacks
path = pathlib.Path(__file__).parents[0].absolute()
sys.path.insert(1, str(path.parents[0]))
from get_args import get_args
# Run vplanet
out = vplanet.run(path / "vpl.in", units=False)
fig = plt.figure(figsize=(6.5, 8))
plt.subplot(2, 1, 1)
plt.plot(
out.sinewave.Time,
out.sinewave.Luminosity,
color=vplot.colors.red,
label="SineWave",
)
plt.plot(
out.none.Time,
out.none.Luminosity,
color=vplot.colors.pale_blue,
label="None",
)
plt.legend(loc="best", title="Stellar Model")
plt.ylabel(r"Luminosity (L$_\odot$)")
plt.xlabel("Time (yr)")
plt.subplot(2, 1, 2)
plt.plot(out.sinewave.Time, out.sinewave.Temperature, color=vplot.colors.red)
plt.plot(out.none.Time, out.none.Temperature, color=vplot.colors.pale_blue)
plt.ylabel("Effective Temperature (K)")
plt.xlabel("Time (yr)")
# Save the figure
ext = get_args().ext
fig.savefig(path / f"LuminosityCycle.{ext}", bbox_inches="tight", dpi=300)