shnitsel.vis.datasheet.figures.soc_trans_hist#

Functions#

plot_energy_histogram(inter_state, state_selection[, ...])

Create the alternative to spectra plots where the oscillator strength is not available.

single_trans_hist(interstate, xvariable, yvariable, ...)

Function to plot a single histogram of interstate soc data vs. energy gaps.

single_soc_trans_hist(interstate, sc_label, ...[, ...])

Function to plot a single histogram of interstate data.

single_dip_trans_hist(interstate, sc_label, ...[, ...])

Function to plot a single histogram of interstate dip_trans data.

plot_soc_or_dip_trans_histograms(inter_state, ...[, ...])

Function to plot all relevant histograms for the provided inter_state data

plot_separated_spectra_and_soc_dip_hists(inter_state, ...)

Create separate spectra plots for ground and excited states.

plot_separated_spectra_and_soc_dip_hists_groundstate(...)

Function to plot separated spectra and histograms of ground state data only.

Module Contents#

plot_energy_histogram(inter_state, state_selection, ax=None, bins=100, cmap=None, cnorm=None, mark_peaks=False, rasterized=False)#

Create the alternative to spectra plots where the oscillator strength is not available.

Parameters:
  • inter_state (InterState) – Interstate data to get delta energy histograms from

  • state_selection (StateSelection) – State selection object to limit the states included in plotting and to provide state names.

  • ax (Axes, optional) – Axis object to plot into. If not provided, will be created.

  • bins (int, optional) – Optional number of bins for histogram creation. Defaults to 100.

  • cmap (str | Colormap, optional) – Optional specification of a desired colormap. Defaults to None.

  • cnorm (Normalize, optional) – Optional specification of a colormap norm method. Defaults to None.

  • mark_peaks (bool, optional) – Flag whether peaks should be clearly marked. Defaults to False.

  • rasterized (bool, optional) – Flag to control whether the histogram plot should be rasterized to cut down on loading times and file sizes in complex plot environments.

Returns:

The axes object into which the graph was plotted

Return type:

Axes

single_trans_hist(interstate, xvariable, yvariable, state_labels, color, xlabel=None, ylabel=None, bins=100, ax=None, plot_marginals=True, cmap=None, cnorm=None, rasterized=True)#

Function to plot a single histogram of interstate soc data vs. energy gaps.

Parameters:
  • interstate (InterState) – Inter-state Dataset

  • xvariable (str) – Name of the interstate variable to use for the x-axis.

  • yvariable (str) – Name of the interstate variable to use for the y-axis.

  • xlabel (str, optional) – Label for the x-axis. Defaults to None.

  • ylabel (str, optional) – Label for the y-axis. Defaults to None.

  • sc_label (str) – Label to use for the state combination.

  • state_labels (tuple[str,str]) – Labels for the individual states.

  • color (str) – Color for the histogram of this state combination.

  • bins (int, optional) – Number of bins for the histogram. Defaults to 100.

  • ax (Axes, optional) – Axes object to plot into. Defaults to None.

  • plot_marginals (bool, optional) – Flag to include marginal histograms. Defaults to True, meaning marginal histograms will be included.

  • cmap (str, optional) – Colormap to use. Defaults to None.

  • cnorm (str, optional) – Norming method to apply to the colormap. Defaults to None.

  • rasterized (bool, optional) – Flag to control whether the histogram plot should be rasterized to cut down on loading times and file sizes in complex plot environments.

Return type:

The result of ax.hist2d will be returned.

None

is returned if data is missing

single_soc_trans_hist(interstate, sc_label, state_labels, color, bins=100, ax=None, plot_marginals=True, cmap=None, cnorm=None, rasterized=True)#

Function to plot a single histogram of interstate data.

Used for both delta_E vs. mu and delta_E vs SOC plots.

Parameters:
  • interstate (InterState) – Inter-state Dataset

  • sc_label (str) – Label to use for the state combination.

  • state_labels (tuple[str,str]) – Labels for the individual states.

  • color (str) – Color for the histogram of this state combination.

  • bins (int, optional) – Number of bins for the histogram. Defaults to 100.

  • ax (Axes, optional) – Axes object to plot into. Defaults to None.

  • plot_marginals (bool, optional) – Flag to include marginal histograms. Defaults to True, meaning marginal histograms will be included.

  • cmap (str, optional) – Colormap to use. Defaults to None.

  • cnorm (str, optional) – Norming method to apply to the colormap. Defaults to None.

  • rasterized (bool, optional) – Flag to control whether the histogram plot should be rasterized to cut down on loading times and file sizes in complex plot environments.

