Linear
DragLineManager
Bases: DragPointCollection
Collection of DragPoints representing a straight line.
Source code in itfit/fit_functions/linear/linear.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
__init__(dragpoints, blit_manager)
Line between multiple DragPoints. Updates with them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dragpoints |
list[DragPoint]
|
line vertices. |
required |
blit_manager |
BlitManager
|
used for automtic ploting. |
required |
Source code in itfit/fit_functions/linear/linear.py
function(x, m, n)
staticmethod
Straight line function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
independent variable. |
required |
m |
float
|
slope. |
required |
n |
float
|
value at |
required |
Returns:
Type | Description |
---|---|
float
|
|
Source code in itfit/fit_functions/linear/linear.py
get_args()
Gives linear function parameters.
Returns:
Type | Description |
---|---|
Tuple[float, float]
|
|
Source code in itfit/fit_functions/linear/linear.py
get_args_length()
staticmethod
Gets number of arguments of function
.
Returns:
Type | Description |
---|---|
int
|
Number of arguments of |
gradient(x, m, n)
staticmethod
Straigth line gradient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
independent variable. |
required |
m |
float
|
slope. |
required |
n |
float
|
value at 'x = 0'. |
required |
Returns:
Type | Description |
---|---|
np.array
|
' ( x, 1 )' |
Source code in itfit/fit_functions/linear/linear.py
update(*args, **kargs)
Updates line data with DragObjects positions
Source code in itfit/fit_functions/linear/linear.py
LineFitter
Bases: GenericFitter
Linear function fitter.
Source code in itfit/fit_functions/linear/linear.py
__init__(app, data)
Linear fitter following function f(x)=m*x + n
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app |
Fitter
|
Main application. |
required |
data |
DataSelection
|
Data to fit. |
required |
Source code in itfit/fit_functions/linear/linear.py
LineTool
Bases: GenericFitterTool
Toggles Line Tool.
Source code in itfit/fit_functions/linear/linear.py
disable(*args)
enable(*args)
Triggered when LineTool is enabled. Uses BlitManager for faster rendering of DragObjects.