From 7e85775f287658aff1cce71e417105aeef3f3e0a Mon Sep 17 00:00:00 2001
From: amitjans <amitjans@ethz.ch>
Date: Thu, 8 Jul 2021 09:05:52 +0200
Subject: [PATCH] Small fix

---
 tools.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools.py b/tools.py
index 4f1b284..792271d 100644
--- a/tools.py
+++ b/tools.py
@@ -128,6 +128,7 @@ class Main:
                 self.fit_avg.update_value(fit_error)
         else:
             roundness = 0
+            fit_error = -1
             max_int, num_pix = (0, 0)
             linearity = "No ions"
 
@@ -641,6 +642,9 @@ def dark_ions(image, coord, dist_factor):
         #     warnings.warn("Loss is too high... "
         #     "Try calculating a new factor value using calibrate() function.")
 
+    else:
+        loss = np.array([-1])
+
     return coord, loss.min()
 
 
-- 
GitLab