Skip to content
Snippets Groups Projects
Commit a2c5f5ac authored by Yb Tweezer's avatar Yb Tweezer
Browse files

subtract background atom number, rather than background array

parent c0a7890f
No related branches found
No related tags found
No related merge requests found
......@@ -165,6 +165,15 @@ class FluorescenceData(ImagingData):
_dA = self.config.get("bin_size", 1)**2 \
* (DEF_DX**2 if dA is None else dA)
if printflag: print("[imaging] Compute results")
N_bkgd = compute_mot_number(
self.arrays["background"].astype(np.float64),
0.40,
self.config["gain"],
self.config["exposure_time"] * 1e-6, # s
(0.0127**2 * np.pi) / (4 * np.pi * 0.125**2),
50e6 * 2 * np.pi,
1.0
) if "background" in self.arrays else 0
for label, array in self.arrays.items():
if label == "background":
continue
......@@ -172,18 +181,14 @@ class FluorescenceData(ImagingData):
if array.max() >= (dtype_info.max - dtype_info.bits):
print(f"[imaging] WARNING: image '{label}' may contain clipping")
N = compute_mot_number(
array if "background" not in self.arrays.keys() \
else (
array.astype(np.float64)
- self.arrays["background"].astype(np.float64)
),
array,
0.40,
self.config["gain"], # dB
self.config["exposure_time"] * 1e-6, # s
(0.0127**2 * np.pi) / (4 * np.pi * 0.125**2),
50e6 * 2 * np.pi,
1.0
)
) - N_bkgd
sx, sy = lls_fit_gaussian(array, _dA)
self.results = dict() if self.results is None else self.results
self.results.update({
......@@ -198,7 +203,7 @@ class FluorescenceData(ImagingData):
def compute_mot_number(image, QE, gain, exposure_time, solid_angle,
detuning, intensity_parameter):
H, W = image.shape
im = image[H//5:4*H//5, W//5:4*W//5]
im = image[H//4:3*H//4, W//4:3*W//4]
#pd.Plotter().imshow(im).savefig("img.png").close()
electron_rate = im.astype(np.float64).sum()
photon_rate \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment