Spectra module

SpectraTask

class esteem.tasks.spectra.SpectraTask(**kwargs)[source]
main(fig=None, ax=None, plotlabel=None, rgb=array([0., 0., 0.]))[source]

Main routine for plotting a spectrum. Capable of applying Gaussian broadening to a stick spectrum to produce a broadened spectrum, and also of applying spectral warping to shift/scale the stick spectrum.

Arguments:

args: namespace or class
All arguments for the job - see documentation below.
fig, ax: matplotlib objects
Figure and axis objects for matplotlib.pyplot. Initialised anew if they have value None on entry.
plotlabel:
Label to add the key for this dataset.
rgb:
Colour of the line/points for this dataset. If set to (-1.0,-1.0,-1.0), the RGB colour will be calculated from the spectrum.

Returns:

broad_spectrum,spec_plot,fig,ax,all_transition_origins

Output:

Plots the spectrum to ‘args.output’ as a png file if requested.
find_spectral_warp_params(dest_spectrum, origin_spectrum, arrow1_pos, arrow2_pos)[source]

Finds spectral warping parameters via a range of schemes. See spectra documentation page for more detail.

Arguments

dest_spectrum: numpy array of floats
Contains the spectral warp ‘destination’ spectrum (usually a high level of theory that can only be afforded for the solute molecule)
origin_spectrum: numpy array of floats
Contains the spectral warp ‘origin’ spectrum (usually a cheap level of theory, same as in the Clusters job)
args.warp_scheme: str
The scheme used for the warping. Allowed values: ‘beta’, ‘alphabeta’, ‘betabeta’
args.warp_origin_ref_peak_range: list of 2 floats
Peak range searched when looking for ‘reference’ peaks in the origin spectrum for spectral warping.
args.warp_dest_ref_peak_range: list of 2 floats
Peak range searched when looking for ‘reference’ peaks in the destination spectrum for spectral warping.
args.broad:
Energy gaussian broadening applied to the stick spectra, useful to merge peaks that you want to treat as one peak in spectral warping.

Returns

[beta], [alpha, beta], [beta1, beta2, omega1o, omega2o]: floats describing spectral warp parameters

Also sets arrow1_pos, arrow2_pos for use in spectral warp plots.

Standalone module routines

Task that generates and plots uv/vis Spectra for solutes in solvent. Also contains routines to calculate spectral warp parameters and RGB colours from spectra

esteem.tasks.spectra.RGB_colour(spectrum, args)[source]

Finds the RGB colour corresponding to a given absorption spectrum and illumination.

spectrum: numpy array
Spectrum for which to find the colour
args: namespace or class

Full set of arguments for the spectra task. Relevant to this routine are:

args.XYZresponse and args.illuminant which supply the Color Space XYZ response spectra and the illuminant spectrum, respectively.

These must be on the same wavelength scale as the spectrum.

Command-line usage