Cthulhu.misc ============ .. py:module:: Cthulhu.misc Functions --------- .. autoapisummary:: Cthulhu.misc.check_molecule Cthulhu.misc.write_output Cthulhu.misc.round_sig_figs Cthulhu.misc.int_to_roman Cthulhu.misc.cross_section_collection Cthulhu.misc.read_cross_section_file Module Contents --------------- .. py:function:: check_molecule(molecule) Check if the given string is a molecule :param molecule: Molecule name (e.g. H2O). :type molecule: String :rtype: True if the given string is a molecule, false otherwise (if it is an atom). .. py:function:: write_output(output_directory, species, roman_num, T, log_P, broad_type, broadening_file, nu_out, sigma_out) :param output_directory: Local directory where the output data is to be stored. :type output_directory: String :param species: Name of molecule or atomic. :type species: String :param roman_num: Ionization state, in case the species is an atom. Depicted in Roman numeral form. :type roman_num: String :param T: Temperature (K) the cross-section was computed at. :type T: int :param log_P: DESCRIPTION. :type log_P: int :param broad_type: The type of broadening used in computing the cross section. :type broad_type: String :param nu_out: DESCRIPTION. :type nu_out: TYPE :param sigma_out: DESCRIPTION. :type sigma_out: TYPE :rtype: None. .. py:function:: round_sig_figs(value, sig_figs) Round a quantity to a specified number of significant figures. .. py:function:: int_to_roman(num) Convert an integer to the corresponding Roman numeral. .. py:function:: cross_section_collection(new_x, new_y, collection=[]) Add new cross section (that is, wavelength and absorption cross section) to the collection :param new_x: DESCRIPTION. :type new_x: list :param new_y: DESCRIPTION. :type new_y: list :param collection: DESCRIPTION. The default is []. :type collection: 2d list, optional :returns: **collection** -- DESCRIPTION. :rtype: TYPE .. py:function:: 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. :param species: Molecule for which the cross section was computed. :type species: String :param database: Database the line list was downloaded from. :type database: String :param filename: Full file name of the cross section file(eg. 'this_is_my_file.txt'). :type filename: String :param isotope: Isotopologue of the molecule for which the cross-section is to be created. The default is 'default'. :type isotope: String :param ionization_state: Ionization state, in case of an atomic species. The default is 1. :type ionization_state: int :param linelist: 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'. :type linelist: String :param output_dir = String: '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.