Cthulhu.misc

Functions

check_molecule(molecule)

Check if the given string is a molecule

write_output(output_directory, species, roman_num, T, ...)

round_sig_figs(value, sig_figs)

Round a quantity to a specified number of significant figures.

int_to_roman(num)

Convert an integer to the corresponding Roman numeral.

cross_section_collection(new_x, new_y[, collection])

Add new cross section (that is, wavelength and absorption cross section) to the collection

read_cross_section_file(species, database, filename[, ...])

Read in a previously computed cross section on a user's machine, and return the

Module Contents

Cthulhu.misc.check_molecule(molecule)

Check if the given string is a molecule

Parameters:

molecule (String) – Molecule name (e.g. H2O).

Return type:

True if the given string is a molecule, false otherwise (if it is an atom).

Cthulhu.misc.write_output(output_directory, species, roman_num, T, log_P, broad_type, broadening_file, nu_out, sigma_out)
Parameters:
  • output_directory (String) – Local directory where the output data is to be stored.

  • species (String) – Name of molecule or atomic.

  • roman_num (String) – Ionization state, in case the species is an atom. Depicted in Roman numeral form.

  • T (int) – Temperature (K) the cross-section was computed at.

  • log_P (int) – DESCRIPTION.

  • broad_type (String) – The type of broadening used in computing the cross section.

  • nu_out (TYPE) – DESCRIPTION.

  • sigma_out (TYPE) – DESCRIPTION.

Return type:

None.

Cthulhu.misc.round_sig_figs(value, sig_figs)

Round a quantity to a specified number of significant figures.

Cthulhu.misc.int_to_roman(num)

Convert an integer to the corresponding Roman numeral.

Cthulhu.misc.cross_section_collection(new_x, new_y, collection=[])

Add new cross section (that is, wavelength and absorption cross section) to the collection

Parameters:
  • new_x (list) – DESCRIPTION.

  • new_y (list) – DESCRIPTION.

  • collection (2d list, optional) – DESCRIPTION. The default is [].

Returns:

collection – DESCRIPTION.

Return type:

TYPE

Cthulhu.misc.read_cross_section_file(species, database, filename, isotope='default', ionization_state=1, linelist='default', output_dir='./output/')

Read in a previously computed cross section on a user’s machine, and return the wavenumber and absorption cross section columns.

Parameters:
  • species (String) – Molecule for which the cross section was computed.

  • database (String) – Database the line list was downloaded from.

  • filename (String) – Full file name of the cross section file(eg. ‘this_is_my_file.txt’).

  • isotope (String) – Isotopologue of the molecule for which the cross-section is to be created. The default is ‘default’.

  • ionization_state (int) – Ionization state, in case of an atomic species. The default is 1.

  • linelist (String) – Line list that is being used. HITRAN/HITEMP/VALD used as the line list name for these databases respectively. ExoMol has its own named line lists. The default is ‘default’.

  • String (output_dir =) – ‘Prefix’ of the directory containing the cross section files. If the files were downloaded using our script with no modifications, output_dir will end in ‘/output’. The default is ‘./output/’.

Returns:

  • nu (numpy array) – Wavenumber column of cross section file.

  • sigma (numpy array) – Absorption cross section column of cross section file.