Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
SplineCalibrator Class Reference

This class calibrates a value using a series of line segments. More...

Inherits Calibrator.

Public Member Functions

Initialize / Finalize

Functions handling class initialization and finalization.

def SplineCalibrator ( Optional[SplineCalibrator] spline_calibrator=None, Optional[c_void_p] native_ptr=None, is_clone: bool=False -> def ) -> def 
 Class initializer. More...
 
def clone ( -> SplineCalibrator ) -> def 
 Creates and returns an extact copy of the object. More...
 
def copy (copy_from: object -> None ) -> def 
 Copies the contents of the provided 'copy_from' SplineCalibrator. More...
 
def initialize ( -> None ) -> def 
 Initializes the object. More...
 
def load_file (filename: str -> None ) -> def 
 Loads the SplineCalibrator definition from the specified file. More...
 
def save_file (filename: str -> None ) -> def 
 Saves the SplineCalibrator definition to the specified file. More...
 
Calibration

Functions for handling calibration.

def calibrate (input_value: float -> float ) -> def 
 Performs the calibration on the input value. More...
 
def clear_all_points ( -> None ) -> def 
 Removes all points defining the line segments.
 
def get_number_of_points ( -> int ) -> def 
 Returns the number of points in the calibrator. More...
 
def get_points ( -> List[SplineCalibratorPoint] ) -> def 
 Gets all of the points for the calibrator. More...
 
def add_point (new_converted: float, new_calibrated: float -> None ) -> def 
 Adds a point to the calibrator. More...
 
def SplineCalibrator ( -> def ) -> def 
 Class initializer. More...
 
def initialize ( -> None ) -> def 
 Initializes the object. More...
 
def calibrate (input_value: float -> float ) -> def 
 Virtual method for derived classes to calibrate an input value. More...
 
def clone ( -> Calibrator ) -> def 
 Creates and returns an extact copy of the object. More...
 
- Public Member Functions inherited from NamedItem
def remove_all_attributes ( -> None ) -> def 
 Removes all attributes.
 
def remove_attribute (name: str -> None ) -> def 
 Removes the attribute by name. More...
 
def __eq__ (named_item: object -> bool ) -> def 
 Equality operator "==". More...
 
def add_attribute (name: str, value: str -> None ) -> def 
 Adds an attribute to the item. More...
 
def get_alias ( -> str ) -> def 
 Returns the alias of the item. More...
 
def get_attribute (name: str -> str ) -> def 
 Get the value of the specified attribute. More...
 
def get_attribute_list ( -> list[str] ) -> def 
 Gets a list of the attribute names. More...
 
def get_name ( -> str ) -> def 
 Returns the name of the item. More...
 
def get_long_description ( -> str ) -> def 
 Returns the long description of the item. More...
 
def get_short_description ( -> str ) -> def 
 Returns the short description of the item. More...
 
def get_user_description ( -> str ) -> def 
 Returns the user description of the item. More...
 
def get_owner ( -> str ) -> def 
 Returns the owner of the item. More...
 
def get_path ( -> str ) -> def 
 Returns the path for the item. More...
 
def set_name (name: str -> None ) -> def 
 Sets the name of the item. More...
 
def set_alias (alias: str -> None ) -> def 
 Sets the alias of the item. More...
 
def set_short_description (description: str -> None ) -> def 
 Sets the short description of the item. More...
 
def set_long_description (description: str -> None ) -> def 
 Sets the long description of the item. More...
 
def set_user_description (description: str -> None ) -> def 
 Sets the user description of the item. More...
 
def set_owner (owner: str -> None ) -> def 
 Sets the owner of the item. More...
 
def set_path (path: str -> None ) -> def 
 Sets the path of the item. More...
 

Detailed Description

This class calibrates a value using a series of line segments.

The number of line segments allowed is unbouded.

Constructor & Destructor Documentation

◆ SplineCalibrator()

(spline_calibrator : Optional[SplineCalibrator]  
native_ptr : Optional[c_void_p]  
is_clone : bool  
) -> def

Class initializer.

Parameters
[in]spline_calibrator(Optional) The SplineCalibrator to copy construct from.
[in]native_ptr(Optional) Internal parameter, do not provide.
[in]is_clone(Optional) Internal parameter, do not provide.

Reimplemented from Calibrator.

Member Function Documentation

◆ add_point()

(new_converted : float 
new_calibrated : float 
) -> None

Adds a point to the calibrator.

Line segments are calculated automatically by the class.

Parameters
[in]new_convertedConverted value.
[in]new_calibratedCorresponding calibrated value.
Exceptions
TrekError15005 - TREK_DATA_ALREADY_EXISTS

◆ calibrate()

(input_value : float ) -> float

Performs the calibration on the input value.

Parameters
[in]input_valueValue to calibrate.
Returns
Calibrated value.
Exceptions
TrekError15043 - TREK_DATA_CALIBRATION_ERROR

Reimplemented from Calibrator.

◆ clone()

Creates and returns an extact copy of the object.

Reimplemented from Calibrator.

◆ copy()

(copy_from : object ) -> None

Copies the contents of the provided 'copy_from' SplineCalibrator.

Parameters
[in]copy_fromSplineCalibrator to copy from.
Exceptions
TypeErrorif 'copy_from' is not a SplineCalibrator.

Reimplemented from NamedItem.

◆ get_number_of_points()

() -> int

Returns the number of points in the calibrator.

Returns
The number of points in the calibrator.

◆ get_points()

() -> List[SplineCalibratorPoint]

Gets all of the points for the calibrator.

Returns the number of points and the converted and calibrated value for each point.

◆ initialize()

() -> None

Initializes the object.

Reimplemented from Calibrator.

◆ load_file()

(filename : str ) -> None

Loads the SplineCalibrator definition from the specified file.

Reads an XML SplineCalibrator.

Parameters
[in]filenameThe file from which to load the spline calibrator object.

◆ save_file()

(filename : str ) -> None

Saves the SplineCalibrator definition to the specified file.

Writes an XML SplineCalibrator.

Parameters
[in]filenameThe file to save the spline calibrator object.