-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from FormingWorlds/density
Calculates observed bulk density
- Loading branch information
Showing
5 changed files
with
91 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,6 @@ build/ | |
fwl_data*/ | ||
dist/ | ||
.pytest_cache | ||
.ruff_cache | ||
|
||
|
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 |
---|---|---|
|
@@ -3,21 +3,27 @@ | |
|
||
## JANUS (1D convective atmosphere model) | ||
|
||
Generates a temperature profile using the generalised moist pseudoadiabat and a prescribed stratosphere. Calculates radiative fluxes using SOCRATES. | ||
Generates a temperature profile using the generalised moist pseudoadiabat and a prescribed stratosphere. Calculates radiative fluxes using SOCRATES. | ||
|
||
Pronounced *jan-us*. *Jan* as in "january", and *us* as in the collective pronoun. | ||
|
||
### Documentation | ||
https://proteus-code.readthedocs.io | ||
|
||
### Contributors (abbreviations & email addresses): | ||
* TL - Tim Lichtenberg ([email protected]) | ||
* MH - Mark Hammond ([email protected]) | ||
* RB – Ryan Boukrouche ([email protected]) | ||
* RJG – RJ Graham ([email protected]) | ||
* HN - Harrison Nicholls ([email protected]) | ||
* HII - Hamish Innes ([email protected]) | ||
* LS - Laurent Soucasse ([email protected]) | ||
https://fwl-proteus.readthedocs.io | ||
|
||
## Contributors | ||
|
||
| Name | Email address | | ||
| - | - | | ||
Tim Lichtenberg | tim.lichtenberg[at]rug.nl | | ||
Harrison Nicholls | harrison.nicholls[at]physics.ox.ac.uk | | ||
Laurent Soucasse | l.soucasse[at]esciencecenter.nl | | ||
Stef Smeets | s.smeets[at]esciencecenter.nl | | ||
Mark Hammond | mark.hammond[at]physics.ox.ac.uk | | ||
RJ Graham | arejaygraham[at]uchicago.edu | | ||
Raymond Pierrehumbert | raymond.pierrehumbert[at]physics.ox.ac.uk | | ||
Ryan Boukrouche | ryan.boukrouche[at]astro.su.se | | ||
Hamish Innes | hamish.innes[at]fu-berlin.de | | ||
|
||
|
||
### Repository structure | ||
* `README.md` - This file | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import numpy as np | ||
|
||
def calc_observed_rho(atm): | ||
"""Calculate the observed bulk density. | ||
Copied from AGNI. | ||
Parameters | ||
---------- | ||
atm : atmos | ||
Atmosphere object from atmosphere_column.py | ||
Returns | ||
---------- | ||
rho : float | ||
Observed bulk density [kg m-3] | ||
""" | ||
|
||
# transspec_r::Float64 # planet radius probed in transmission [m] | ||
# transspec_m::Float64 # mass [kg] of atmosphere + interior | ||
# transspec_rho::Float64 # bulk density [kg m-3] implied by r and m | ||
|
||
# arguments | ||
transspec_p:float = 1e2 # (INPUT) level probed in transmission [Pa] | ||
|
||
# get the observed height | ||
idx = int(np.argmin(np.abs(atm.p - transspec_p))) | ||
transspec_r = atm.z[idx] + atm.planet_radius | ||
|
||
# get mass of whole atmosphere, assuming hydrostatic | ||
transspec_m = np.amax(atm.pl) * 4 * np.pi * atm.planet_radius**2 / atm.grav_s | ||
|
||
# add mass of the interior component | ||
transspec_m += atm.planet_mass | ||
|
||
# get density of all enclosed by observed layer | ||
transspec_rho = 3.0 * transspec_m / (4.0 * np.pi * transspec_r**3) | ||
|
||
return transspec_rho | ||
|