uclchem.makerates.species ========================= .. py:module:: uclchem.makerates.species Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: uclchem.makerates.species.Species Functions ~~~~~~~~~ .. autoapisummary:: uclchem.makerates.species.is_number Attributes ~~~~~~~~~~ .. autoapisummary:: uclchem.makerates.species.elementList uclchem.makerates.species.elementMass uclchem.makerates.species.symbols .. py:class:: Species(inputRow) Species is a class that holds all the information about an individual species in the network. It also has convenience functions to check whether the species is a gas or grain species and to help compare between species. A class representing chemical species, it reads in rows which are formatted as follows: NAME,MASS,BINDING ENERGY,SOLID FRACTION,MONO FRACTION,VOLCANO FRACTION,ENTHALPY :param inputRow: :type inputRow: list .. py:method:: add_default_freeze() -> None Adds a defalt freezeout, which is freezing out to the species itself, but with no ionization. .. py:method:: find_constituents(quiet=False) Loop through the species' name and work out what its consituent atoms are. Then calculate mass and alert user if it doesn't match input mass. .. py:method:: get_charge() -> int Get the charge of the chemical species in e. Positive integer indicates positive ion, negative indicates negative ion. Assumes species are at most charged +1 or -1. :returns: The charge of the species :rtype: int .. py:method:: get_desorb_products() -> list[str] Obtain the desorbtion products of ice species :returns: The desorption products :rtype: list[str] .. py:method:: get_freeze_alpha(product_list: list[str]) -> float Obtain the freeze out ratio of a species for a certain reaction :param product_list: For a specific reaction, get the freezeout ratio :type product_list: list[str] :returns: The freezeout ratio :rtype: float .. py:method:: get_freeze_products() -> dict[list[str], float] Obtain the product to which the species freeze out :returns: Reactions and their respective freeze out ratios. :rtype: dict[str, float] :Yields: *Iterator[dict[str, float]]* -- Iterator that returns all of the freeze out reactions with ratios .. py:method:: get_freeze_products_list() -> list[list[str]] Returns all the freeze products without their ratios :returns: List of freeze products :rtype: list[list[str]] .. py:method:: get_mass() -> int Get the molecular mass of the chemical species :returns: The molecular mass :rtype: int .. py:method:: get_n_atoms() -> int Obtain the number of atoms in the molecule :returns: The number of atoms :rtype: int .. py:method:: get_name() -> str Get the name of the chemical species. :returns: The name :rtype: str .. py:method:: is_bulk_species() -> bool Checks if the species is in the bulk :returns: True if a bulk species :rtype: bool .. py:method:: is_grain_species() -> bool Return whether the species is a species on the grain :returns: True if it is a grain species. :rtype: bool .. py:method:: is_ice_species() -> bool Return whether the species is a species on the grain :returns: True if it is an ice species. :rtype: bool .. py:method:: is_ion() -> bool Checks if the species is ionized, either postively or negatively. :returns: True if it is an ionized :rtype: bool .. py:method:: is_surface_species() -> bool Checks if the species is on the surface :returns: True if a surface species :rtype: bool .. py:method:: set_desorb_products(new_desorbs: list[str]) -> None Set the desorption products for species on the surface or in the bulk. It is assumed that there is only one desorption pathway. :param new_desorbs: The new desorption products :type new_desorbs: list[str] .. py:method:: set_freeze_products(product_list: list[str], freeze_alpha: float) -> None Add the freeze products of the species, one species can have several freeze products. :param product_list: The list of freeze out products :type product_list: list[str] :param freeze_alpha: The freeze out ratio. :type freeze_alpha: float It is called alpha, since it is derived from the alpha column in the UCLCHEM reaction format: https://github.com/uclchem/UCLCHEM/blob/08d37f8c3063f8ff8a9a7aa16d9eff0ed4f99538/Makerates/src/network.py#L160 .. py:method:: set_n_atoms(new_n_atoms: int) -> None Set the number of atoms :param new_n_atoms: The new number of atoms :type new_n_atoms: int .. py:method:: to_UCL_format() -> str .. py:attribute:: enthalpy .. py:attribute:: is_refractory :value: False .. py:attribute:: mass .. py:attribute:: monoFraction .. py:attribute:: n_atoms :value: 0 .. py:attribute:: name .. py:attribute:: solidFraction .. py:attribute:: volcFraction .. py:function:: is_number(s) -> bool Try to convert input to a float, if it succeeds, return True. :param s: Input element to check for :returns: True if a number, False if not. :rtype: bool .. py:data:: elementList :value: ['H', 'D', 'HE', 'C', 'N', 'O', 'F', 'P', 'S', 'CL', 'LI', 'NA', 'MG', 'SI', 'PAH', '15N',... .. py:data:: elementMass :value: [1, 2, 4, 12, 14, 16, 19, 31, 32, 35, 3, 23, 24, 28, 420, 15, 13, 18, 0, 56] .. py:data:: symbols :value: ['#', '@', '*', '+', '-', '(', ')']