![]() |
Potku
1.0.0
Class Documentation
|
Public Member Functions | |
def | __init__ |
def | add_point |
def | remove_point |
def | point_exists |
def | get_points |
def | linear_function |
def | fit_linear_function |
def | get_linear_fit_points |
def | get_fit_parameters |
Public Attributes | |
slope | |
offset | |
tof_points | |
Class for holding list of TOFCalibrationPoints and creating a linear fit of their values.
def Modules.Calibration.TOFCalibration.__init__ | ( | self | ) |
Inits the class
def Modules.Calibration.TOFCalibration.add_point | ( | self, | |
tof_calibration_point | |||
) |
Adds a TOFCalibrationPoint to ToF Calibration Args: tof_calibration_point: TOFCalibrationPoint class object.
def Modules.Calibration.TOFCalibration.fit_linear_function | ( | self, | |
x, | |||
y, | |||
guess_a, | |||
guess_b | |||
) |
Fits a linear function to the given data. a*x + b Args: x: data's x axis as a list y: data's y axis as a list guess_x0: Guess for the a's value guess_A: Guess for the b's value Returns: tuple(a, b) of parameters of a fitted linear function.
def Modules.Calibration.TOFCalibration.get_fit_parameters | ( | self | ) |
Get fit parameters. Return: Returns Slope and Offset of calibration.
def Modules.Calibration.TOFCalibration.get_linear_fit_points | ( | self, | |
params, | |||
x_min, | |||
x_max, | |||
points_in_range | |||
) |
Generates points from the linear function with given range and number of points. Args: params: tuple of parameters (x0, A, k) x_min: x_max: points_in_range: Returns: tuple(x_values, y_values) of generated lists of axis data (x and y axis)
def Modules.Calibration.TOFCalibration.get_points | ( | self | ) |
Returns TOFCalibrationPoints that have the point_used property set True. Return: tuple(x,y, name) of lists containing used points for the linear fit.
def Modules.Calibration.TOFCalibration.linear_function | ( | self, | |
x, | |||
params | |||
) |
The function used for linear fit. Takes the function parameters as a "namedtuple" or "tuple". a*x + b Args: params: namedtuple or tuple that brings the used parameters ("a b") Return: Returns linear function value from the given point x.
def Modules.Calibration.TOFCalibration.point_exists | ( | self, | |
tof_calibration_point | |||
) |
Check if point exists in ToF Calibration. Args: tof_calibration_point: TOFCalibrationPoint class object. Return: Returns True if point exists. False otherwise.
def Modules.Calibration.TOFCalibration.remove_point | ( | self, | |
tof_calibration_point | |||
) |
Removes a TOFCalibrationPoint from ToF Calibration Args: tof_calibration_point: TOFCalibrationPoint class object. Return: Returns True if point was removed. False otherwise.