LinearCalibration#
Class Arguments
Argument |
Type |
Default Value |
---|---|---|
a |
TFloat |
|
b |
TFloat |
|
input_unit |
TStr |
|
output_unit |
TStr |
Bold arguments are mandatory. For more documentation on the listed arguments refer to the class definition below. If parameters appear in this list but not in the class definition below, please recursively check the linked base classes for the definition of the parameter.
Inheritance Diagram
Example Component Dictionary
{
"calibration_example": {
"classname": "atomiq.components.basics.calibration.LinearCalibration",
"arguments": {
"a": "<mandatory parameter (TFloat)>",
"b": "<mandatory parameter (TFloat)>",
"input_unit": "<mandatory parameter (TStr)>",
"output_unit": "<mandatory parameter (TStr)>"
}
}
}
Class Description
- class atomiq.components.basics.calibration.LinearCalibration(a, b, *args, **kwargs)
Bases:
InvertableCalibration
Linear calibration
The calibration is given by the function
$$f(x) = ax + b$$
- Parameters:
input_unit -- Unit of the input
output_unit -- Unit of the output
a (TFloat) -- Calibration coefficient a
b (TFloat) -- Calibration coefficient b
- transform(input_value)
Transform a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be transformed
- Returns:
transformed value
- Return type:
TFloat
- transform_inv(output_value)
Perform inverse transform of a value according to the calibration
- Parameters:
input_value -- value to be inversely transformed. Must be given in units of the output unit
output_value (TFloat) --
- Returns:
transformed value. The returned value is in units of the input unit
- Return type:
TFloat