spectrum
Spectrum module.
- daltonproject.spectrum.convolute_one_photon_absorption(excitation_energies: ~numpy.ndarray, oscillator_strengths: ~numpy.ndarray, energy_range: ~numpy.ndarray, broadening_function: ~typing.Callable[[~numpy.ndarray, float, float], ~numpy.ndarray] = <function gaussian>, broadening_factor: float = 0.4) ndarray
Convolute one-photon absorption.
The convolution is based on the equations of: A. Rizzo, S. Coriani, and K. Ruud, in Computational Strategies for Spectroscopy. From Small Molecules to Nano Systems, edited by V. Barone (John Wiley and Sons, 2012) Chap. 2, pp. 77–135
- Parameters
excitation_energies – Excitation energies in eV.
oscillator_strengths – Oscillator strengths.
energy_range – Energy range of the spectrum in eV.
broadening_function – Broadening function.
broadening_factor – Broadening factor in eV.
- Returns
Convoluted spectrum of molar absorptivity in L / (mol * cm).
- daltonproject.spectrum.convolute_two_photon_absorption(excitation_energies: ~numpy.ndarray, two_photon_strengths: ~numpy.ndarray, energy_range: ~numpy.ndarray, broadening_function: ~typing.Callable[[~numpy.ndarray, float, float], ~numpy.ndarray] = <function lorentzian>, broadening_factor: float = 0.1) ndarray
Convolute two-photon absorption.
- Parameters
excitation_energies – Excitation energies in eV.
two_photon_strengths – Two-photon absorption strengths in au.
energy_range – Energy range of the spectrum in eV.
broadening_function – Broadening function.
broadening_factor – Broadening factor in eV.
- Returns
Convoluted spectrum of two-photon absorption cross-section in GM.
- daltonproject.spectrum.convolute_vibrational_spectrum(vibrational_frequencies: ~numpy.ndarray, intensities: ~numpy.ndarray, energy_range: ~numpy.ndarray, broadening_function: ~typing.Callable[[~numpy.ndarray, float, float], ~numpy.ndarray] = <function lorentzian>, broadening_factor: float = 3.0) ndarray
Convolute vibrational spectrum (e.g. IR and Raman).
- Parameters
vibrational_frequencies – Vibrational frequencies in cm^-1.
intensities – Intensities in SI unit.
energy_range – Energy range of the spectrum in cm^-1.
broadening_function – Broadening function.
broadening_factor – Broadening factor in cm^-1.
- Returns
Convoluted spectrum in unit of the intensities * s.
- daltonproject.spectrum.gaussian(x: ndarray, x0: float, broadening_factor: float) ndarray
Calculate normalized Gaussian broadening function.
- Parameters
x – Where to evaluate the Gaussian.
x0 – Center of Gaussian.
broadening_factor – Half width at half maximum.
- Returns
A Gaussian.
- daltonproject.spectrum.lorentzian(x: ndarray, x0: float, broadening_factor: float) ndarray
Calculate normalized Lorentzian broadening function.
- Parameters
x – Where to evaluate the Lorentzian.
x0 – Center of Lorentzian.
broadening_factor – Half width at half maximum.
- Returns
A Lorentzian.
- daltonproject.spectrum.plot_ir_spectrum(vibrational_analysis: ~daltonproject.vibrational_analysis.VibrationalAnalysis, ax: ~typing.Optional[~matplotlib.axes._axes.Axes] = None, energy_range: ~typing.Optional[~numpy.ndarray] = None, broadening_function: ~typing.Callable[[~numpy.ndarray, float, float], ~numpy.ndarray] = <function lorentzian>, broadening_factor: float = 3.0, **plot_kwargs) Axes
Plot IR spectrum.
- Parameters
vibrational_analysis – VibrationalAnalysis object that contains frequencies in cm^-1 and IR intensities in m^2 / (s * mol).
ax – Axes object (matplotlib). If specified, plot will be added to the provided Axes object, otherwise a new one is created.
energy_range – Energy range of the plot in cm^-1. It will be generated from the vibrational frequencies if it is not specified.
broadening_function – Broadening function.
broadening_factor – Broadening factor in cm^-1.
plot_kwargs – Optional keyword arguments to be passed directly to the matplotlib plot function (for example color=’k’).
- Returns
Axes object with a plot of energy (cm^-1) vs molar absorptivity (m^2 / mol).
- daltonproject.spectrum.plot_one_photon_spectrum(output: ~daltonproject.program.OutputParser, ax: ~typing.Optional[~matplotlib.axes._axes.Axes] = None, energy_range: ~typing.Optional[~numpy.ndarray] = None, broadening_function: ~typing.Callable[[~numpy.ndarray, float, float], ~numpy.ndarray] = <function gaussian>, broadening_factor: float = 0.4, **plot_kwargs) Axes
Plot one-photon absorption spectrum.
- Parameters
output – OutputParser object that contains excitation energies in eV and oscillator strengths.
ax – Axes object (matplotlib). If specified, plot will be added to the provided Axes object, otherwise a new one is created.
energy_range – Energy range of the plot in eV. It will be generated from the excitation energies if it is not specified.
broadening_function – Broadening function.
broadening_factor – Broadening factor in eV.
plot_kwargs – Optional keyword arguments to be passed directly to the matplotlib plot function (for example color=’k’).
- Returns
Axes object with a plot of energy (eV) vs molar absorptivity (L / (mol * cm)).
- daltonproject.spectrum.plot_raman_spectrum(vibrational_analysis: ~daltonproject.vibrational_analysis.VibrationalAnalysis, ax: ~typing.Optional[~matplotlib.axes._axes.Axes] = None, energy_range: ~typing.Optional[~numpy.ndarray] = None, broadening_function: ~typing.Callable[[~numpy.ndarray, float, float], ~numpy.ndarray] = <function lorentzian>, broadening_factor: float = 3.0, **plot_kwargs) Axes
Plot Raman spectrum.
- Parameters
vibrational_analysis – VibrationalAnalysis object that contains frequencies in cm^-1 and Raman intensities in C^4*s^2/(J*m^2*kg).
ax – Axes object (matplotlib). If specified, plot will be added to the provided Axes object, otherwise a new one is created.
energy_range – Energy range of the plot in cm^-1. It will be generated from the vibrational frequencies if it is not specified.
broadening_function – Broadening function.
broadening_factor – Broadening factor in cm^-1.
plot_kwargs – Optional keyword arguments to be passed directly to the matplotlib plot function (for example color=’k’).
- Returns
Axes object with a plot of energy (cm^-1) vs Raman scattering cross-section (C^4*s^3/(J*m^2*kg)).
- daltonproject.spectrum.plot_spectrum(x: ndarray, y: ndarray, xlabel: str, ylabel: str, ax: Axes, **plot_kwargs) Axes
Plot spectrum.
- daltonproject.spectrum.plot_two_photon_spectrum(output: ~daltonproject.program.OutputParser, ax: ~typing.Optional[~matplotlib.axes._axes.Axes] = None, energy_range: ~typing.Optional[~numpy.ndarray] = None, broadening_function: ~typing.Callable[[~numpy.ndarray, float, float], ~numpy.ndarray] = <function gaussian>, broadening_factor: float = 0.4, **plot_kwargs) Axes
Plot two-photon absorption spectrum.
- Parameters
output – OutputParser object that contains excitation energies in eV and two-photon absorption strengths in au.
ax – Axes object (matplotlib). If specified, plot will be added to the provided Axes object, otherwise a new one is created.
energy_range – Energy range of the plot in eV. It will be generated from the excitation energies if it is not specified.
broadening_function – Broadening function.
broadening_factor – Broadening factor in eV.
plot_kwargs – Optional keyword arguments to be passed directly to the matplotlib plot function (for example color=’k’).
- Returns
Axes object with a plot of energy (eV) vs two-photon absorption cross-section (GM).