spectrochempy.correlation_spectroscopy#
- correlation_spectroscopy(dataset: NDDataset, perturbation_dim: str = "y", ) -> Correlation2DResult: r""" Calculate synchronous and asynchronous 2D correlation spectra. Spectra are mean-centered along the perturbation dimension. The synchronous map is calculated as ``A.T @ A / (n - 1)``; the asynchronous map uses the Hilbert–Noda matrix ``N[i, j] = 1 / (pi * (j - i))`` for ``i != j`` and ``A.T @ N @ A / (n - 1)``. The asynchronous sign follows the input order of the perturbation sequence. The perturbation coordinate must be real numeric, monotonic, and classified as linear by its SpectroChemPy ``Coord``. This classification follows the coordinate's ``sigdigits`` and ``linearize_below`` settings. A default ``Coord`` uses ``linearize_below=0.1`` and may normalize a near-linear source axis before this function sees it. Configure ``linearize_below`` when constructing the coordinate if source deviations must remain visible to this validation. Parameters ---------- dataset : NDDataset Two-dimensional spectral data. One dimension represents the ordered perturbation sequence; the other represents the spectral coordinate. perturbation_dim : str, default: "y" Dimension containing the perturbation sequence. Returns ------- Correlation2DResult Result with ``synchronous`` and ``asynchronous`` NDDataset maps. Both maps use the input spectral coordinate on their ``y`` and ``x`` axes, and their units are the square of the input signal units. Raises ------ TypeError If *dataset* is not an NDDataset or its values are not real numeric data. ValueError If the input is not two-dimensional, has fewer than two perturbation points, contains masked or non-finite values, or has a complex, non-monotonic, or non-uniform perturbation coordinate. Notes ----- The Hilbert–Noda transform assumes equally spaced perturbation points. The function follows the ``Coord.linear`` classification rather than applying a second numeric tolerance to coordinate differences. References ---------- I. Noda, "Generalized Two-Dimensional Correlation Method Applicable to Infrared, Raman, and Other Types of Spectroscopy", Applied Spectroscopy 47, 1329–1336 (1993), https://doi.org/10.1366/0003702934067694. """ if not isinstance(dataset, NDDataset)[source]#
Calculate synchronous and asynchronous 2D correlation spectra.
Spectra are mean-centered along the perturbation dimension. The synchronous map is calculated as
A.T @ A / (n - 1); the asynchronous map uses the Hilbert–Noda matrixN[i, j] = 1 / (pi * (j - i))fori != jandA.T @ N @ A / (n - 1). The asynchronous sign follows the input order of the perturbation sequence.The perturbation coordinate must be real numeric, monotonic, and classified as linear by its SpectroChemPy
Coord. This classification follows the coordinate’ssigdigitsandlinearize_belowsettings. A defaultCoorduseslinearize_below=0.1and may normalize a near-linear source axis before this function sees it. Configurelinearize_belowwhen constructing the coordinate if source deviations must remain visible to this validation.- Parameters:
dataset (NDDataset) – Two-dimensional spectral data. One dimension represents the ordered perturbation sequence; the other represents the spectral coordinate.
perturbation_dim (str, default: “y”) – Dimension containing the perturbation sequence.
- Returns:
Correlation2DResult – Result with
synchronousandasynchronousNDDataset maps. Both maps use the input spectral coordinate on theiryandxaxes, and their units are the square of the input signal units.- Raises:
TypeError – If dataset is not an NDDataset or its values are not real numeric data.
ValueError – If the input is not two-dimensional, has fewer than two perturbation points, contains masked or non-finite values, or has a complex, non-monotonic, or non-uniform perturbation coordinate.
Notes
The Hilbert–Noda transform assumes equally spaced perturbation points. The function follows the
Coord.linearclassification rather than applying a second numeric tolerance to coordinate differences.References
I. Noda, “Generalized Two-Dimensional Correlation Method Applicable to Infrared, Raman, and Other Types of Spectroscopy”, Applied Spectroscopy 47, 1329–1336 (1993), https://doi.org/10.1366/0003702934067694.
Examples using spectrochempy.correlation_spectroscopy#
Explore an IR activation series with Noda’s 2D-COS