darsia.PWTransformation#

class PWTransformation(supports=None, values=None)[source]#

Bases: object

Transformation which cuts off values below 0 and ensures monotonicity.

Methods

evaluate_on_path(t)

Evaluate the signal at the colors on the color path.

inverse(value)

Compute the inverse transformation at given value(s).

linear_table()

Supports and values, if the transformation is their linear interpolation.

load(path)

Load the transformation from file in csv format.

log(log)

Plot the transformation and store to file.

save(path)

Save the transformation to file in csv format.

update([supports, values, dofs])

values_from_diff(values_diff)

classmethod load(path)[source]#

Load the transformation from file in csv format.

Parameters:
pathPath

Path to the file from which the transformation should be loaded.

evaluate_on_path(t)[source]#

Evaluate the signal at the colors on the color path.

Parameters:
tfloat or np.ndarray

Equidistant parameters along the color path.

Returns:
float or np.ndarray

Signal. For the linear evaluation it is the function of the parameter.

inverse(value)[source]#

Compute the inverse transformation at given value(s).

linear_table()[source]#

Supports and values, if the transformation is their linear interpolation.

Compiled single-pass evaluations (signals/models/signal_kernels.py) rely on this and replace __call__. NOTE: A subclass with another interpolator gets None by the type check; a change of the interpolation of this class must be mirrored in the kernel.

Returns:
tuple or None

Strictly increasing supports and the values; None for a subclass, without interpolator, or for supports and values which are not finite.

log(log)[source]#

Plot the transformation and store to file.

save(path)[source]#

Save the transformation to file in csv format.

Parameters:
pathPath

Path to the file where the transformation should be saved.