uclchem.makerates.reaction ========================== .. py:module:: uclchem.makerates.reaction Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: uclchem.makerates.reaction.CoupledReaction uclchem.makerates.reaction.Reaction Attributes ~~~~~~~~~~ .. autoapisummary:: uclchem.makerates.reaction.reaction_types uclchem.makerates.reaction.tunneling_reaction_types .. py:class:: CoupledReaction(input) Bases: :py:obj:`Reaction` .. py:method:: get_partner() .. py:method:: set_partner(partner: Reaction) .. py:attribute:: partner :value: None .. py:class:: Reaction(inputRow, reaction_source=None) .. py:method:: NANCheck(a) Convert any Falsy statement to a NAN string :param a: thing to check for falsiness :returns: input a if truthy, otherwise NAN :rtype: bool .. py:method:: changes_surface_count() This checks whether a grain reaction changes number of particles on the surface 2 reactants to 2 products won't but two reactants combining to one will. .. py:method:: changes_total_mantle() Check if the total grains on the mantle are changed by the reaction. .. py:method:: check_charge_conservation() -> None .. py:method:: check_element_conservation() -> None .. py:method:: check_temperature_collision(other) -> bool Check if two reactions have overlapping temperature ranges, returning True means there is a collision. :param other: Another reaction :raises NotImplementedError: Currently we can only compare against instantiated Reaction objects. :returns: Whether there is a collision (True), or not (False) :rtype: bool .. py:method:: convert_gas_to_surf() -> None Convert the gas-phase species to surface species in place for this reaction. If any ions are produced, the ion is assumed to become neutral because it is on the surface. If any electrons are produced, they are assumed to be absorbed by the grain. .. py:method:: convert_surf_to_bulk() -> None Convert the surface species to bulk species in place for this reaction. .. py:method:: generate_ode_bit(i: int, species_names: list) .. py:method:: get_alpha() -> float Get the alpha parameter from the Kooij-Arrhenius equation :returns: the alpha parameter of the reaction :rtype: float .. py:method:: get_beta() -> float Get the beta parameter from the Kooij-Arrhenius equation :returns: the beta parameter of the reaction :rtype: float .. py:method:: get_extrapolation() -> bool .. py:method:: get_gamma() -> float Get the gamma parameter from the Kooij-Arrhenius equation :returns: the gamma parameter of the reaction :rtype: float .. py:method:: get_products() -> list[str] Get the four products present in the reaction, padded with NAN for nonexistent :param reactants: The four products names :type reactants: list[str] .. py:method:: get_pure_products() -> list[str] Get only the pure species that are products, no reaction types and NAN entries :returns: The list of produced species. :rtype: list[str] .. py:method:: get_pure_reactants() -> list[str] Get only the pure species, no reaction types and NAN entries :returns: The list of reacting species. :rtype: list[str] .. py:method:: get_reactants() -> list[str] Get the four reactants present in the reaction, padded with NAN for nonexistent :returns: The four reactants names :rtype: list[str] .. py:method:: get_reaction_type() -> str Get the type of a reaction from the reactants First check the third reactant for a reaction type, then the second. If there are none in there, it will be regarded as a two body reaction. :rtype: str .. py:method:: get_reduced_mass() -> float Get the reduced mass to be used to calculate tunneling rate in AMU :returns: reduced mass of moving atoms :rtype: float .. py:method:: get_sorted_products() -> list[str] Get the four products present in the reaction, sorted for fast comparisons :param products: The four sorted products names :type products: list[str] .. py:method:: get_sorted_reactants() -> list[str] Get the four reactants present in the reaction, sorted for fast comparisons :param reactants: The four sorted reactant names :type reactants: list[str] .. py:method:: get_source() -> str Get the source of the reaction :returns: The source of the reaction :rtype: str .. py:method:: get_temphigh() -> float Get the higher temperature boundary of the reaction in Kelvin :returns: the higher temperature boundary :rtype: float .. py:method:: get_templow() -> float Get the lower temperature boundary of the reaction in Kelvin :returns: the lower temperature boundary :rtype: float .. py:method:: is_bulk_reaction(include_reactants=True, include_products=True, strict=False) -> bool Check whether it is a bulk reaction, defaults to non-strict since many important bulk reactions interact with the surface. By default it is NOT strict (strict=False); any species in the bulk returns true If strict=True; all species must be on the ice phase :param include_reactants: Include the reactants. Defaults to True. :type include_reactants: bool, optional :param include_products: Include the products. Defaults to True. :type include_products: bool, optional :param strict: Choose between all (true) or any (false) must in the bulk . Defaults to False. :type strict: bool, optional :returns: Is it a bulk reaction? :rtype: bool .. py:method:: is_gas_reaction(include_reactants=True, include_products=True, strict=True) -> bool Check whether it is a gas reaction, by default it is strict - all reactions must be in the gas-phase - if strict=False; any reaction in the gas-phase returns true. :param include_reactants: Include the reactants. Defaults to True. :type include_reactants: bool, optional :param include_products: Include the products. Defaults to True. :type include_products: bool, optional :param strict: Choose between all (true) or any (false) must be gas phase . Defaults to True. :type strict: bool, optional :returns: Is it a gas phase reaction? :rtype: bool .. py:method:: is_ice_reaction(include_reactants=True, include_products=True, strict=True) -> bool Check whether it is an ice (surface OR bulk) reaction By default it is strict (strict=True); all species must be in the ice phase If strict=False; any species in ice phase returns True :param include_reactants: Include the reactants. Defaults to True. :type include_reactants: bool, optional :param include_products: Include the products. Defaults to True. :type include_products: bool, optional :param strict: Choose between all (true) or any (false) must be ice phase . Defaults to True. :type strict: bool, optional :returns: Is it an ice phase reaction? :rtype: bool .. py:method:: is_surface_reaction(include_reactants=True, include_products=True, strict=False) -> bool Check whether it is a surface reaction, defaults to non-strict since many important surface reactions can lead to desorption in some way. By default it is NOT strict (strict=False); any species on the surface returns true If strict=True; all species must be on the ice phase :param include_reactants: Include the reactants. Defaults to True. :type include_reactants: bool, optional :param include_products: Include the products. Defaults to True. :type include_products: bool, optional :param strict: Choose between all (true) or any (false) must be on the surface . Defaults to False. :type strict: bool, optional :returns: Is it a surface reaction? :rtype: bool .. py:method:: predict_reduced_mass() -> None Predict the reduced mass of the tunneling particle in this reaction. This is used in the calculation of the tunneling rates. .. py:method:: set_alpha(alpha: float) -> None Set the alpha parameter from the Kooij-Arrhenius equation :param alpha: the alpha parameter of the reaction :type alpha: float .. py:method:: set_beta(beta: float) -> None Set the beta parameter from the Kooij-Arrhenius equation :param beta: the beta parameter of the reaction :type beta: float .. py:method:: set_extrapolation(flag: bool) -> None .. py:method:: set_gamma(gamma: float) -> None Set the gamma parameter from the Kooij-Arrhenius equation :param gamma: the gamma parameter of the reaction :type gamma: float .. py:method:: set_products(products: list[str]) -> None Set the four products present in the reaction, padded with NAN for nonexistent :param products: The four products names :type products: list[str] .. py:method:: set_reactants(reactants: list[str]) -> None Set the four reactants present in the reaction, padded with NAN for nonexistent :param reactants: The four reactants names :type reactants: list[str] .. py:method:: set_reduced_mass(reduced_mass: float) -> None Set the reduced mass to be used to calculate tunneling rate in AMU :param reduced_mass: reduced mass of moving atoms :type reduced_mass: float .. py:method:: set_source(source: str) -> None Set the source of the reaction :param source: The source of the reaction :type source: str .. py:method:: set_temphigh(temphigh: float) -> None Set the higher temperature boundary of the reaction in Kelvin :param templow: the higher temperature boundary :type templow: float .. py:method:: set_templow(templow: float) -> None Set the lower temperature boundary of the reaction in Kelvin :param templow: the lower temperature boundary :type templow: float .. py:method:: to_UCL_format() Convert a reaction to UCLCHEM reaction file format .. py:attribute:: body_count :value: -1 .. py:attribute:: duplicate :value: False .. py:attribute:: source :value: None .. py:data:: reaction_types :value: ['PHOTON', 'CRP', 'CRPHOT', 'FREEZE', 'DESORB', 'THERM', 'DESOH2', 'DESCR', 'DEUVCR', 'H2FORM',... .. py:data:: tunneling_reaction_types :value: ['LH', 'LHDES', 'ER', 'ERDES']