hqs_nmr.visualization
Visualization module.
Functions
|
Determine the maximum of y excluding a specific region of x values. |
|
Plot simulated and experimental spectra in one graph. |
- hqs_nmr.visualization.maximum_excluding_region(x: ndarray, y: ndarray, exclude: tuple[float, float] | None = None) float [source]
Determine the maximum of y excluding a specific region of x values.
- Parameters:
x – Values of x.
y – Values of y.
exclude – Region of x values to exclude. Find the overall maximum of y if set to None.
- Returns:
The appropriate maximum value of y.
- hqs_nmr.visualization.plot_spectra(simulated: NMRSpectrum1D | NMRGreensFunction1D, experimental: NMRExperimentalSpectrum1D, left: float = 10.0, right: float = 0.0, exclude: tuple[float, float] | None = None, ax: Axes | None = None, scale_experimental: Literal['max-intensity', 'max-intensity-window', 'factor'] = 'max-intensity', scale_experimental_factor: float = 1.0) None [source]
Plot simulated and experimental spectra in one graph.
The simulated spectrum is in orange and upright. The experimental spectrum is in grey and upside down.
- Parameters:
simulated – Object storing the simulated spectrum.
experimental – Object storing the experimental spectrum.
left – Left margin of the plot in ppm.
right – Right margin of the plot in ppm.
exclude – Region to exclude for normalizing the spectrum (for the solvent peak).
ax – Draw spectra in the specified Matplotlib axes.
scale_experimental – Defines the scaling mode for the experimental spectrum: - “max-intensity” rescales the experimental spectrum so that the largest intensity value is equal to one. - “max-intensity-window” rescales the experimental spectrum so that the largest intensity value within the current viewport (defined by left and right) is equal to one. - “factor” rescales the experimental spectrum with respect to the given scaling factor.
scale_experimental_factor – Scaling factor for experimental spectrum that is only applied if the scaling mode (scale_experimental) is chosen to be “factor”.