petitRADTRANS.chemistry.core
============================

.. py:module:: petitRADTRANS.chemistry.core


Attributes
----------

.. autoapisummary::

   petitRADTRANS.chemistry.core.get_exoatmos_abundances


Functions
---------

.. autoapisummary::

   petitRADTRANS.chemistry.core.get_abundances


Module Contents
---------------

.. py:data:: get_exoatmos_abundances
   :value: None


.. py:function:: get_abundances(pressures, temperatures, line_species, cloud_species, parameters, amr=False)

   This function takes in the C/O ratio, metallicity, and quench pressures and uses them
   to compute the gas phase and equilibrium condensate abundances from an interpolated table.
   Alternatively, a "free chemistry" approach can be used to set abundances.
   This function assumes a hydrogen-helium dominated atmosphere, and enforces <100% trace gas
   abundance by mass.

   Args:
       pressures : numpy.ndarray
           A log spaced pressure array. If AMR is on it should be the full high resolution grid.
       temperatures : numpy.ndarray
           A temperature array with the same shape as pressures
       line_species : List(str)
           A list of gas species that will contribute to the line-by-line opacity of the pRT atmosphere.
       cloud_species : List(str)
           A list of condensate species that will contribute to the cloud opacity of the pRT atmosphere.
       parameters : dict
           A dictionary of model parameters, in particular it must contain the names C/O, Fe/H and
           log_pquench. Additionally, the cloud parameters log_X_cb_Fe(c) and MgSiO3(c) must be present.
       amr : bool
           Turn the adaptive mesh grid on or off. See fixed_length_amr for implementation.

   Returns:
       abundances : dict
           Mass fraction abundances of all atmospheric species
       MMW : numpy.ndarray
           Array of the mean molecular weights in each pressure bin
       pressure_indices : numpy.ndarray
           The indices of the high resolution grid to use to define the adaptive grid.
       PBases : dict
           A dictionary of the cloud base pressures, either computed from equilibrium
           condensation or set by the user.


