Lorentzian
DragLorentzianManager
Bases: DragPointCollection
Source code in itfit/fit_functions/lorentzian/lorentzian.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 119 120 121 |
|
__init__(dragpoints, blit_manager)
Lorentzian line between 2 DragPoints. Updates with them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dragpoints |
list[DragPoint]
|
line vertices. |
required |
blit_manager |
BlitManager
|
used for automatic ploting. |
required |
Source code in itfit/fit_functions/lorentzian/lorentzian.py
function(x, A, x0, FWHM)
staticmethod
Lorentzian function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
independent variable. |
required |
A |
float
|
scalar. |
required |
x0 |
float
|
maximum center. |
required |
FWHM |
float
|
full width at half maximum. |
required |
Returns:
Type | Description |
---|---|
float
|
|
Source code in itfit/fit_functions/lorentzian/lorentzian.py
get_args()
Gives Lorentzian function parameters.
Returns:
Type | Description |
---|---|
tuple[float, float, float]
|
|
Source code in itfit/fit_functions/lorentzian/lorentzian.py
get_args_length()
staticmethod
Gets number of arguments of function
.
Returns:
Type | Description |
---|---|
int
|
Number of arguments of |
gradient(x, A, x0, FWHM)
staticmethod
TODO: make docstrings
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
description |
required |
A |
float
|
description |
required |
x0 |
float
|
description |
required |
FWHM |
float
|
description |
required |
Returns:
Type | Description |
---|---|
np.array
|
description |
Source code in itfit/fit_functions/lorentzian/lorentzian.py
update(*args, **kargs)
Updates line data with DragObjects positions
Source code in itfit/fit_functions/lorentzian/lorentzian.py
LorentzianFitter
Bases: GenericFitter
Lorentzian function fitter.
Source code in itfit/fit_functions/lorentzian/lorentzian.py
__init__(app, data)
Lorentzian fitter following function f(x) = A/pi*(FWHM/2)/((x-x0)^2+(FWHM/2)^2)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app |
Fitter
|
Main application. |
required |
data |
DataSelection
|
Data to fit. |
required |
Source code in itfit/fit_functions/lorentzian/lorentzian.py
LorentzianTool
Bases: GenericFitterTool
Toggles Lorentzian Tool.
Source code in itfit/fit_functions/lorentzian/lorentzian.py
disable(*args)
Triggered when LorentzianTool is disabled. Removes DragObjects and disables BlitManager.
enable(*args)
Triggered when LorentzianTool is enabled, Uses BlitManager for faster rendering of DragObjects.