Commit 0e6dc676 authored by Yb Tweezer's avatar Yb Tweezer
Browse files

don't compress saved arrays for speed; add better option for rendering debugging arrays

parent 82ea1796
......@@ -38,7 +38,8 @@ class ImagingData:
arrays_file = io.fresh_filename(T.joinpath("arrays.npz"), overwrite)
if printflag: print("[imaging] save arrays")
np.savez_compressed(arrays_file, **self.arrays)
#np.savez_compressed(arrays_file, **self.arrays)
np.savez(arrays_file, **self.arrays)
config_file = io.fresh_filename(T.joinpath("config.toml"), overwrite)
if printflag: print("[imaging] save camera config")
......@@ -190,9 +191,9 @@ class FluorescenceData(ImagingData):
N_bkgd = compute_mot_number(
self.arrays["background"].astype(np.float64),
**compute_mot_number_params,
k=0
k=None
) if subtract_bkgd and "background" in self.arrays.keys() else 0.0
for label, array in self.arrays.items():
for k, (label, array) in enumerate(self.arrays.items()):
dtype_info = np.iinfo(array.dtype)
if array.max() >= (dtype_info.max - dtype_info.bits):
print(
......@@ -200,7 +201,7 @@ class FluorescenceData(ImagingData):
N = compute_mot_number(
array.astype(np.float64),
**compute_mot_number_params,
k=1
k=None
)
sx, sy = lls_fit_gaussian(array, _dA)
self.results = dict() if self.results is None else self.results
......@@ -215,15 +216,16 @@ class FluorescenceData(ImagingData):
return self
def compute_mot_number(image, QE, gain, exposure_time, solid_angle,
detuning, intensity_parameter, k=0):
detuning, intensity_parameter, k=None):
H, W = image.shape
K_h = 3.0
slice_h = pd.S[int(H / K_h) : int((K_h - 1) * H / K_h)]
K_w = 3.0
slice_w = pd.S[int(W / K_w) : int((K_w - 1) * W / K_w)]
im = image[slice_h, slice_w]
#pd.Plotter().imshow(image).savefig(f"image_{k}.png").close()
#pd.Plotter().imshow(im).savefig(f"img_{k}.png").close()
if k is not None:
pd.Plotter().imshow(image).savefig(f"image_{k}.png").close()
pd.Plotter().imshow(im).savefig(f"img_{k}.png").close()
electron_rate = im.astype(np.float64).sum()
photon_rate = (
electron_rate
......
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