コード例 #1
0
ファイル: test_stellar.py プロジェクト: decaelus/vplanet
def test_stellar():
    """Test the stellar module."""
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.a.Luminosity, 0.000869)
    assert np.isclose(output.log.final.a.Temperature, 2811.000999)
    assert np.isclose(output.log.final.a.Radius, 0.124)
    assert np.isclose(output.log.final.a.LostAngMom, 1.290268e+40,
                      rtol=1e-3)
    assert np.isclose(output.log.final.a.RotPer, 1.921597, rtol=1e-3)
    assert np.isclose(output.log.final.b.Luminosity, 1.022389)
    assert np.isclose(output.log.final.b.Temperature, 5730.995418)
    assert np.isclose(output.log.final.b.Radius, 1.026571)
    assert np.isclose(output.log.final.b.LostAngMom, 1.648878e+43,
                      rtol=1e-3)
    assert np.isclose(output.log.final.b.RotPer, 23.680862, rtol=1e-3)
    assert np.isclose(output.log.final.system.TotAngMom, 1.729433e+43,
                      rtol=1e-3)
    assert np.isclose(output.log.final.system.TotEnergy, -2.468221e+41,
                      rtol=1e-3)
コード例 #2
0
ファイル: test_AbioticO2.py プロジェクト: trentagon/vplanet
def test_AbioticO2():
    """Test oxygen build up, HZ limits."""
    # Remove old log file
    subprocess.run(['rm', 'AbioticO2.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Primary Variables
    # Star
    assert np.isclose(output.log.final.star.Luminosity, 7.362835e+23)
    assert np.isclose(output.log.final.star.LXUVStellar, 7.362835e+20)
    assert np.isclose(output.log.final.star.Radius, 1.186502e+08)
    assert np.isclose(output.log.final.star.Temperature, 2926.556751)
    assert np.isclose(output.log.final.star.RadGyra, 0.466090)

    # Planet b -- checks high XUV flux environment
    assert np.isclose(output.log.final.b.SurfWaterMass, 4.187987, rtol=1e-4)
    assert np.isclose(output.log.final.b.OxygenMass, 251.127387, rtol=1e-4)

    # Planet e -- checks low XUV flux environment
    assert np.isclose(output.log.final.e.SurfWaterMass, 7.511356, rtol=1e-4)
    assert np.isclose(output.log.final.e.OxygenMass, 420.619083)

    # Other checks
    assert np.isclose(output.log.final.e.FXUV, 3.053257)
    assert np.isclose(output.log.final.e.AtmXAbsEffH2O, 0.051776)
    assert np.isclose(output.log.final.e.Instellation, 3053.257033)
コード例 #3
0
def test_CassiniMulti():
    """Test multiple planets damping into Cassini states."""
    # Remove old log file
    subprocess.run(['rm', 'TGard.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    # Star
    assert np.isclose(output.log.final.TGstar.Radius, 0.878726)
    assert np.isclose(output.log.final.TGstar.RadGyra, 0.445942)
    assert np.isclose(output.log.final.TGstar.RotVel, 296.385042)
    assert np.isclose(output.log.final.TGstar.EqRotRate, 1.407733e-05)
    assert np.isclose(output.log.final.TGstar.LXUVStellar, 1.880010e+22)
    # Planet b
    assert np.isclose(output.log.final.TGb.Instellation, 1.058375e+05)
    assert np.isclose(output.log.final.TGb.Yobl, -0.149030)
    assert np.isclose(output.log.final.TGb.Zobl, 0.856552)
    assert np.isclose(output.log.final.TGb.HEcc, 0.091315)
    assert np.isclose(output.log.final.TGb.KEcc, -0.048856)
    assert np.isclose(output.log.final.TGb.RotRate, 6.843648e-05)
    assert np.isclose(output.log.final.TGb.SemiMajorAxis, 3.769868e+09)
    assert np.isclose(output.log.final.TGb.OrbPotEnergy, -1.766030e+34)
    assert np.isclose(output.log.final.TGb.SemiTimeEqtide, 7.942139e+15)
    assert np.isclose(output.log.final.TGb.DXoblDtEqtide, -3.658103e-12)
    # Planet c
    assert np.isclose(output.log.final.TGc.Sinc, 0.037712)
    assert np.isclose(output.log.final.TGc.ArgP, 3.924108)
    assert np.isclose(output.log.final.TGc.PrecA, 2.477072)
    assert np.isclose(output.log.final.TGc.CassiniOne, 0.959339)
    assert np.isclose(output.log.final.TGc.CassiniTwo, 0.282255)
コード例 #4
0
def test_ChaoticResonances():
    """Test Chaotic Resoannces."""
    # Remove old log file
    subprocess.run(['rm', 'ChaosRes.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.earth.PositionXSpiNBody,
                      -1.0910217698713353e+11)
    assert np.isclose(output.log.final.earth.VelZSpiNBody,
                      1.2959382255760662e+04)
    assert np.isclose(output.log.final.earth.Inc, 0.7616663331648603)
    assert np.isclose(output.log.final.earth.MeanMotion,
                      1.9912661532603589e-07)
    assert np.isclose(output.log.final.outer.PositionYSpiNBody,
                      2.0247776958475812e+11)
    assert np.isclose(output.log.final.outer.VelXSpiNBody,
                      -1.1620721010188581e+04)
    assert np.isclose(output.log.final.outer.ArgP, 1.7362790073768690)
    assert np.isclose(output.log.final.outer.SemiMajorAxis,
                      3.1118441456657074e+11)
コード例 #5
0
def test_CassiniStates():
    """Test the coupling between eqtide, distorb and distrot."""
    # Remove old log file
    subprocess.run(['rm', 'CassiniStates.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    # Primary Variables
    assert np.isclose(output.log.final.b.Xobl, -0.706488)
    assert np.isclose(output.log.final.b.Yobl, 0.046974)
    assert np.isclose(output.log.final.b.Zobl, 0.706164)
    assert np.isclose(output.log.final.b.HEcc, -0.062959)
    assert np.isclose(output.log.final.b.KEcc, 0.010774)
    assert np.isclose(output.log.final.b.RotRate, 7.270645e-05)
    assert np.isclose(output.log.final.b.SemiMajorAxis, 1.869973e+10)

    # Other checks
    assert np.isclose(output.log.final.b.Inc, 0.008680)
    assert np.isclose(output.log.final.b.ArgP, 4.733145)
    assert np.isclose(output.log.final.b.LongA, 0.148731)
    assert np.isclose(output.log.final.b.Obliquity, 0.786733)
    assert np.isclose(output.log.final.b.PrecA, 3.075203)
    assert np.isclose(output.log.final.b.RotAngMom, 4.415998e+33)
    assert np.isclose(output.log.final.b.RotKinEnergy, 1.605358e+29)
    assert np.isclose(output.log.final.c.Inc, 8.069275e-05)
    assert np.isclose(output.log.final.c.ArgP, 4.653590)
    assert np.isclose(output.log.final.c.LongA, 1.580510)
コード例 #6
0
def test_MagneticBraking():
    """Test the stellar module."""
    # Remove old log file
    subprocess.run(['rm', 'system.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check

    # Confirm
    assert np.isclose(output.log.final.matt.RotPer, 0.252432)
    assert np.isclose(output.log.final.reiners.RotPer, 1.059182)
    assert np.isclose(output.log.final.sk.RotPer, 1.486450)

    # Energy
    Einit = output.log.initial.system.TotEnergy
    Efinal = output.log.initial.system.TotEnergy

    # Angular momentum
    Linit = output.log.initial.system.TotAngMom
    Lfinal = output.log.final.system.TotAngMom

    # Check conservation
    assert np.isclose(Einit, Efinal, rtol=1e-3)
    assert np.isclose(Linit, Lfinal, rtol=1e-3)
コード例 #7
0
ファイル: test_SS_SpiNBody.py プロジェクト: trentagon/vplanet
def test_SS_SpiNBody():
    """Test NBody Evolution."""
    # Remove old log file
    subprocess.run(['rm', 'SpiNBody.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.Star.PositionXSpiNBody,
                      -7.2996045904859365e+05)
    assert np.isclose(output.log.final.Star.VelZSpiNBody, -0.0074053658185989)
    assert np.isclose(output.log.final.Mercury.Inc, 0.1222430915966078)
    assert np.isclose(output.log.final.Mercury.VelXSpiNBody,
                      -5.6172614113858515e+04)
    assert np.isclose(output.log.final.Venus.ArgP, 0.9555745288739304)
    assert np.isclose(output.log.final.Venus.PositionXSpiNBody,
                      1.0815757150556880e+11)
    assert np.isclose(output.log.final.Earth.LongA, 6.0858921788484137)
    assert np.isclose(output.log.final.Earth.VelZSpiNBody,
                      1751.8263488484312802)
    assert np.isclose(output.log.final.Mars.SemiMajorAxis,
                      2.2794298912149789e+11)
    assert np.isclose(output.log.final.Mars.PositionYSpiNBody,
                      -1.9293056341095392e+11)
コード例 #8
0
def test_ApseLock():
    """Test module Eqtide-Distorb coupling."""
    # Remove old log file
    subprocess.run(['rm', 'ApseLock.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Checks
    # Primary Variables
    assert np.isclose(output.log.final.b.HEcc, -0.042671)
    assert np.isclose(output.log.final.b.KEcc, -0.069231)
    assert np.isclose(output.log.final.b.DHEccDtEqtide, 2.269581e-15)
    assert np.isclose(output.log.final.b.DKEccDtEqtide, 3.682246e-15)
    assert np.isclose(output.log.final.b.DHeccDtDistOrb, -2.488505e-11)
    assert np.isclose(output.log.final.b.DKeccDtDistOrb, -1.344098e-11)
    assert np.isclose(output.log.final.c.SemiMajorAxis, 6.911428e+09)

    # Other Checks
    assert np.isclose(output.log.final.b.Eccentricity, 0.081326)
    assert np.isclose(output.log.final.b.ArgP, 3.693953)
    assert np.isclose(output.log.final.b.SemiMajorAxis, 2.812439e+09)
    assert np.isclose(output.log.final.c.Eccentricity, 0.193811)
    assert np.isclose(output.log.final.c.ArgP, 5.015526)
    assert np.isclose(output.log.final.c.SemiMajorAxis, 6.911428e+09)
コード例 #9
0
def test_stellar_atmesc():
    """Test the coupling between stellar and atmesc."""
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.star.Luminosity, 0.000868847)
    assert np.isclose(output.log.final.star.LXUVFrac, 5.8884365536e-05)
    assert np.isclose(output.log.final.a.EnvelopeMass, 5.9695893469e+23)
コード例 #10
0
ファイル: test_TideLockCTL.py プロジェクト: trentagon/vplanet
def test_TideLockCTL():
    """Test tidal locking in the EqTide-TPL model."""
    # Remove old log file
    subprocess.run(['rm', 'gl581.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.d.RotPer, 34.706)
    assert np.isclose(output.log.final.d.Obliquity, 0.0133141669439806)
コード例 #11
0
def test_radheat_thermint():
    """Test the coupling between radheat and thermint."""
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.earth.TMan, 2256.1804)
    assert np.isclose(output.log.final.earth.TCore, 5009.8424)
    assert np.isclose(output.log.final.earth.RadPowerTotal, 24.2630e12)
    assert np.isclose(output.log.final.earth.MagMom, 0.994634)
コード例 #12
0
ファイル: test_eqtide.py プロジェクト: decaelus/vplanet
def test_eqtide():
    """Test the tidal evolution module."""
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.star.RotPer, 94.197975)
    assert np.isclose(output.log.final.d.RotPer, 43.28407)
    assert np.isclose(output.log.final.d.Obliquity, 3.337686e-07)
    assert np.isclose(output.log.final.d.Eccentricity, 0.380001)
    assert np.isclose(output.log.final.d.SemiMajorAxis, 32682710000.0)
コード例 #13
0
def test_AtmEscKepler36():
    """Test hydrogen envelope loss."""
    # Remove old log file
    subprocess.run(['rm', 'kepler36.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.star.LXUVStellar, 3.120390e+21)
    assert np.isclose(output.log.final.p10.EnvelopeMass, 3.314569)
    assert np.isclose(output.log.final.p10.Radius, 3.376736e+07)
コード例 #14
0
def test_WaterLossCPL():
    """Test the loss of water on planet tidally evolving via the CPL model."""
    # Remove old log file
    subprocess.run(['rm', 'WaterCPL.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.b.OrbPeriod, 3.943855e+05)
    assert np.isclose(output.log.final.b.Eccentricity, 0.099247)
    assert np.isclose(output.log.final.b.SurfWaterMass, 9.974648)
コード例 #15
0
def test_binary_eqtide_stellar():
    """Test the coupling between binary, eqtide, and stellar."""
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.cbp.FreeEcc, 0.03)
    assert np.isclose(output.log.final.cbp.Eccentricity, 0.049913)
    assert np.isclose(output.log.final.cbp.SemiMajorAxis, 106419600000.0)
    assert np.isclose(output.log.final.secondary.Eccentricity, 0.16048)
    assert np.isclose(output.log.final.secondary.SemiMajorAxis, 33554800000.0)
コード例 #16
0
def test_VenusWaterLoss():
    """Test the loss of water on Venus."""
    # Remove old log file
    subprocess.run(['rm', 'solarsystem.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.sun.LXUVStellar, 0.000427)
    assert np.isclose(output.log.final.venus.SurfWaterMass,
                      0.919493,
                      rtol=1e-4)
コード例 #17
0
def test_GalaxyEffects():
    """Test Galactic Effects."""
    # Remove old log file
    subprocess.run(['rm', 'GalEffects.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.comp.SemiMajorAxis, 1.4959787070e+15)
    assert np.isclose(output.log.final.comp.Eccentricity, 0.7052434592)
    assert np.isclose(output.log.final.comp.PeriQ, 4.4094950872e+14)
    assert np.isclose(output.log.final.comp.Inc, 1.3949755231)
コード例 #18
0
def test_IoHeat():
    """Test module eqtide, and simulations with no integrations."""
    # Remove old log file
    subprocess.run(['rm', 'ioheat.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.initial.io.PowerEqtide, 9.380954e+13)
    assert np.isclose(output.log.initial.io.SurfEnFluxEqtide, 2.243481)
    assert np.isclose(output.log.initial.io.DsemiDtEqtide, -1.671102e-09)
    assert np.isclose(output.log.initial.io.DeccDtEqtide, -8.503575e-16)
    assert np.isclose(output.log.initial.io.DOblDtEqtide, -3.792877e-13)
コード例 #19
0
def test_HZSingle():
    """Test the HZ limits for a single star."""
    # Remove old log file
    subprocess.run(['rm', 'star.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.initial.a.HZLimRecVenus, 2.879712e+10)
    assert np.isclose(output.log.initial.a.HZLimEarlyMars, 7.969376e+10)
    assert np.isclose(output.log.initial.a.HZLimRunaway, 3.790332e+10)
    assert np.isclose(output.log.initial.a.HZLimMoistGreenhouse, 3.810337e+10)
    assert np.isclose(output.log.initial.a.HZLimMaxGreenhouse, 7.307316e+10)
コード例 #20
0
def test_CircumbinaryOrbit():
    """Test module Circumbinary planet orbital evolution."""
    # Remove old log file
    subprocess.run(['rm', 'kepler16.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.cbp.FreeEcc, 0.03)
    assert np.isclose(output.log.final.cbp.Eccentricity, 0.065653)
    assert np.isclose(output.log.final.cbp.SemiMajorAxis, 1.046162e+11)
    assert np.isclose(output.log.final.secondary.Eccentricity, 0.16048)
    assert np.isclose(output.log.final.secondary.SemiMajorAxis, 3.351740e+10)
コード例 #21
0
ファイル: test_STEEP_CBP.py プロジェクト: silky/vplanet
def test_SteepCBP():
    """Test STEEP effect on a circumbinary planet (Fleming et al., 2018, ApJ, 858, 86)."""
    # Remove old log file
    subprocess.run(['rm', 'bin_eq_st.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.cbp.FreeEcc, 0.03)
    assert np.isclose(output.log.final.cbp.Eccentricity, 0.049913)
    assert np.isclose(output.log.final.cbp.SemiMajorAxis, 106419600000.0)
    assert np.isclose(output.log.final.secondary.Eccentricity, 0.16048)
    assert np.isclose(output.log.final.secondary.SemiMajorAxis, 33554800000.0)
コード例 #22
0
def test_EarthInterior():
    """Test the coupling between radheat and thermint."""
    # Remove old log file
    subprocess.run(['rm', 'earth.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.earth.TMan[-1], 2257.8509)
    assert np.isclose(output.earth.TCore[-1], 4999.1318)
    assert np.isclose(output.earth.RIC[-1], 1224.7839)
    assert np.isclose(output.earth.RadPowerTotal[-1], 24.3829)
    assert np.isclose(output.earth.MagMom[-1], 1.009593)
コード例 #23
0
ファイル: test_RadHeat.py プロジェクト: trentagon/vplanet
def test_RadHeat():
    """Test RadHeat."""
    # Remove old log file
    subprocess.run(['rm', 'earth.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.earth._40KPowerCrust, 1.168067)
    assert np.isclose(output.log.final.earth._232ThMassCore, 4.182962e+15)
    assert np.isclose(output.log.final.earth._235UPowerMan, 0.240654)
    assert np.isclose(output.log.final.earth._232ThNumCrust, 2.859381e+41)
    assert np.isclose(output.log.final.earth.SurfEnFluxRadTotal, 0.047491)
コード例 #24
0
def test_VenusInterior():
    """Test the coupling between radheat and thermint under stagnant lid conditions."""
    # Remove old log file
    subprocess.run(['rm', 'venus.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.venus.TMan, 2679.27122)
    assert np.isclose(output.log.final.venus.TCore, 6365.71258)
    assert np.isclose(output.log.final.venus.RIC, 0.0)
    assert np.isclose(output.log.final.venus.RadPowerTotal, 31.49126)
    assert np.isclose(output.log.final.venus.MagMom, 0.0)
コード例 #25
0
def test_HZSingle():
    """Test the HZ limits for a single star."""
    # Remove old log file
    subprocess.run(['rm', 'star.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.a.HZLimRecVenus, 6.038467e+09)
    assert np.isclose(output.log.final.a.HZLimEarlyMars, 1.669770e+10)
    assert np.isclose(output.log.final.a.HZLimRunaway, 7.949225e+09)
    assert np.isclose(output.log.final.a.HZLimMoistGreenhouse, 7.989892e+09)
    assert np.isclose(output.log.final.a.HZLimMaxGreenhouse, 1.531054e+10)
コード例 #26
0
ファイル: test_TidalEarth.py プロジェクト: silky/vplanet
def test_TidalEarth():
    """Test the coupling between radheat, thermint, and eqtide."""
    # Remove old log file
    subprocess.run(['rm', 'tidalearth.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.tidalearth.TMan, 2799.517833)
    assert np.isclose(output.log.final.tidalearth.TCore, 5500.224551)
    assert np.isclose(output.log.final.tidalearth.PowerEqtide, 0.005250)
    assert np.isclose(output.log.final.tidalearth.Eccentricity, 0.498425)
    assert np.isclose(output.log.final.tidalearth.SemiMajorAxis, 7.468143e+09)
コード例 #27
0
def test_AtmEscKepler36():
    """Test hydrogen envelope loss."""
    # Remove old log file
    subprocess.run(['rm', 'AtmEscKepler-36.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.star.LXUVStellar, 3.120390e+21)
    assert np.isclose(output.log.final.b.EnvelopeMass, 0)
    assert np.isclose(output.log.final.b.Radius, 6.324093e+06)
    assert np.isclose(output.log.final.c.EnvelopeMass, 3.972871)
    assert np.isclose(output.log.final.c.Radius, 3.591011e+07)
コード例 #28
0
def test_WaterLossCTL():
    """Test the loss of water on planet tidally evolving via the CTL model."""
    # Remove old log file
    subprocess.run(['rm', 'WaterCTL.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Check
    assert np.isclose(output.log.final.b.MeanMotion, 1.592839e-05)
    assert np.isclose(output.log.final.b.Eccentricity, 0.099920)
    assert np.isclose(output.log.final.b.SurfWaterMass, 8.974649)
    assert np.isclose(output.log.final.b.OxygenMass, 5.192614)
    assert np.isclose(output.log.final.b.XO, 0.333876)
    assert np.isclose(output.log.final.b.EtaO, 0.135210)
コード例 #29
0
ファイル: test_ApseLock.py プロジェクト: silky/vplanet
def test_ApseLock():
    """Test module Eqtide-Distorb coupling."""
    # Remove old log file
    subprocess.run(['rm', 'ApseLock.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.b.Eccentricity, 0.081326)
    assert np.isclose(output.log.final.b.ArgP, 3.693953)
    assert np.isclose(output.log.final.b.SemiMajorAxis, 2.812439e+09)
    assert np.isclose(output.log.final.c.Eccentricity, 0.193811)
    assert np.isclose(output.log.final.c.ArgP, 5.015526)
    assert np.isclose(output.log.final.c.SemiMajorAxis, 6.911428e+09)
コード例 #30
0
def test_SteepCBPCPL():
    """Test STEEP effect on a circumbinary planet (Fleming et al., 2018, ApJ, 858, 86)."""
    # Remove old log file
    subprocess.run(['rm', 'STEEP_CPL.log'], cwd=cwd)
    # Run vplanet
    subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)

    # Grab the output
    output = GetOutput(path=cwd)

    # Run our comparisons
    assert np.isclose(output.log.final.cbp.FreeEcc, 0.030000)
    assert np.isclose(output.log.final.cbp.Eccentricity, 0.030249)
    assert np.isclose(output.log.final.cbp.SemiMajorAxis, 1.052219e+11)
    assert np.isclose(output.log.final.secondary.Eccentricity, 0.194791)
    assert np.isclose(output.log.final.secondary.SemiMajorAxis, 0.072294)
    assert np.isclose(output.log.final.secondary.CriticalSemiMajorAxis, 0.211427)