atm_models_interp
Attributes
Classes
Functions
|
This function locates the index of the element x <= value_in in an array |
|
2d interpolation |
|
This function calculates the saturation curve for water (Wagner & Pruss 2002) |
|
This function calculates the density of water vapour in the saturation limit (Wagner & Pruss 2002) |
This function converts metal mass fraction into metallicity (or O:H ratio). See Fortney et al. 2013 |
Module Contents
- atm_models_interp.maxloc(array_in, value_in)
This function locates the index of the element x <= value_in in an array i.e index_final = maxloc(array_in,value_in) is equivalent to Fortran’s index_final = MAXLOC(array_in, DIM = 1, MASK=(array_in <= value_in))
- Args:
- array_in:
array with values
- value_in:
value whose index we want to locate
- atm_models_interp.interp2d_opt(x_in, y_in, x_array, y_array, z_array)
2d interpolation
- Args:
- x_in:
Value to evaluate in x-axis
- y_in:
Value to evaluate in y-axis
- x_array:
Array of x-axis grid. This one is the one that always changes i.e [a,b,c,…,a,b,c…] Dimension is Nx.
- y_array:
Array of y-axis grid. This one is the constant one i.e [d,d,d,…,e,e,e…] Dimension is Ny
- z_array:
Array with the parameter to interpolate. Dimension is Nx*Ny
- Returns:
- z(x_in,y_in):
final interpolated value
- atm_models_interp.vapor_pressure(Tin)
This function calculates the saturation curve for water (Wagner & Pruss 2002)
- Args:
- Tin:
Temperature in K
- Returns:
- Pout:
Saturation pressure at Tin in MPa
- atm_models_interp.vapor_density(Tin)
This function calculates the density of water vapour in the saturation limit (Wagner & Pruss 2002)
- Args:
- Tin:
Temperature in K
- Returns:
- rhoout:
Density in kg/m3
- atm_models_interp.O_to_H_sun = 0.0004898
- atm_models_interp.mu_H = 1.0
- atm_models_interp.mu_H2O = 18.0
- atm_models_interp.O_to_H_molecular(Z)
This function converts metal mass fraction into metallicity (or O:H ratio). See Fortney et al. 2013
- Args:
- Z:
metal mass fraction in atmosphere
- Returns:
- OtoH:
O:H ratio (metallicity [Fe/H])
- class atm_models_interp.atm_models_interp(name_grid='gastli_default_atm_grid.hdf5')
- T_int_pl = 0.0
- g_surf_pl = 0.0
- Zenv_pl = 0.0
- Rbulk_pl = 0.0
- npoints = 130
- path_to_file
- data_set_atm
- data_set_metal_mass_fractions
- CO_atm
- FeH_atm
- Teq_atm
- Tint_atm
- logg_atm
- temperature_func
- metal_mass_fraction_func
- logTinput
- logPinput
- logrho
- rho_aqua
- press_aqua
- temp_aqua
- V_mix
- logP_Vmix
- logT_Vmix
- calc_interior_mass_fraction(Tint, g_surf, Teq, CO, log_FeH, P_surf=1000.0)
- Function that calculates the metal mass fraction for a given log10(metallicity) [x solar].
It uses data from easychem.
- Args:
- Tint:
Internal temperature in K
- g_surf:
Surface gravity in cm/s2
- Teq:
Equilibrium temperature in K (at Bond albedo zero)
- CO:
atm. C-to-O ratio
- log_FeH:
log10(metallicity), where the atm. metallicity is in x solar units
- P_surf:
surface pressure in bar
- Returns:
- Pprofile:
pressure profile in bar
- MMF_profile:
metal mass fraction profile for atm. thickness calculation
- MMF_surf:
metal mass fraction in the surface (1000 bars) for interior model input
- calc_PTprofile(Tint, g_surf, Teq, Zenv=0.03, FeH_flag=True, CO_def=0.55, guillot=False, P_surf=1000.0, kappa_IR=0.01, gamma=0.4)
- Calculation of pressure-temperature atmospheric profile by interpolating the grid of data of
atmospheric models
- Args:
- Tint:
Internal temperature in K
- g_surf:
Surface gravity in cm/s2
- Teq:
Equilibrium temperature in K (at Bond albedo zero)
- CO_def (optional):
C-to-O ratio. Default value is 0.55 (solar)
- FeH_flag (optional):
equals True if the amount of metals is specified as log10(metallicity) in x solar units. If specified as metal mass fraction, set FeH_flag = False. In the former case, the metal mass fraction profile is extracted from easychem data (calculated with calc_interior_mass_fraction). In the latter, it is set constant to Zenv, and converted to log10(metallicity) with Fortney+13 relation (appendix A1) to interpolate the PT profiles from atmospheric grid
- Zenv (optional):
atmospheric metal mass fraction (for FeH_flag = False). Default value is 0.03.
- guillot (optional):
False if you do not want to use Guillot 2010 atm. profile
- P_surf:
Boundary pressure between interior and atmosphere. Default is 1000 bars. For models with high Tint you may need to decrease it to 9.5 bars (if using the default atm. grid)
- kappa_IR (float, optional):
The infrared opacity in units of \(\\rm cm^2/s\). Default is 0.01.
- gamma (float, optional):
The ratio between the visual and infrared opacity. Default is 0.4.
- Returns:
- Pprofile:
atm. pressure profile in bar
- Tprofile:
atm. temperature profile in K
- Tsurf:
Temperature at bottom of atmosphere in K
- Psurf:
Pressure at bottom of atmosphere in bar. Normally set to 1000 bars
- calc_thickness(Rbulk, Matm_earthunits, Z_atm)
Calculates thickness of atmosphere
- Args:
- Rbulk:
Planet bulk radius (centre to Psurf) in Jupiter radii
- Matm_earthunits:
Atmospheric mass in Earth units
- Returns:
- r:
Radius atm. profile in m
- P_ode:
Pressure atm. profile in Pa
- g_ode:
Gravity atm. profile in m/s2
- rho_ode:
Density atm. profile in kg/m3
- T_ode:
Temperature atm. profile in K
- total_radius:
Total planet radius in Jupiter radii
- z_ode:
Atmospheric thickness in Jupiter radii