vibesketch.document.spectra¶
Calculated IR, Raman and UV-Vis spectra of a run’s result (#87).
A verified result keeps the vibrations and excited states its output lists
(ResultVibrations,
ResultExcitedStates). This module reads
them from an ORCA 6 output or a vibe-qc QVF result, and exports a spectrum’s
line list (CSV or plain text) and its broadened curve (plain text) with the
units, source and grid in the file’s header.
Broadening follows vibe-view’s vibeview.spectrum.broaden_lines so the two
programs draw the same curve: unit-area Gaussian and Cauchy (Lorentzian)
densities with scale FWHM / sqrt(8 ln 2) and FWHM / 2,
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.cauchy.html
Lines are broadened in energy (cm⁻¹ for vibrations, eV for excited states)
and the curve is then sampled on the chosen axis, so a wavelength axis is
never broadened in nm. A finite range truncates the tails; the curve is not
renormalised to hide that.
ORCA’s table vocabulary: ORCA 6.1 manual, Frequencies and Excited states, https://www.faccts.de/docs/orca/6.1/manual/contents/spectroscopyproperties/ir.html https://www.faccts.de/docs/orca/6.1/manual/contents/spectroscopyproperties/uvvis.html
Module Attributes
10 cm⁻¹ for vibrations, 0.2 eV for excited states. |
|
The most points a broadened curve may have, as in vibe-view. |
|
The media type of each export format. |
Functions
|
A spectrum broadened with a Gaussian or Lorentzian line shape, as plain text. |
|
The export |
|
The absorption lines ORCA 6 prints from the transition electric dipoles. |
|
The vibrations of an ORCA 6 frequency output, with its IR and Raman lines. |
|
The states of a QVF |
|
The vibrations of a QVF |
|
A spectrum's line list, with explicit units; an intensity not given is left blank. |
Classes
|
What to export from a run's spectrum: its line list, or its broadened curve. |
Exceptions
A spectrum the result does not contain, or an export that cannot be made as asked. |
- vibesketch.document.spectra.DEFAULT_FWHM = {'ir': 10.0, 'raman': 10.0, 'uvvis': 0.2}¶
10 cm⁻¹ for vibrations, 0.2 eV for excited states.
- Type:
vibe-view’s default widths
- vibesketch.document.spectra.MAX_POINTS = 1000000¶
The most points a broadened curve may have, as in vibe-view.
- vibesketch.document.spectra.MEDIA_TYPES = {'broadened': 'text/plain; charset=utf-8', 'csv': 'text/csv; charset=utf-8', 'text': 'text/plain; charset=utf-8'}¶
The media type of each export format.
- class vibesketch.document.spectra.SpectrumExport(*, run, spectrum, format='csv', lineshape='lorentzian', fwhm=None, fwhm_unit=None, axis=None, start=None, stop=None, step=None)[source]¶
Bases:
BaseModelWhat to export from a run’s spectrum: its line list, or its broadened curve.
- Parameters:
run (str)
spectrum (Literal['ir', 'raman', 'uvvis'])
format (Literal['csv', 'text', 'broadened'])
lineshape (Literal['gaussian', 'lorentzian'])
fwhm (float | None)
fwhm_unit (Literal['cm-1', 'eV'] | None)
axis (Literal['cm-1', 'eV', 'nm'] | None)
start (float | None)
stop (float | None)
step (float | None)
- model_config = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- spectrum: Spectrum¶
- format: Literal['csv', 'text', 'broadened']¶
- lineshape: Lineshape¶
- exception vibesketch.document.spectra.SpectrumRefused[source]¶
Bases:
ValueErrorA spectrum the result does not contain, or an export that cannot be made as asked.
- vibesketch.document.spectra.broadened_spectrum(document, run_id, spectrum, *, lineshape='lorentzian', fwhm=None, fwhm_unit=None, axis=None, start=None, stop=None, step=None)[source]¶
A spectrum broadened with a Gaussian or Lorentzian line shape, as plain text.
fwhmis infwhm_unit(cm-1 or eV; the spectrum’s own by default),axisis cm-1 for vibrations and eV, nm or cm-1 for excited states, andstart,stopandstepgive the grid in the axis unit. The curve is the sum of unit-area lines scaled by their intensities: its unit is the intensity’s per native unit. Lines without an intensity are left out and counted in the header.
- vibesketch.document.spectra.export_spectrum(document, request)[source]¶
The export
requestasks for: a CSV or text line list, or a broadened curve.- Parameters:
document (Document)
request (SpectrumExport)
- Return type: