darsia.ColorPathInterpolation#

class ColorPathInterpolation(color_path, color_mode, values=None, ignore_spectrum=None, ignore_mode='norm')[source]#

Bases: ColorPathFunction

Interpolate concentrations along a colour path from labelled reference values.

Constructor.

Parameters:
color_pathdarsia.ColorPath

Color path onto which colors are projected.

color_modedarsia.ColorMode

Color mode of the colors to be interpreted.

valuesarray_like, optional

Values at the key colors; default are their equidistant positions.

ignore_spectrumdarsia.ColorSpectrum, optional

Colors without a signal, e.g. the spectrum of the baseline. Without it, all colors are projected.

ignore_modestr

Which colors are not projected (value at position 0), if an ignore spectrum is given: “norm” for colors with a norm below 0.1 (the same for all labels), “spectrum” for the colors in the ignore spectrum.

Methods

calibrate()

from_dict(data)

Create a ColorPathInterpolation from a dictionary.

kernel_data()

Data of the model for the compiled evaluation (color_path_kernels).

load(path)

Load the ColorPathInterpolation from a file.

save(path)

Save the ColorPathInterpolation to a file.

to_dict()

Convert the ColorPathInterpolation to a dictionary representation.

update_model_parameters(parameters[, dofs])

Update the interpolation values of the color path.

Attributes

ignore_mode

Which colors are not projected: by their norm or by the ignore spectrum.

ignore_spectrum

Spectrum to ignore during parametrization.

color_path

Underlying color path.

color_mode

Color mode used for parametrization.

classmethod from_dict(data)[source]#

Create a ColorPathInterpolation from a dictionary.

Parameters:
datadict

Dictionary representation of the ColorPathInterpolation.

Returns:
ColorPathInterpolation

The created ColorPathInterpolation instance.

classmethod load(path)[source]#

Load the ColorPathInterpolation from a file.

Parameters:
pathPath

The path to the file from which the ColorPathInterpolation should be loaded.

Returns:
ColorPathInterpolation

Loaded ColorPathInterpolation instance.

kernel_data()[source]#

Data of the model for the compiled evaluation (color_path_kernels).

Returns:
_kernels.PathData

Key colors in the color mode of the model, their (equidistant) positions on the path, the values at the key colors, and the colors which are not fitted.

save(path)[source]#

Save the ColorPathInterpolation to a file.

Parameters:
pathPath

The path to the file where the ColorPathInterpolation should be saved.

to_dict()[source]#

Convert the ColorPathInterpolation to a dictionary representation.

Returns:
dict

Dictionary representation of the ColorPathInterpolation.

update_model_parameters(parameters, dofs=None)[source]#

Update the interpolation values of the color path.

ignore_mode#

Which colors are not projected: by their norm or by the ignore spectrum.

ignore_spectrum#

Spectrum to ignore during parametrization.