From e183381e38b4c56d56eef350d44e819fc1ecaee4 Mon Sep 17 00:00:00 2001 From: amitjans <amitjans@ethz.ch> Date: Tue, 1 Jun 2021 14:00:25 +0200 Subject: [PATCH] save values in shared memory --- calibrate.py | 4 ++-- main.py | 5 +++-- tools.py | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/calibrate.py b/calibrate.py index f56afd5..be0534c 100644 --- a/calibrate.py +++ b/calibrate.py @@ -21,8 +21,8 @@ def main(): pos, _ = ion_positions(image) user_2 = input("Use (detected) dark ions for calibration? (y, [n]) ") if user_2 in ("y", "yes"): - read_factor(conn) - pos = dark_ions(image, pos) + dist_factor = read_factor(conn) + pos = dark_ions(image, pos, dist_factor) pos = pos[:, 1] if len(pos) > 1: diff --git a/main.py b/main.py index b718310..6d34d3c 100644 --- a/main.py +++ b/main.py @@ -132,7 +132,7 @@ class Main: self.roundness = -1 if not ion_cloud: - self._processing(self.image, dist_factor) + self._processing(self.image.copy(), dist_factor) # Update running time self.running_time = time.time() - self.init_time @@ -140,9 +140,10 @@ class Main: self.init_time = time.time() # Save variables in self.memory - + self._save_in_memory() self.num += 1 self.sem.release() + time.sleep(0.1) def _processing(self, image, dist_factor): self.coord, self.max_spot_size = ion_positions(image) diff --git a/tools.py b/tools.py index 1641309..be55cf9 100644 --- a/tools.py +++ b/tools.py @@ -403,8 +403,9 @@ def dark_ions(image, coord, dist_factor): coord = coord[coord[:, 1] < image.shape[1]] # remove points outside the image if loss.min() > 20: - warnings.warn("Loss is too high... " - "Try calculating a new factor value using calibrate() function.") + # warnings.warn("Loss is too high... " + # "Try calculating a new factor value using calibrate() function.") + pass return coord -- GitLab