Commit af475c91 authored by Yb Tweezer's avatar Yb Tweezer
Browse files

make function names clearer

parent 43c6e309
......@@ -140,7 +140,7 @@ class AbsorptionData(ImagingData):
OD = compute_od(
self.arrays["shadow"], self.arrays["bright"], self.arrays["dark"])
self.arrays["od"] = OD
sx, sy = fit_gaussian(OD, _dA)
sx, sy = lmfit_gaussian(OD, _dA)
self.results = dict() if self.results is None else self.results
self.results.update({"sx": sx, "sy": sy})
return self
......@@ -183,7 +183,7 @@ class FluorescenceData(ImagingData):
50e6 * 2 * np.pi,
1.0
)
sx, sy = _fit_gaussian(array, _dA)
sx, sy = lls_fit_gaussian(array, _dA)
self.results = dict() if self.results is None else self.results
self.results.update(
{
......@@ -214,7 +214,7 @@ def compute_mot_number(image, QE, gain, exposure_time, solid_angle,
N = photon_rate / scatter_rate(detuning, intensity_parameter)
return N
def _fit_gaussian(A, dA):
def lls_fit_gaussian(A, dA):
"""
Assumes uniform, square dA.
"""
......@@ -228,7 +228,10 @@ def _fit_gaussian(A, dA):
Sx, Sy = la.solve(M.T @ M, M.T @ Z)
return np.sqrt(1 / Sx), np.sqrt(1 / Sy)
def fit_gaussian(data, dA):
def lmfit_gaussian(data, dA):
"""
Assumes uniform, square dA.
"""
imax, jmax = np.where(data == data.max())
i0, j0 = imax.mean(), jmax.mean()
x0 = np.sqrt(dA) * j0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment