spectrochempy.analysis.constraints.Unimodal

class Unimodal(profile, components=None, tolerance=1.1, mod='strict', blocks=None)[source]

Unimodality constraint.

States that each selected component has a single maximum along the constrained axis. Useful for chromatographic / kinetic profiles where one peak is expected per chemical species.

Parameters
  • profile (str) – "C" (concentrations) or "St" (spectra).

  • components (list[int], optional) – Component indices to which the constraint applies. None (default) means “all components”.

  • tolerance (float, optional) – Admissibility tolerance for the unimodality constraint. Must be >= 1.0. 1.0 makes the constraint strict (every decrease after the global maximum is a violation). Values above 1.0 allow small local reversals before enforcing a strict decrease. Default is 1.1.

  • mod (str, optional) – Unimodal modality: "strict" (single maximum, default) or "smooth" (allow a flat-topped region).

Examples

>>> from spectrochempy import Unimodal
>>> Unimodal("C")
Unimodal(profile='C', components=None, mod='strict')
>>> Unimodal("St", components=[0], mod="smooth")
Unimodal(profile='St', components=[0], mod='smooth')
>>> Unimodal("C", tolerance=1.0)
Unimodal(profile='C', components=None, tolerance=1.0, mod='strict')

Attributes Summary

blocks

Block indices for augmented data (None means all blocks).

components

Component selection (None means "all").

mod

Unimodal modality ("strict" or "smooth").

name

Short human-readable name of the constraint family.

profile

Canonical profile identifier ("C" or "St").

tolerance

Admissibility tolerance (>= 1.0, default 1.1).

Attributes Documentation

blocks

Block indices for augmented data (None means all blocks).

Type

list[int] or None

components

Component selection (None means “all”).

Type

list[int] or None

mod

Unimodal modality ("strict" or "smooth").

Type

str

name

Short human-readable name of the constraint family.

Type

str

profile

Canonical profile identifier ("C" or "St").

Type

str

tolerance

Admissibility tolerance (>= 1.0, default 1.1).

Type

float

Examples using spectrochempy.analysis.constraints.Unimodal