CADETProcess.comparison.Shape

Contents

CADETProcess.comparison.Shape#

class CADETProcess.comparison.Shape(reference: ReferenceBase, components: dict[str, list] | None = None, use_total_concentration: bool = False, use_total_concentration_components: bool = True, start: float | None = None, end: float | None = None, transform: Callable | None = None, only_transforms_array: bool = True, resample: bool = True, smooth: bool = False, normalize: bool = False)[source]#

Shape similarity difference metric.

The similarity is calculated using the Pearson correlation between the reference and solution profiles, as well as the time offset between their peak positions, and the peak height of the solution profile. Additionally, if use_derivative is set to True, the similarity is also calculated using the Pearson correlation of the derivative profiles, and the minimum and maximum peak heights of the derivative profile.

Attributes:
n_metricsint

int: Number of metrics.

labelslist of str

list[str]: List of difference metric names.

Methods

__call__(solution)

Compute the difference between the reference solution and the input solution.

checks_dimensions()

Wrap method automatically check reference and solution dimensions.

evaluate(solution)

Compute the difference between the reference solution and the input solution.

resamples_normalizes_and_smoothes_solution()

Wrap method to automatically resample, normalize, and smooth solution.

slice_and_transform(solution)

Slice the solution and applies the transform callable (if defined).

slices_solution()

Wrap method to automatically slice solution.

transforms_solution()

Wrap method s.t.

Raises:
CADETProcessError

If components is not None and has more than one element.

Notes

Currently, this class only works for single-component systems with one peak.