ramannoodle.spectrum¶
Classes and functions for calculating and manipulating spectra.
- class ramannoodle.spectrum.MDRamanSpectrum(polarizability_ts, timestep)¶
Bases:
RamanSpectrumMolecular-dynamics-based Raman spectrum.
The spectrum is specified by a polarizability time series (
polarizability_ts) and a timestep.- Parameters:
- measure(orientation='polycrystalline', laser_correction=False, laser_wavelength=522, bose_einstein_correction=False, temperature=300)¶
Calculate and return a raw Raman spectrum.
Note
Raw MD-derived Raman spectra will typically need to be smoothed to be visualized effectively. See
spectrum_utils.convolve_spectrum().- Parameters:
orientation (
str|ndarray[Any,dtype[float64]]) – Supports"polycrystalline". Future versions will support arbitrary orientations.laser_correction (
bool) – IfTrue, applies laser-wavelength-dependent intensity correction.laser_wavelength (
float) – (nm) Ignored iflaser_correction == False.bose_einstein_correction (
bool) – IfTrue, applies temperature-dependent Bose Einstein correction.temperature (
float) –Ignored if
bose_einstein_correction == False.
- Return type:
tuple[ndarray[Any,dtype[float64]],ndarray[Any,dtype[float64]]]- Returns:
wavenumbers – (cm-1) Array with shape (ceiling(S / 2),) where S is the number of configurations.
intensities – (arbitrary units) Array with shape (ceiling(S / 2),).
- class ramannoodle.spectrum.PhononRamanSpectrum(phonon_wavenumbers, raman_tensors)¶
Bases:
RamanSpectrumPhonon-based first-order Raman spectrum.
The spectrum is specified by a list of phonon wavenumbers and corresponding Raman tensors.
- Parameters:
- measure(orientation='polycrystalline', laser_correction=False, laser_wavelength=522, bose_einstein_correction=False, temperature=300)¶
Calculate and return a raw Raman spectrum.
- Parameters:
orientation (
str|ndarray[Any,dtype[float64]]) – Supports"polycrystalline". Future versions will support arbitrary orientations.laser_correction (
bool) – IfTrue, applies laser-wavelength-dependent intensity correction.laser_wavelength (
float) – (nm) Ignored iflaser_correction == False.bose_einstein_correction (
bool) – IfTrue, applies temperature-dependent Bose Einstein correction.temperature (
float) –Ignored if
bose_einstein_correction == False.
- Return type:
tuple[ndarray[Any,dtype[float64]],ndarray[Any,dtype[float64]]]- Returns:
wavenumbers – (cm-1) Array with shape (M,).
intensities – (arbitrary units) Array with shape (M,).
- Raises:
NotImplementedError – Raised when any orientation besides
"polycrystalline"is supplied.
Submodules¶
ramannoodle.spectrum.utils module¶
Utility functions for spectra.
- ramannoodle.spectrum.utils.calc_signal_spectrum(signal, sampling_rate)¶
Calculate a signal’s spectrum.
The spectrum is defined as the positive-frequency Fourier transform of the signal’s autocorrelation.
- ramannoodle.spectrum.utils.convolve_spectrum(wavenumbers, intensities, function='gaussian', width=5, out_wavenumbers=None)¶
Convolve a spectrum, producing a smoothing effect.
- Parameters:
wavenumbers (
ndarray[Any,dtype[float64]]) – (cm-1) Array with shape (M,).intensities (
ndarray[Any,dtype[float64]]) – (arbitrary units) Array with shape (M,).function (
str) – Supports"gaussian"or"lorentzian".width (
float) – (cm-1)out_wavenumbers (
ndarray[Any,dtype[float64]] |None) – (cm-1) Array with shape (L,) where L is arbitrary. IfNone,out_wavenumbersis determined automatically.
- Return type:
tuple[ndarray[Any,dtype[float64]],ndarray[Any,dtype[float64]]]- Returns:
wavenumbers (
out_wavenumbers) – (cm-1) Array with shape (L,).intensities – (arbitrary units) Array with shape (L,).