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
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
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
42 43 44 45 46 47 48 49 50 51 52 |
|