Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run janus #54

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/janus/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .socrates import CleanOutputDir

# Stellar Spectrum utilities
from .StellarSpectrum import InsertStellarSpectrum
from .StellarSpectrum import InsertStellarSpectrum, PrepareStellarSpectrum

# Read spectral file
from .ReadSpectralFile import ReadBandEdges
Expand Down
31 changes: 29 additions & 2 deletions src/janus/utils/atmosphere_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,37 @@ def from_file(atm, file: str, band_edges: list, vol_mixing: dict = {}, vol_parti

def setSurfaceTemperature(self, Tsurf: float):

self.ts = Tsurf
self.tmp[0] = Tsurf
self.ts = Tsurf
self.tmp[0] = Tsurf
self.tmpl[0] = Tsurf

def setSurfacePressure(self, Psurf: float):

self.ps = Psurf
self.p[0] = Psurf
self.pl[0] = Psurf

def setPlanetProperties(self, pl_radius:float, pl_mass:float):

self.planet_radius = pl_radius
self.planet_mass = pl_mass
self.grav_s = phys.G*self.planet_mass/(self.planet_radius**2) # m s-2
self.grav_z[0] = self.grav_s

def setVolatiles(self, vol_mixing: dict):

tot_mixing = float(sum(vol_mixing.values())) # Ensure mixing ratios add up to unity
self.vol_list = {}
for vol in vol_mixing.keys():
lsoucasse marked this conversation as resolved.
Show resolved Hide resolved
self.vol_list[vol] = vol_mixing[vol]/tot_mixing
lsoucasse marked this conversation as resolved.
Show resolved Hide resolved

# H2O floor to prevent NaNs
self.vol_list["H2O"] = np.max( [ self.vol_list["H2O"], 1e-20 ] )

# Update volatile surface partial pressure
for vol in self.vol_list.keys():
lsoucasse marked this conversation as resolved.
Show resolved Hide resolved
self.p_vol[vol][0] = self.ps * self.vol_list[vol]

def setTropopauseTemperature(self):

T_eqm = (self.instellation * self.inst_sf * (1.0 - self.albedo_pl) /phys.sigma)**(1.0/4.0)
Expand Down
Loading