IRIS: 2D-IRIS analysis (plugin)

This example introduces 2D-IRIS analysis of CO adsorption on a sulfide catalyst with the optional spectrochempy-iris plugin.

Requires the official spectrochempy-iris plugin. Install with: pip install spectrochempy[iris].

import spectrochempy as scp

Loading and coordinating the dataset

The example data contain infrared spectra recorded during CO adsorption. The dataset has wavenumber coordinates along x and acquisition timestamps along y.

X = scp.read_omnic("irdata/CO@Mo_Al2O3.SPG")
X.coordset
CoordSet — x:wavenumbers, y:acquisition timestamp (GMT)
Dimension `x`
size
:
3112
title
:
wavenumbers
coordinates
:
[ 4000 3999 ... 1001 999.9] cm⁻¹
Dimension `y`
size
:
19
title
:
acquisition timestamp (GMT)
coordinates
:
[1.477e+09 1.477e+09 ... 1.477e+09 1.477e+09] s
labels
:
[[ 2016-10-18 13:49:35+00:00 2016-10-18 13:54:06+00:00 ... 2016-10-18 16:01:33+00:00 2016-10-18 16:06:37+00:00]
[ *Résultat de Soustraction:04_Mo_Al2O3_calc_0.003torr_LT_after sulf_Oct 18 15:46:42 2016 (GMT+02:00)
*Résultat de Soustraction:04_Mo_Al2O3_calc_0.004torr_LT_after sulf_Oct 18 15:51:12 2016 (GMT+02:00) ...
*Résultat de Soustraction:04_Mo_Al2O3_calc_0.905torr_LT_after sulf_Oct 18 17:58:42 2016 (GMT+02:00)
*Résultat de Soustraction:04_Mo_Al2O3_calc_1.004torr_LT_after sulf_Oct 18 18:03:41 2016 (GMT+02:00)]]


The IRIS model is easier to interpret with pressure coordinates along the observation axis, so we attach the measured CO pressures to y.

pressures = [
    0.003,
    0.004,
    0.009,
    0.014,
    0.021,
    0.026,
    0.036,
    0.051,
    0.093,
    0.150,
    0.203,
    0.300,
    0.404,
    0.503,
    0.602,
    0.702,
    0.801,
    0.905,
    1.004,
]
c_pressures = scp.Coord(pressures, title="pressure", units="torr")

Keep the original time coordinate as a secondary coordinate, and make pressure the active one for plotting and IRIS fitting.

CoordSet — x:wavenumbers, y
Dimension `x`
size
:
3112
title
:
wavenumbers
coordinates
:
[ 4000 3999 ... 1001 999.9] cm⁻¹
Dimension `y`
size
:
19
(_1)
title
:
acquisition timestamp (GMT)
coordinates
:
[1.477e+09 1.477e+09 ... 1.477e+09 1.477e+09] s
labels
:
[[ 2016-10-18 13:49:35+00:00 2016-10-18 13:54:06+00:00 ... 2016-10-18 16:01:33+00:00 2016-10-18 16:06:37+00:00]
[ *Résultat de Soustraction:04_Mo_Al2O3_calc_0.003torr_LT_after sulf_Oct 18 15:46:42 2016 (GMT+02:00)
*Résultat de Soustraction:04_Mo_Al2O3_calc_0.004torr_LT_after sulf_Oct 18 15:51:12 2016 (GMT+02:00) ...
*Résultat de Soustraction:04_Mo_Al2O3_calc_0.905torr_LT_after sulf_Oct 18 17:58:42 2016 (GMT+02:00)
*Résultat de Soustraction:04_Mo_Al2O3_calc_1.004torr_LT_after sulf_Oct 18 18:03:41 2016 (GMT+02:00)]]
(_2)
title
:
pressure
coordinates
:
[ 0.003 0.004 ... 0.905 1.004] torr


We now select the CO adsorption spectral region.

X_ = X[:, 2250.0:1950.0]
_ = X_.plot(colorbar=True)
_ = X_.plot_contourf(colorbar=True)
  • plot iris intro
  • plot iris intro

IRIS analysis without regularization

The plugin exposes its workflows through scp.iris and also adds dataset-bound helpers under dataset.iris. We start by building the Langmuir kernel from the dataset accessor.

K = X_.iris.kernel_matrix(kernel_type="langmuir", q=[-8, -1, 50])
K.kernel
NDDataset [langmuir kernel matrix] — float64, shape: (y:19, x:50)
name
:
langmuir kernel matrix
author
:
runner@runnervm76f27
created
:
2026-08-21 13:17:28+00:00
Data
title
:
coverage
values
:
[[ 0.06424 0.1265 ... 0.001332 0.0005778]
[ 0.0659 0.1303 ... 0.00177 0.0007683]
...
[ 0.0714 0.1428 ... 0.1056 0.05078]
[ 0.0714 0.1428 ... 0.1084 0.05227]]
shape
:
(y:19, x:50)
Dimension `x`
size
:
50
title
:
$\Delta_{ads}G^{0}/RT$
coordinates
:
[ -8 -7.857 ... -1.143 -1]
Dimension `y`
size
:
19
title
:
pressure
coordinates
:
[ 0.003 0.004 ... 0.905 1.004] torr


The model can then be fitted with no explicit regularization.

iris1 = scp.iris.IRIS(log_level="INFO")
_ = iris1.fit(X_, K)

Grouped fitted outputs are available from result. Historical direct attributes such as f remain supported, but the grouped result is the preferred way to inspect the fit.

f = iris1.result.f
_ = iris1.result.K

_ = f.plot_contour()
_ = iris1.plotmerit()
  • plot iris intro
  • plot iris intro
/home/runner/work/spectrochempy/spectrochempy/src/spectrochempy/utils/decorators.py:185: DeprecationWarning: The `DecompositionAnalysis.plotmerit` method is now deprecated. Use `plot_merit` instead. It will not be removed before the SpectroChemPy deprecation policy is satisfied.
  warn_deprecated(