petitRADTRANS.chemistry.pre_calculated_chemistry#

Manage equilibrium chemistry pre-calculated table.

Attributes#

Classes#

PreCalculatedEquilibriumChemistryTable

Used to store petitRADTRANS's pre-calculated mass fractions at chemical equilibrium.

Functions#

interpolate_chemical_table(→ jax.typing.ArrayLike)

Performs 4D linear interpolation on the chemical table for n_layers.

Module Contents#

petitRADTRANS.chemistry.pre_calculated_chemistry.interpolate_chemical_table(co_ratios: jax.typing.ArrayLike, log10_metallicities: jax.typing.ArrayLike, temperatures: jax.typing.ArrayLike, pressures: jax.typing.ArrayLike, largest_co_ratios_indices: jax.typing.ArrayLike, largest_metallicities_indices: jax.typing.ArrayLike, largest_temperatures_indices: jax.typing.ArrayLike, largest_pressures_indices: jax.typing.ArrayLike, table_metallicities: jax.typing.ArrayLike, table_co_ratios: jax.typing.ArrayLike, table_pressures: jax.typing.ArrayLike, table_temperatures: jax.typing.ArrayLike, chemistry_table: jax.typing.ArrayLike, is_mass_fraction: bool) jax.typing.ArrayLike#

Performs 4D linear interpolation on the chemical table for n_layers. Input indices (largest_…_indices) are 1-based and point to the upper bound of the interpolation cell.

class petitRADTRANS.chemistry.pre_calculated_chemistry.PreCalculatedEquilibriumChemistryTable#

Used to store petitRADTRANS’s pre-calculated mass fractions at chemical equilibrium.

The interpolate_mass_fractions function can be used to get mass fractions at given thermochemical conditions.

_loaded: bool = False#
mass_fractions: jax.typing.ArrayLike = None#
mean_molar_masses: jax.typing.ArrayLike = None#
nabla_adiabatic: jax.typing.ArrayLike = None#
log10_metallicities: jax.typing.ArrayLike = None#
co_ratios: jax.typing.ArrayLike = None#
temperatures: jax.typing.ArrayLike = None#
pressures: jax.typing.ArrayLike = None#
species: tuple[str] = None#
static get_default_file(path_input_data: str = None) str#
interpolate_mass_fractions(co_ratios: iter, log10_metallicities: iter, temperatures: iter, pressures: iter, carbon_quench_pressure: float = None, full: bool = False, numpy_compatible=False)#

Interpolate mass fractions from a pre-calculated table to the desired parameters.

Args:
co_ratios:

Desired carbon to oxygen ratios, obtained by increasing the amount of oxygen.

log10_metallicities:

Base-10 logarithm of the desired metallicities.

temperatures:
  1. desired temperatures

pressures:

(bar) desired pressures

carbon_quench_pressure:

(bar) pressure at which to put a simplistic carbon-bearing species quenching

full:

if True, output the pre-calculated mean molar mass and logarithmic derivative of temperature with respect to pressure in the adiabatic case (nabla_ad) in addition to the pre-calculated mass fractions

load(path: str = None, path_input_data: str = None, file: str = '')#
petitRADTRANS.chemistry.pre_calculated_chemistry.pre_calculated_equilibrium_chemistry_table#