LinearInterpolation

class caqtus.device.output_transform.LinearInterpolation(
input_: Expression | Transformation,
measured_data_points: Iterable[tuple[float, float]],
input_points_unit,
output_points_unit,
)

Bases: Transformation

Transforms an input value by applying a piecewise linear interpolation.

This transformation stores a set of measured data points and interpolates the output value based on the input value.

input_

An operation that can be evaluated to an output value. The transformation is applied to this value.

Type:

caqtus.types.expression._expression.Expression | caqtus.device.output_transform._transformation.Transformation

measured_data_points

A list of measured data points as tuples of input and output values.

Type:

tuple[tuple[float, float], …]

input_points_unit

The unit of the input points. The result of the input evaluation will be converted to this unit.

Type:

str | None

output_points_unit

The unit of the output points. The result of the transformation will be converted to this unit.

Type:

str | None

evaluate(
variables: Mapping[DottedVariableName, Any],
) OutputValue

Evaluates the transformation using the given variables.

If the value returned is a quantity, it must be expressed in base units.