spectrochempy.analysis.constraints.Closure

class Closure(profile, components=None, target=1.0)[source]

Closure (constant sum) constraint.

States that the selected components of a profile must sum to a target value across the constrained axis (typically the concentration rows summing to 1.0).

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

  • components (list[int], optional) – Component indices included in the closure. None (default) means “all components”.

  • target (float, optional) – Target sum for the selected components. Default is 1.0.

Examples

>>> from spectrochempy import Closure
>>> Closure("C")
Closure(profile='C', components=None, target=1.0)
>>> Closure("C", components=[0, 1], target=100.0)
Closure(profile='C', components=[0, 1], target=100.0)

Attributes Summary

components

Components in the closure (None = all).

name

Short human-readable name of the constraint family.

profile

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

target

Target sum for the selected components.

Attributes Documentation

components

Components in the closure (None = all).

Type:

list[int] or None

name

Short human-readable name of the constraint family.

Type:

str

profile

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

Type:

str

target

Target sum for the selected components.

Type:

float

Examples using spectrochempy.analysis.constraints.Closure