diff --git a/tools.py b/tools.py index 164f0b046829764c373701d288cba92b7b958f4b..30f1143a6d671aeb9574ce20f527b6f74ecdf36d 100644 --- a/tools.py +++ b/tools.py @@ -353,8 +353,11 @@ class TrapState: _thread.daemon = True _thread.start() if self.trap_state == 'Empty': - _laser_switch(False) - _laser_switch(True) + try: + _laser_switch(False) + _laser_switch(True) + except requests.exceptions.ConnectionError: + pass def update_coord(self, coord): """ @@ -791,7 +794,7 @@ def _max_coord(image, width=False): image = image[region[0, 1]:region[1, 1], region[0, 0]:region[1, 0]] filt_image = _difference_of_gaussians(image, low_sigma=settings.BLOB_SIZE, preserve_range=True) - coordinates = peak_local_max(filt_image, threshold_abs=0.85, min_distance=settings.ION_DIST) + coordinates = peak_local_max(filt_image, threshold_abs=1, min_distance=settings.ION_DIST) if width: try: