petitRADTRANS.chemistry.prt_molmass#

Interface between molmass and petitRADTRANS.

Functions#

element_number2element_symbol(→ str)

Convert an element's atomic number (e.g. 6) to its element symbol (e.g. 'C').

element_symbol2element_number(→ int)

Convert an element symbol (e.g. 'C') to its atomic number (e.g. 6).

get_molmass_name(species)

Convert a pRT species' name into a molmass-compatible name.

get_species_elements(→ dict[str, int])

Decompose a species into its elements and their amount.

get_species_molar_mass(→ float)

Get the molecular mass of a given species.

Module Contents#

petitRADTRANS.chemistry.prt_molmass.element_number2element_symbol(atomic_number: int) str#

Convert an element’s atomic number (e.g. 6) to its element symbol (e.g. ‘C’).

petitRADTRANS.chemistry.prt_molmass.element_symbol2element_number(symbol: str) int#

Convert an element symbol (e.g. ‘C’) to its atomic number (e.g. 6).

petitRADTRANS.chemistry.prt_molmass.get_molmass_name(species: str)#

Convert a pRT species’ name into a molmass-compatible name.

petitRADTRANS.chemistry.prt_molmass.get_species_elements(species: str) dict[str, int]#

Decompose a species into its elements and their amount.

Example:
>>> get_species_elements('H2O')
>>> {'H': 2, 'O': 1}
Args:

species: pRT chemical formula of the species

Returns:

A dictionary containing the element symbols of the species as keys and their amount as values.

petitRADTRANS.chemistry.prt_molmass.get_species_molar_mass(species: str) float#

Get the molecular mass of a given species.

This function uses the molmass package to calculate the mass number for the standard isotope of an input species. If all_iso is part of the input, it will return the mean molar mass.

Args:
speciesstring

The chemical formula of the compound. ie C2H2 or H2O

Returns:

The molar mass of the compound in atomic mass units.