Commit aa2cc35e authored by whooie's avatar whooie
Browse files

better data clipping check and background subtraction

parent d6d90340
......@@ -168,9 +168,14 @@ class FluorescenceData(ImagingData):
for label, array in self.arrays.items():
if label == "background":
continue
if array.max() == np.iinfo(array.dtype).max:
print("[imaging] WARNING: image may contain clipping")
N = compute_mot_number(
array if "background" not in self.arrays.keys() \
else array - self.arrays["background"],
else (
array.astype(np.float64)
- self.arrays["background"].astype(np.float64)
),
0.40,
self.config["gain"], # dB
self.config["exposure_time"] * 1e-6, # s
......@@ -191,8 +196,6 @@ class FluorescenceData(ImagingData):
def compute_mot_number(image, QE, gain, exposure_time, solid_angle,
detuning, intensity_parameter):
if image.max() >= np.iinfo(image.dtype).max:
print("[imaging] WARNING: image may contain clipping")
H, W = image.shape
im = image[H//3:2*H//3, W//3:2*W//3]
pd.Plotter().imshow(im).savefig("img.png").close()
......
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