uclchem.utils#

Module Contents#

Functions#

check_error(error_code)

Converts the UCLCHEM integer result flag to a simple messaging explaining what went wrong"

cshock_dissipation_time(shock_vel, initial_dens)

A simple function used to calculate the dissipation time of a C-type shock.

get_reaction_network()

get_reaction_table()

A function to load the reaction table from the UCLCHEM network into a pandas dataframe.

get_species(→ list[str])

A simple function to load the list of species present in the UCLCHEM network

get_species_table()

A simple function to load the list of species in the UCLCHEM network into a pandas dataframe.

uclchem.utils.check_error(error_code)[source]#

Converts the UCLCHEM integer result flag to a simple messaging explaining what went wrong”

Parameters:

error_code (int) – Error code returned by UCLCHEM models, the first element of the results list.

Returns:

Error message

Return type:

str

uclchem.utils.cshock_dissipation_time(shock_vel, initial_dens)[source]#

A simple function used to calculate the dissipation time of a C-type shock. Use to obtain a useful timescale for your C-shock model runs. Velocity of ions and neutrals equalizes at dissipation time and full cooling takes a few dissipation times.

Parameters:
  • shock_vel (float) – Velocity of the shock in km/s

  • initial_dens (float) – Preshock density of the gas in cm$^{-3}$

Returns:

The dissipation time of the shock in years

Return type:

float

uclchem.utils.get_reaction_network()[source]#
uclchem.utils.get_reaction_table()[source]#

A function to load the reaction table from the UCLCHEM network into a pandas dataframe.

Returns:

A dataframe containing the reactions and their rates

Return type:

pandas.DataFrame

uclchem.utils.get_species() list[str][source]#

A simple function to load the list of species present in the UCLCHEM network

Returns:

A list of species names

Return type:

list[str]

uclchem.utils.get_species_table()[source]#

A simple function to load the list of species in the UCLCHEM network into a pandas dataframe.

Returns:

A dataframe containing the species names and their details

Return type:

pandas.DataFrame