FastchemWrapper#

class shone.chemistry.fastchem.FastchemWrapper(temperature, pressure, metallicity=1, c_to_o_ratio=0.5888, elemental_abundances_path=None, fit_coefficients_path=None, fit_coefficients_condensates_path=None, rainout_condensation=False, equilibrium_condensation=False, quiet=False)[source]#

Bases: object

Wrapper around pyfastchem.

FastChem computes mixing ratios for atmospheric species assuming equilibrium chemistry [1], [2], [3], [4].

References

Parameters:
  • temperature (array-like) – Temperature grid [K].

  • pressure (array-like) – Pressure grid [bar].

  • metallicity (float, optional) – M/H expressed as a linear factor (not log).

  • c_to_o_ratio (float, optional) – Carbon to oxygen ratio expressed as a linear factor (not log). Default is the C/O ratio of the solar abundances from Asplund et al. (2020): 0.5888.

  • elemental_abundances_path (str (path-like), optional) – Path to elemental abundances for FastChem.

  • fit_coefficients_path (str (path-like), optional) – Path to fit coefficients for FastChem.

  • fit_coefficients_condensates_path (str (path-like), optional)

  • rainout_condensation (bool, optional)

  • equilibrium_condensation (bool, optional)

  • quiet (bool, optional) – Raise warnings for machine configurations that may produce inaccurate results. Default is False.

Methods Summary

get_column_index([fastchem_name, species_name])

Return the column of the FastChem result corresponding to a given species or list of species.

get_species()

Return an astropy table with names, symbols, weights and indices for each species in this FastChem instance.

get_weights()

Get weights for each species [AMU].

mmr_mmw()

Mass mixing ratio (MMR) multiplied by the mean molecular weight (MMW).

vmr()

Volume mixing ratio.

Methods Documentation

get_column_index(fastchem_name=None, species_name=None)[source]#

Return the column of the FastChem result corresponding to a given species or list of species.

Parameters:
  • fastchem_name (str, or list of strings (optional)) – Species name in Hill notation (e.g. water is “H2O1”), as it is stored in FastChem.

  • species_name (str, or list of strings (optional)) – Common species name (e.g. water is “H2O”), which will be converted to FastChem’s preferred (Hill) notation.

Returns:

idx – Column index.

Return type:

int, or list of ints

get_species()[source]#

Return an astropy table with names, symbols, weights and indices for each species in this FastChem instance.

Returns:

species_table – Table of FastChem species.

Return type:

Table

get_weights()[source]#

Get weights for each species [AMU].

mmr_mmw()[source]#

Mass mixing ratio (MMR) multiplied by the mean molecular weight (MMW).

To convert to MMR, divide this result by MMW.

Returns:

mmr_mmw – Mass mixing ratio times mean molecular weight for each species.

Return type:

array-like

vmr()[source]#

Volume mixing ratio.

Returns:

vmr – Volume mixing ratio for each species.

Return type:

array-like