descmap.analysis

openMKM

Functionality to process openmkm outputs

descmap.analysis.openmkm.get_ellipse(x, y, slope, x_model, y_model, n_std=1.0, n=50)[source]

Calculates the x, y coordinates of an ellipse based on the data

Parameters:
  • x ((N,) nd.ndarray) – X coordinates

  • y ((N,) nd.ndarray) – Y coordinates

  • n (int) – Number of data points to fit ellipse

Returns:

  • x_ell ((M,) nd.ndarray) – X coordinates corresponding to ellipse perimeter

  • y_ell ((M,) np.ndarray) – Y coordinates corresponding to ellipse perimeter

descmap.analysis.openmkm.get_flow_rates(reactor, mol_frac_in, mol_frac_out, mass_frac_in, mass_frac_out, mol_weight)[source]

Calculates the mass and mol flow rates in and out of the reactor

Parameters:
  • reactor (dict of Quantity objects.) – Reactor condition inputs

  • mol_frac_in ((M, N) pd.DataFrame obj) – Mole fractions in. M and N represents number of runs and species respectively.

  • mol_frac_out ((M, N) pd.DataFrame obj) – Mole fractions out. M and N represents number of runs and species respectively.

  • mass_frac_out ((M, N) pd.DataFrame obj) – Mass fractions in. M and N represents number of runs and species respectively.

  • mass_frac_out – Mass fractions out. M and N represents number of runs and species respectively.

  • mol_weight (pd.Series obj) – Mole weight in g/mol

Returns:

  • mol_flow_rates (dict) – Flow rates containing the keys:

    • in

    • in_tot

    • out

    • out_tot

  • mass_flow_rates (dict) – Mass flow rates containing the keys:

    • in

    • out

    • tot

descmap.analysis.openmkm.get_fractions(paths, omkm_path)[source]

Returns the coverages, gas fractions and mole fractions associated with OpenMKM runs.

Parameters:
  • paths (str) – Path to OpenMKM subfolders

  • omkm_path (str) – Path to OpenMKM parent folder

Returns:

fractions – Fractions from reactor with the following keys:

  • cov_in

  • covs_out

  • mass_in

  • mass_out

  • mol_in

  • mol_out

Return type:

dict

descmap.analysis.openmkm.get_reactor_inputs(reactor_inputs, phases, units)[source]

Extracts the reactor inputs

Parameters:
  • reactor_inputs (dict) – Conditions of the reactor. Keys represent reactor conditions and values represent quantity

  • phases (list of dict) – Phases to consider for site density calculation. At least one dictionary is expected to have ‘site_density’ as the key.

  • units (dict) – Units corresponding to interested quantities. If an entry is not provided, uses pMuTT’s default units for OpenMKM.

Returns:

reactor – Reactor conditions containing the keys:

  • ’Q’

  • ’P’

  • ’V’

  • ’T’

  • ’cat_abyv’

  • ’site_den’

  • ’mol_catalyst’

Return type:

dict of Quantity objects


Chemkin

Functionality to process Chemkin outputs

descmap.analysis.chemkin.get_Eapp(tof_list, temp_list, jobs_name)[source]

Calculate apparent activation energies (kcal/mol)

Parameters:
  • tof_list (list) – Extracted TOF from MKM outputs

  • temp_list (list) – Reaction temperatures

  • jobs_name (list) – List of descriptor names

Returns:

ea_list

Return type:

list of calculated apparent activation energies

descmap.analysis.chemkin.get_conversion(main_path, jobs_name)[source]

Extract reaction conversion from Chemkin outputs

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • jobs_name (list) – List of descriptor names

Returns:

conv_list

Return type:

list of conversions extracted from each MKM model

descmap.analysis.chemkin.get_coverage(main_path, jobs_name, inputs)[source]

Extract coverages of surface species from Chemkin outputs

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • jobs_name (list) – List of descriptor names

  • inputs (dict) – Inputs read from excel sheet. Keys correspond to sheet names.

Returns:

cov_dict_list – Each dictionary corresponds to one MKM model. Keys represent species and values represent surface coverages.

Return type:

list of dict

descmap.analysis.chemkin.get_mole_fraction(main_path, jobs_name, reactant_name)[source]

Extract reactant mole fraction flow in the reactor

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • jobs_name (list) – List of descriptor names

  • reactant_name (str) – Name of reactant to be investigated

Returns:

mole_list

Return type:

list of mole fractions extracted from each MKM model

descmap.analysis.chemkin.get_reaction_order(mole_list, tof_list, jobs_name)[source]

Calculate reaction orders

Parameters:
  • mole_list (list) – Extracted input mole fractions

  • tof_list (list) – Extracted TOF from MKM outputs

  • jobs_name (list) – List of descriptor names

Returns:

reaction_order

Return type:

list of reaction orders

descmap.analysis.chemkin.get_species(main_path)[source]

Get names of all surfae species

Parameters:

main_path (str) – Path to descmap main folder (MKM parent folder)

Returns:

species

Return type:

list of surface species’ names

descmap.analysis.chemkin.get_temperature(main_path, jobs_name)[source]

Extract temperatures from Chemkin outputs

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • jobs_name (list) – List of descriptor names

Returns:

temp_list

Return type:

list of temperatures extracted from each MKM model

descmap.analysis.chemkin.get_tof(main_path, jobs_name)[source]

Extract TOF from Chemkin outputs

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • jobs_name (list) – List of descriptor names

Returns:

tof_list

Return type:

list of TOF extracted from each MKM model

descmap.analysis.chemkin.write_Eapp(main_path, jobs_name, output_path)[source]

