-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Cumulative XUV flux, but somehow tests are not passing
- Loading branch information
1 parent
fce9d47
commit 3baad6e
Showing
23 changed files
with
324 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
The "Cosmic Shoreline" | ||
========== | ||
|
||
Overview | ||
-------- | ||
|
||
A reproduction of Zahnle & Catling (2018)'s cosmic shoreline, | ||
a proposed boundary between planet with and without atmosphere. | ||
|
||
=================== ============ | ||
**Date** 09/12/2024 | ||
**Author** Rory Barnes | ||
**Modules** Atmesc, STELLAR | ||
**Approx. runtime** 10 seonds | ||
=================== ============ | ||
|
||
|
||
|
||
|
||
To run this example | ||
------------------- | ||
|
||
.. code-block:: bash | ||
python makeplot.py <pdf | png> | ||
Expected output | ||
--------------- | ||
|
||
.. figure:: CosmicShoreline.png | ||
:width: 100% | ||
:align: center | ||
|
||
The blue line is the cosmic shoreline and the blue points | ||
represent the Solar System planets. The Sun's XUV luminosity | ||
is assumed to follow the Ribas et al. (2005) model. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sName Earth | ||
saModules atmesc | ||
dMass 3.0018090452e-06 | ||
dRadius -1. | ||
dSemi 1.00000321 | ||
saOutputOrder Time -FXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sName George | ||
saModules atmesc | ||
dMass -14.54 | ||
dRadius -4.007 | ||
dSemi 19.19203990 | ||
saOutputOrder Time -fXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sName Jupiter | ||
saModules atmesc | ||
dMass -317.83 | ||
dRadius -11.2 | ||
dSemi 5.20880408 | ||
saOutputOrder Time -FXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import os | ||
import pathlib | ||
import subprocess | ||
import sys | ||
|
||
import matplotlib as mpl | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import vplot as vpl | ||
from matplotlib.ticker import MaxNLocator | ||
from mpl_toolkits.axes_grid1 import make_axes_locatable | ||
|
||
import vplanet | ||
|
||
path = pathlib.Path(__file__).parents[0].absolute() | ||
sys.path.insert(1, str(path.parents[0])) | ||
|
||
output = vplanet.run(units = False) | ||
|
||
# Plot! | ||
fig = plt.figure(figsize=(8.5, 6)) | ||
|
||
fxuv_earth = output.log.final.Earth.CumulativeFXUV | ||
|
||
fxuv = [] | ||
fxuv.append(output.log.final.Mercury.CumulativeFXUV/fxuv_earth) | ||
fxuv.append(output.log.final.Venus.CumulativeFXUV/fxuv_earth) | ||
fxuv.append(output.log.final.Earth.CumulativeFXUV/fxuv_earth) | ||
fxuv.append(output.log.final.Mars.CumulativeFXUV/fxuv_earth) | ||
fxuv.append(output.log.final.Jupiter.CumulativeFXUV/fxuv_earth) | ||
fxuv.append(output.log.final.Saturn.CumulativeFXUV/fxuv_earth) | ||
fxuv.append(output.log.final.George.CumulativeFXUV/fxuv_earth) | ||
fxuv.append(output.log.final.Neptune.CumulativeFXUV/fxuv_earth) | ||
|
||
escvel = [] | ||
escvel.append(output.log.final.Mercury.EscapeVelocity/1e3) | ||
escvel.append(output.log.final.Venus.EscapeVelocity/1e3) | ||
escvel.append(output.log.final.Earth.EscapeVelocity/1e3) | ||
escvel.append(output.log.final.Mars.EscapeVelocity/1e3) | ||
escvel.append(output.log.final.Jupiter.EscapeVelocity/1e3) | ||
escvel.append(output.log.final.Saturn.EscapeVelocity/1e3) | ||
escvel.append(output.log.final.George.EscapeVelocity/1e3) | ||
escvel.append(output.log.final.Neptune.EscapeVelocity/1e3) | ||
|
||
shorelinex = [] | ||
shorelinex.append(0.2) | ||
shorelinex.append(60) | ||
|
||
shoreliney = [] | ||
shoreliney.append(1e-6) | ||
shoreliney.append(1e4) | ||
|
||
plt.xlabel('Escape Velocity [km/s]') | ||
plt.ylabel('Normalized Cumulative XUV Flux') | ||
plt.plot(shorelinex,shoreliney,color=vpl.colors.pale_blue) | ||
plt.plot(escvel,fxuv,'o',color='k') | ||
plt.xscale('log') | ||
plt.yscale('log') | ||
plt.ylim(1e-6,1e4) | ||
plt.xlim(0.1,200) | ||
|
||
plt.annotate('Mercury',(2.7,9)) | ||
plt.annotate('Venus',(10.2,2.6)) | ||
plt.annotate('Earth',(11.5,0.5)) | ||
plt.annotate('Mars',(5,0.2)) | ||
plt.annotate('Jupiter',(60,0.05)) | ||
plt.annotate('Saturn',(37,0.014)) | ||
plt.annotate('Uranus',(22,0.0034)) | ||
plt.annotate('Neptune',(24,0.0006)) | ||
|
||
|
||
# Save figure | ||
fig.savefig(path / f"CosmicShoreline.png", bbox_inches="tight", dpi=200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sName Mars | ||
saModules atmesc | ||
dMass -0.107 | ||
dRadius -0.53202 | ||
dSemi 1.52366290 | ||
saOutputOrder Time -FXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sName Mercury | ||
saModules atmesc | ||
dMass -0.0553 | ||
dRadius -0.383 | ||
dSemi 0.38709897 | ||
saOutputOrder Time -FXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sName Neptune | ||
saModules atmesc | ||
dMass -17.15 | ||
dRadius -3.883 | ||
dSemi 30.07050641 | ||
saOutputOrder Time -FXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sName Saturn | ||
saModules atmesc | ||
dMass -95.16 | ||
dRadius -9.449 | ||
dSemi 9.53999265 | ||
saOutputOrder Time -FXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# The host star | ||
sName Sun # Body's name | ||
saModules stellar # Modules to apply, exact spelling required | ||
|
||
# Output | ||
saOutputOrder Age -Luminosity -LXUVStellar -Radius Temperature | ||
|
||
# Physical Parameters | ||
dMass 1.00 # Mass, solar masses | ||
dAge 5e7 | ||
dObliquity 0 | ||
dRotPeriod -30 # Rotation period, negative -> days | ||
dRadGyra 0.5 # Radius of gyration (moment of inertia constant) | ||
|
||
# STELLAR Parameters | ||
sStellarModel baraffe # Stellar evolution model: `baraffe` or `none` | ||
dSatXUVFrac 1.e-3 # Saturation level of the XUV luminosity | ||
dSatXUVTime -0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Planet a parameters | ||
sName Venus # Body's name | ||
saModules atmesc # Modules to apply, exact spelling required | ||
|
||
# Physical Properties | ||
dMass -0.815 # Mass, negative -> Earth masses | ||
dRadius -0.9499 # Radius, negative -> Earth radii | ||
dRotPeriod -243. # Rotation period, negative -> days | ||
dObliquity 180. # Retrograde rotation | ||
dRadGyra 0.5 # Radius of gyration (moment of inertia constant) | ||
|
||
# ATMESC Properties | ||
dXFrac 1.0 # X-Ray/XUV absorption radius (fraction of planet radius) | ||
dSurfWaterMass -3.0 # Initial surface water (Earth oceans) | ||
dEnvelopeMass 0 # Initial envelope mass (Earth masses) | ||
bHaltSurfaceDesiccated 0 # Halt when dry? | ||
bHaltEnvelopeGone 0 # Halt when evaporated? | ||
dMinSurfWaterMass -1.e-5 # Planet is desiccated when water content drops below this (Earth oceans) | ||
sWaterLossModel lbexact | ||
sPlanetRadiusModel none | ||
bInstantO2Sink 1 | ||
sAtmXAbsEffH2OModel bolmont16 | ||
|
||
# Orbital Properties | ||
dSemi -0.723 # Semi-major axis, negative -> AU | ||
dEcc 0.006772 # Eccentricity | ||
|
||
# Output | ||
saOutputOrder Time -FXUV -CumulativeFXUV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
sSystemName solarsystem # System Name | ||
iVerbose 5 # Verbosity level | ||
bOverwrite 1 # Allow file overwrites? | ||
|
||
# List of "body files" that contain body-specific parameters | ||
saBodyFiles sun.in mercury.in venus.in earth.in mars.in $ | ||
jupiter.in saturn.in george.in neptune.in | ||
|
||
# Input/Output Units | ||
sUnitMass solar # Options: gram, kg, Earth, Neptune, Jupiter, solar | ||
sUnitLength aU # Options: cm, m, km, Earth, Jupiter, solar, AU | ||
sUnitTime YEARS # Options: sec, day, year, Myr, Gyr | ||
sUnitAngle d # Options: deg, rad | ||
|
||
# Input/Output | ||
bDoLog 1 # Write a log file? | ||
iDigits 6 # Maximum number of digits to right of decimal | ||
dMinValue 1e-10 # Minimum value of eccentricity/obliquity | ||
|
||
# Evolution Parameters | ||
bDoForward 1 # Perform a forward evolution? | ||
bVarDt 1 # Use variable timestepping? | ||
dEta 0.01 # Coefficient for variable timestepping | ||
dStopTime 4.5e9 # Stop time for evolution | ||
dOutputTime 1e8 # Output timesteps (assuming in body files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.