Skip to content

Commit

Permalink
Added LuminosityCycle figure.
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryBarnes committed Feb 14, 2024
1 parent 4b89543 commit 5d83759
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
Binary file added examples/LuminosityCycle/LuminosityCycle.pdf
Binary file not shown.
43 changes: 43 additions & 0 deletions examples/LuminosityCycle/makeplot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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=600)
2 changes: 1 addition & 1 deletion examples/LuminosityCycle/none.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ sName none
saModules stellar
sStellarModel none
dMass 1
dRadius 0.00454
dRadius 0.00465
dLuminosity -1
saOutputOrder Time -Luminosity -Radius Temperature -RotPer -LXUVTot RadGyra
2 changes: 1 addition & 1 deletion examples/LuminosityCycle/sinewave.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sName sinewave
saModules stellar
sStellarModel sinewave
dMass 1
dRadius 0.00454
dRadius 0.00465
dLuminosity -1
dLuminosityAmplitude -0.1
dLuminosityPeriod -100
Expand Down
2 changes: 1 addition & 1 deletion examples/RadHeat/makeplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Run vplanet
out = vplanet.run(path / "vpl.in", units=False)

fig = plt.figure(figsize=(8.5, 8))
fig = plt.figure(figsize=(6.5, 8))
plt.subplot(2, 2, 1)
plt.plot(
out.earth.Time,
Expand Down

0 comments on commit 5d83759

Please sign in to comment.