math
Utility math functions which can be shared between Tasks.
Functions:
Name | Description |
---|---|
gaussian |
Calculate a 1D Gaussian distirbution. |
sigma_to_fwhm |
Convert the standard deviation of a Gaussian to Full Width at Half Maximum (FWHM). |
gaussian(x_vals, amp, x0, sigma, bkgnd)
1D Gaussian distribution with specified parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x_vals
|
NDArray[float64]
|
Values over which to calculate the distribution. |
required |
amp
|
float
|
Amplitude of the distribution. |
required |
x0
|
float
|
Center (mean) of the distribution |
required |
sigma
|
float
|
Standard deviation of the distribution. |
required |
bkgnd
|
float | NDArray[float64]
|
Background/noise. Constant
offset (float) or an array of offsets of the same length as |
required |
Returns:
Name | Type | Description |
---|---|---|
distribution |
NDArray[float64]
|
Calculated Gaussian distribution based on given parameters. Same shape as x_vals. |
Source code in lute/tasks/math.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
sigma_to_fwhm(sigma)
Convert the standard deviation of a Gaussian to Full Width Half Max.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sigma
|
float
|
Standard deviation of a Gaussian. |
required |
Returns:
Name | Type | Description |
---|---|---|
fhwm |
float
|
Full width at half max of a Gaussian. |
Source code in lute/tasks/math.py
43 44 45 46 47 48 49 50 51 52 53 |
|