darsia.ColorPathInterpolation#
- class ColorPathInterpolation(color_path, color_mode, values=None, ignore_spectrum=None, ignore_mode='norm')[source]#
Bases:
ColorPathFunctionInterpolate concentrations along a colour path from labelled reference values.
Constructor.
- Parameters:
- color_path
darsia.ColorPath Color path onto which colors are projected.
- color_mode
darsia.ColorMode Color mode of the colors to be interpreted.
- valuesarray_like,
optional Values at the key colors; default are their equidistant positions.
- ignore_spectrum
darsia.ColorSpectrum,optional Colors without a signal, e.g. the spectrum of the baseline. Without it, all colors are projected.
- ignore_mode
str 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.
- color_path
Methods
calibrate()from_dict(data)Create a ColorPathInterpolation from a dictionary.
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
Which colors are not projected: by their norm or by the ignore spectrum.
Spectrum to ignore during parametrization.
color_pathUnderlying color path.
color_modeColor mode used for parametrization.
- classmethod from_dict(data)[source]#
Create a ColorPathInterpolation from a dictionary.
- Parameters:
- data
dict Dictionary representation of the ColorPathInterpolation.
- data
- Returns:
ColorPathInterpolationThe created ColorPathInterpolation instance.
- classmethod load(path)[source]#
Load the ColorPathInterpolation from a file.
- Parameters:
- path
Path The path to the file from which the ColorPathInterpolation should be loaded.
- path
- Returns:
ColorPathInterpolationLoaded ColorPathInterpolation instance.
- kernel_data()[source]#
Data of the model for the compiled evaluation (color_path_kernels).
- Returns:
_kernels.PathDataKey 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:
- path
Path The path to the file where the ColorPathInterpolation should be saved.
- path
- to_dict()[source]#
Convert the ColorPathInterpolation to a dictionary representation.
- Returns:
dictDictionary 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.