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.0makes the constraint strict (every decrease after the global maximum is a violation). Values above1.0allow small local reversals before enforcing a strict decrease. Default is1.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
Block indices for augmented data (
Nonemeans all blocks).Component selection (
Nonemeans "all").Unimodal modality (
"strict"or"smooth").Short human-readable name of the constraint family.
Canonical profile identifier (
"C"or"St").Admissibility tolerance (
>= 1.0, default1.1).Attributes Documentation
Examples using spectrochempy.analysis.constraints.Unimodal