Cthulhu.plot

Functions

plot_cross_section(collection, labels, filename[, ...])

Generate a plot of cross section file[s], in both wavelength and wavenumber

find_min_max_nu_sigma(spectra)

Find min and max wavenumber for which the cross sections were computed, and

set_wl_ticks(wl_min, wl_max[, wl_axis])

Calculates default x axis tick spacing for cross section plots.

compare_cross_sections(molecule, label_1, label_2[, ...])

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

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

cross_section_collection(new_x, new_y[, collection])

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

Module Contents

Cthulhu.plot.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

Parameters:
  • molecule (TYPE) – DESCRIPTION.

  • temperature (TYPE) – DESCRIPTION.

  • log_pressure (TYPE) – DESCRIPTION.

  • nu_arr (TYPE, optional) – DESCRIPTION. The default is [].

  • sigma_arr (TYPE, optional) – DESCRIPTION. The default is [].

  • file (TYPE, optional) – DESCRIPTION. The default is ‘’.

  • **kwargs (TYPE) – DESCRIPTION.

Return type:

None.

Cthulhu.plot.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.

Parameters:

spectra (TYPE) – DESCRIPTION.

Returns:

  • wl_min (TYPE) – DESCRIPTION.

  • wl_max (TYPE) – DESCRIPTION.

  • sigma_min (TYPE) – DESCRIPTION.

  • sigma_max (TYPE) – DESCRIPTION.

Cthulhu.plot.set_wl_ticks(wl_min, wl_max, wl_axis='log')

Calculates default x axis tick spacing for cross section plots.

Parameters:
  • wl_min (float) – The minimum wavelength to plot.

  • wl_max (float) – The maximum wavelength to plot.

  • wl_axis (str, optional) – The type of x-axis to use (‘log’ or ‘linear’).

Returns:

The x axis tick values for the given wavelength range.

Return type:

np.array

Cthulhu.plot.compare_cross_sections(molecule, label_1, label_2, nu_arr_1=[], nu_arr_2=[], sigma_arr_1=[], sigma_arr_2=[], **kwargs)
Cthulhu.plot.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.

Cthulhu.plot.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