Write calculated apparent activation energies to Excel

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • jobs_name (list) – List of job_array names

  • output_path (str) – Path to save output excel file

descmap.analysis.chemkin.write_model_output(main_path, desc_name, jobs_name, output_path, inputs)[source]

Write Chemkin outputs to Excel

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • desc_name (list) – List of descriptor names

  • jobs_name (list) – List of job_array names

  • output_path (str) – Path to save output excel file

  • inputs (dict) – Inputs read from excel sheet. Keys correspond to sheet names.

descmap.analysis.chemkin.write_rxn_order(main_path, jobs_name, reactant_name, output_path)[source]

Write calculated reaction orders to Excel

Parameters:
  • main_path (str) – Path to descmap main folder (MKM parent folder)

  • jobs_name (list) – List of job_array names

  • reactant_name (str) – Name of reactant to calculate the reaction order

  • output_path (str) – Path to save output excel file


Plot

Functionality to plot interactive graphs

descmap.analysis.plot.plot_1d_simple(path_out, x, y, title, x_label, y_label, ticketformat, ymin_cutoff=None, ymax_cutoff=None)[source]

Creates a simple 1d volcano plot using Plotly

Parameters:
  • path_out (str) – Name of file (ending with .html extension)

  • x (list) – x data to plot

  • y (list) – y data to plot

  • title (str) – Title of plot

  • x_label (str) – x axis label

  • y_label (str) – y axis label

  • ymin_cutoff (float, optional) – Minimum cutoff y value. The minimum of y will be used if it is higher than ymin_cutoff or if ymin_cutoff is not specified.

  • ymax_cutoff (float, optional) – Maximum cutoff y value. The maximum of y will be used if it is higher than ymax_cutoff of ir ymax_cutoff is not specified.

descmap.analysis.plot.plot_1d_volcano(path_out, x, y, title, x_label, y_label, hover_label, x_lit=None, lit_label=None, ymin_cutoff=None, ymax_cutoff=None)[source]

Creates a Contour plot using Plotly

Parameters:
  • path_out (str) – Name of file (ending with .html extension)

  • x (list) – x data to plot

  • y (list) – y data to plot

  • title (str) – Title of plot

  • x_label (str) – x axis label

  • y_label (str) – y axis label

  • ymin_cutoff (float, optional) – Minimum cutoff y value. The minimum of y will be used if it is higher than ymin_cutoff or if ymin_cutoff is not specified.

  • ymax_cutoff (float, optional) – Maximum cutoff y value. The maximum of y will be used if it is higher than ymax_cutoff of ir ymax_cutoff is not specified.

descmap.analysis.plot.plot_contour(path_out, x, y, z, title, x_label, y_label, hover_label, x_lit=None, y_lit=None, lit_label=None, zmin_cutoff=None, zmax_cutoff=None, x_scaling=None, y_scaling=None, y_scaling_upper=None, y_scaling_lower=None)[source]

Creates a Contour plot using Plotly

Parameters:
  • path_out (str) – Name of file (ending with .html extension)

  • x (list) – x data to plot

  • y (list) – y data to plot

  • z (list) – z data to plot

  • title (str) – Title of plot

  • x_label (str) – x axis label

  • y_label (str) – y axis label

  • zmin_cutoff (float, optional) – Minimum cutoff z value. The minimum of z will be used if it is higher than zmin_cutoff or if zmin_cutoff is not specified.

  • zmax_cutoff (float, optional) – Maximum cutoff z value. The maximum of z will be used if it is higher than zmax_cutoff of ir zmax_cutoff is not specified.

descmap.analysis.plot.plot_coverage(jobs_name, cov_dict_list, species_list, path)[source]

Creates surface coverage plots using Matplotlib

Parameters:
  • jobs_name (list) – List of descriptor names

  • cov_dict_list (list) – List of dictionaries containing surface species

  • species_list (list) – List of surface species

  • path (str) – Path to save output figures

descmap.analysis.plot.plot_density(path_out, jobs_data, desc_labels, conv_data, selec_data, yield_data, reactant_name, product_name, hover_label, lit_data=None, design_space_mask=None, conv_min_cutoff=0.0, conv_max_cutoff=1.0, selec_min_cutoff=0.0, selec_max_cutoff=1.0, yield_min_cutoff=0.0, yield_max_cutoff=1.0)[source]

Plots a density map normalized to x axis slices

Parameters:
  • path_out (str) – Name of file (ending with .html extension)

  • x (list) – x data to plot

  • y (list) – y data to plot

  • title (str) – Title of plot

  • x_label (str) – x axis label

  • y_label (str) – y axis label

  • kwargs (keyword arguments) – Keyword arguments for numpy.histogram2d

descmap.analysis.plot.plot_ols(path_out, x, y, title, x_label, y_label, tickformat, ymin_cutoff=None, ymax_cutoff=None)[source]

Creates ordinary least squares (OLS) regression plot using Plotly

Parameters:
  • path_out (str) – Name of file (ending with .html extension)

  • x (list) – x data to plot

  • y (list) – y data to plot

  • title (str) – Title of plot

  • x_label (str) – x axis label

  • y_label (str) – y axis label

  • ymin_cutoff (float, optional) – Minimum cutoff y value. The minimum of y will be used if it is higher than ymin_cutoff or if ymin_cutoff is not specified.

  • ymax_cutoff (float, optional) – Maximum cutoff y value. The maximum of y will be used if it is higher than ymax_cutoff of ir ymax_cutoff is not specified.

  • tickformat (str) – Specify number of decimals to keep in ticks