spino.pipeline.phase_scale_height module¶
Scale Height Calculator for Exoplanet Atmospheres¶
Computes the atmospheric scale height:
H = k_B * T_eq / (mu * g)
where g = G * M_p / R_p^2 and mu is the mean molecular weight per molecule.
Usage¶
Either supply a composition dict (VMR + molecular masses) to have the MMW
computed automatically, or pass a numeric mu directly:
# Option A – composition dict result = compute_scale_height(
M_planet=0.096, R_planet=0.98, T_eq=525, species={
‘H2’: {‘vmr’: 0.836835, ‘M’: 2.016}, ‘He’: {‘vmr’: 0.141943, ‘M’: 4.003},
}, M_unit=’Mjup’, R_unit=’Rjup’,
)
# Option B – direct MMW result = compute_scale_height(
M_planet=10.5, R_planet=3.2, T_eq=900, mu=2.3, M_unit=’Mearth’, R_unit=’Rearth’,
)
print(result[‘H_km’], ‘km’)
- spino.pipeline.phase_scale_height.mean_molecular_weight(species)[source]¶
Compute the mean molecular weight from a species composition dict.
- Parameters:
species (dict) – {name: {‘vmr’: float, ‘M’: float [g/mol]}, …} VMRs do not need to be normalised; they are used as relative weights.
- Returns:
mu – Mean molecular weight [g/mol].
- Return type:
- Raises:
ValueError – If no species are provided or all VMRs sum to zero.
- spino.pipeline.phase_scale_height.compute_scale_height(M_planet, R_planet, T_eq, *, species=None, mu=None, M_unit='Mjup', R_unit='Rjup')[source]¶
Compute the atmospheric scale height for an exoplanet.
- Parameters:
M_planet (float) – Planet mass, in the unit given by M_unit.
R_planet (float) – Planet radius, in the unit given by R_unit.
T_eq (float) – Equilibrium temperature [K].
species (dict, optional) – Atmospheric composition: {name: {‘vmr’: float, ‘M’: float [g/mol]}}. Used to compute the MMW when mu is not supplied.
mu (float, optional) – Mean molecular weight [g/mol]. Takes precedence over species if both are given.
M_unit (str) – Mass unit:
'Mjup'(default) or'Mearth'.R_unit (str) – Radius unit:
'Rjup'(default) or'Rearth'.
- Returns:
H_m : float – scale height [m] H_km : float – scale height [km] g : float – surface gravity [m s⁻²] g_cgs : float – surface gravity [cm s⁻²] mu : float – mean molecular weight [g mol⁻¹] mu_method : str –
'direct'or'composition'T_eq : float – equilibrium temperature used [K]- Return type:
dict with keys
- Raises:
ValueError – If neither mu nor species is given, or if unit strings are invalid, or if mass/radius/temperature are non-positive.