atomiq.components.basics.calibration module#
In all experiments, calibrations are ubiquious. Examples are
voltage - power relation on a photodiode
Relation between the current through a coil and the created magentic field
RF power in an AOM and light power in the diffracted order
The current-voltage relation for a voltage-controlled current supply
...
In atomiq calibrations are comoponents just like every other piece of your experiment. Every calibration inherits
from the abstract Calibration
class. A special subclass of calibration functions are invertable
calibrations that can be analytically inverted. The most frequently used example is a linear calibration function.
Invertable calibrations inherit from InvertableCalibration
.
- atomiq.components.basics.calibration.exp(x)#
- Parameters:
x (TFloat) --
- Return type:
TFloat
- atomiq.components.basics.calibration.ln(x, n=10000.0)#
- Parameters:
x (TFloat) --
n (TFloat) --
- Return type:
TFloat
- class atomiq.components.basics.calibration.Calibration(input_unit, output_unit, *args, **kwargs)#
Bases:
Component
An abstract Calibration
This is an abstract class to describe a calibration.
- Parameters:
input_unit (TStr) -- A string determining the input unit (e.g. 'mW', 'V', or 'uA')
output_unit (TStr) -- A string determining the output unit (e.g. 'mW', 'V', or 'uA')
- kernel_invariants = {'input_unit', 'output_unit'}#
- transform(input_value)#
Transform a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be transformed
- Returns:
transformed value
- Return type:
TFloat
- class atomiq.components.basics.calibration.InvertableCalibration(input_unit, output_unit, *args, **kwargs)#
Bases:
Calibration
- Parameters:
input_unit (TStr) --
output_unit (TStr) --
- transform_inv(input_value)#
Perform inverse transform of a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be inversely transformed. Must be given in units of the output unit
- Returns:
transformed value. The returned value is in units of the input unit
- Return type:
TFloat
- kernel_invariants = {'input_unit', 'output_unit'}#
- transform(input_value)#
Transform a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be transformed
- Returns:
transformed value
- Return type:
TFloat
- class atomiq.components.basics.calibration.DummyCalibration(*args, **kwargs)#
Bases:
Calibration
- transform(input_value)#
Transform a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be transformed
- Returns:
transformed value
- Return type:
TFloat
- kernel_invariants = {'input_unit', 'output_unit'}#
- class atomiq.components.basics.calibration.PolynomialCalibration(*args, coefficients, **kwargs)#
Bases:
Calibration
Calibration described by a polynomial
The calibration is given by the function
$$f(x) = sum_i c_i x^i$$
- Parameters:
coefficients (TList(TFloat)) -- List of coefficients $c_i$ of the polynomial, start from the lowest order.
- kernel_invariants = {'coefficients'}#
- transform(input_value)#
Transform a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be transformed
- Returns:
transformed value
- Return type:
TFloat
- 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
- kernel_invariants = {'a', '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
- class atomiq.components.basics.calibration.SigmoidCalibration(*args, A, k, x_offset=0, y_offset=0, **kwargs)#
Bases:
Calibration
Sigmoid calibration
` output = A / ( 1 + e^k*(input - x_offset)) + y_offset `
- Parameters:
input_unit -- Unit of the input
output_unit -- Unit of the output
A (TFloat) -- Amplitude of the sigmoid
k (TFloat) -- stretching of the sigmoid
x_offset (TFloat) -- offset on the x axis
y_offset (TFloat) -- offset on the y axis
- kernel_invariants = {'A', 'k', 'x_offset', 'y_offset'}#
- transform(input_value)#
Transform a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be transformed
- Returns:
transformed value
- Return type:
TFloat
- class atomiq.components.basics.calibration.InvSigmoidCalibration(*args, A, k, x_offset=0, y_offset=0, **kwargs)#
Bases:
Calibration
Inverse sigmoid calibration
` output = -ln( A / (input - y_offset) - 1) / k + x_offset `
The paremeters are defined in a way that they match the sigmoid definition.
- Parameters:
input_unit -- Unit of the input
output_unit -- Unit of the output
A (TFloat) -- Amplitude of the sigmoid
k (TFloat) -- stretching of the sigmoid
x_offset (TFloat) -- offset on the x axis
y_offset (TFloat) -- offset on the y axis
- kernel_invariants = {'A', 'k', 'x_offset', 'y_offset'}#
- transform(input_value)#
Transform a value according to the calibration
- Parameters:
input_value (TFloat) -- value to be transformed
- Returns:
transformed value
- Return type:
TFloat