hqs_nmr.visualization

Visualization module.

Functions

maximum_excluding_region(x, y[, exclude])

Determine the maximum of y excluding a specific region of x values.

plot_spectra(simulated, experimental[, ...])

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) 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).