Returns:

  • The result of ax.hist2d will be returned.

  • None is returned if data is missing

single_dip_trans_hist(interstate, sc_label, state_labels, color, bins=100, ax=None, plot_marginals=True, cmap=None, cnorm=None, rasterized=True)#

Function to plot a single histogram of interstate dip_trans data.

Parameters:
  • interstate (InterState) – Inter-state Dataset

  • sc_label (str) – Label to use for the state combination.

  • state_labels (tuple[str,str]) – Labels for the individual states.

  • color (str) – Color for the histogram of this state combination.

  • bins (int, optional) – Number of bins for the histogram. Defaults to 100.

  • ax (Axes, optional) – Axes object to plot into. Defaults to None.

  • plot_marginals (bool, optional) – Flag to include marginal histograms. Defaults to True, meaning marginal histograms will be included.

  • cmap (str, optional) – Colormap to use. Defaults to None.

  • cnorm (str, optional) – Norming method to apply to the colormap. Defaults to None.

  • rasterized (bool, optional) – Flag to control whether the histogram plot should be rasterized to cut down on loading times and file sizes in complex plot environments.

Return type:

The result of ax.hist2d will be returned

plot_soc_or_dip_trans_histograms(inter_state, state_selection, axs=None, cnorm=None)#

Function to plot all relevant histograms for the provided inter_state data

Parameters:
  • inter_state (InterState) – Inter-state data to get the transitional dipole data from.

  • state_selection (StateSelection) – State selection object to limit the states included in plotting and to provide state names.

  • axs (Axes, optional) – Axes objects to plot into. If not provided, will be created.

  • cnorm (str, optional) – Optional specification of a colormap norm method. Defaults to None.

Returns:

The list of the results of hist2d() calls for the provided data in inter_state

Return type:

list

plot_separated_spectra_and_soc_dip_hists(inter_state, spectra_groups, state_selection, fig=None, axs=None, cb_spec_vlines=True, current_multiplicity=None)#

Create separate spectra plots for ground and excited states.

Parameters:
  • inter_state (InterState) – The interstate data to use for the spectra plots

  • spectra_groups (tuple[SpectraDictType, SpectraDictType]) – Spectra separated into ground state spectra and excited spectra.

  • state_selection (StateSelection) – State selection object to limit the states included in plotting and to provide state names.

  • fig (Figure| SubFigure) – A figure, consumed by the automatic axes generation. Not used by the function itself.

  • axs (dict[str,Axes], optional) – Axis dictionary object to plot into.

  • cb_spec_vlines (bool, optional) – Whether to mark spectral lines in the energy spectrum. Defaults to True.

  • current_multiplicity (int, optional) – Can denote the current multiplicity to change the way we plot the ground state and/or excited state transitions.

Returns:

The axes dict after plotting to it.

Return type:

dict[str, Axes]

plot_separated_spectra_and_soc_dip_hists_groundstate(inter_state, spectra_groups, state_selection, fig=None, axs=None, cb_spec_vlines=True, scmap=plt.get_cmap('turbo'))#

Function to plot separated spectra and histograms of ground state data only.

Parameters:
  • inter_state (InterState) – Inter-State dataset containing energy differences

  • spectra_groups (tuple[SpectraDictType, SpectraDictType]) – Tuple holding the spectra groups of ground-state transitions and excited-state transitions.

  • state_selection (StateSelection) – State selection object to limit the states included in plotting and to provide state names.

  • fig (Figure | SubFigure | None, optional) – Figure to plot the graphs to. Defaults to None.

  • axs (dict[str, Axes] | None, optional) – Dict of named axes to plot to. Defaults to None.

  • cb_spec_vlines (bool, optional) – Flag to enable vertical lines in the time-dependent spectra. Defaults to True.

  • scmap (Colormap, optional) – State combination colormap. Defaults to plt.get_cmap(‘turbo’).

Raises:

ValueError – Too few statecombs (expecting at least 2 states => 1 statecomb)

Returns:

dict[str, Axes]

Return type:

The labeled axes after plotting