Cthulhu.plot ============ .. py:module:: Cthulhu.plot Functions --------- .. autoapisummary:: Cthulhu.plot.plot_cross_section Cthulhu.plot.find_min_max_nu_sigma Cthulhu.plot.set_wl_ticks Cthulhu.plot.compare_cross_sections Cthulhu.plot.read_cross_section_file Cthulhu.plot.cross_section_collection Module Contents --------------- .. py:function:: plot_cross_section(collection, labels, filename, plot_dir='./plots/', x_min=None, x_max=None, y_min=None, y_max=None, color_list=[], smooth_data=False, std=1000, x_unit='micron', x_axis_scale='log', save_fig=True, ax=None, **kwargs) Generate a plot of cross section file[s], in both wavelength and wavenumber :param molecule: DESCRIPTION. :type molecule: TYPE :param temperature: DESCRIPTION. :type temperature: TYPE :param log_pressure: DESCRIPTION. :type log_pressure: TYPE :param nu_arr: DESCRIPTION. The default is []. :type nu_arr: TYPE, optional :param sigma_arr: DESCRIPTION. The default is []. :type sigma_arr: TYPE, optional :param file: DESCRIPTION. The default is ''. :type file: TYPE, optional :param \*\*kwargs: DESCRIPTION. :type \*\*kwargs: TYPE :rtype: None. .. py:function:: find_min_max_nu_sigma(spectra) Find min and max wavenumber for which the cross sections were computed, and determine the min and max values that the cross section takes on in that range. :param spectra: DESCRIPTION. :type spectra: TYPE :returns: * **wl_min** (*TYPE*) -- DESCRIPTION. * **wl_max** (*TYPE*) -- DESCRIPTION. * **sigma_min** (*TYPE*) -- DESCRIPTION. * **sigma_max** (*TYPE*) -- DESCRIPTION. .. py:function:: set_wl_ticks(wl_min, wl_max, wl_axis='log') Calculates default x axis tick spacing for cross section plots. :param wl_min: The minimum wavelength to plot. :type wl_min: float :param wl_max: The maximum wavelength to plot. :type wl_max: float :param wl_axis: The type of x-axis to use ('log' or 'linear'). :type wl_axis: str, optional :returns: The x axis tick values for the given wavelength range. :rtype: np.array .. py:function:: compare_cross_sections(molecule, label_1, label_2, nu_arr_1=[], nu_arr_2=[], sigma_arr_1=[], sigma_arr_2=[], **kwargs) .. 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. .. 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