From 459a8dc2a3ad31efa7fc1374734fd621a1883619 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 26 Oct 2020 13:36:36 +0000 Subject: [PATCH] Reset tracker frames after each mode --- openflexure_microscope/api/default_extensions/autofocus.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/api/default_extensions/autofocus.py b/openflexure_microscope/api/default_extensions/autofocus.py index 67306399..089eae4c 100644 --- a/openflexure_microscope/api/default_extensions/autofocus.py +++ b/openflexure_microscope/api/default_extensions/autofocus.py @@ -54,6 +54,8 @@ class JPEGSharpnessMonitor: # Make timestamp absolute Unix time self.jpeg_times.append(frame.time) self.jpeg_sizes.append(frame.size) + # Clear frame data for this move from the stream + self.camera.stream.reset_tracking() # Index of the data for this movement data_index = len(self.stage_positions) - 2 @@ -62,7 +64,7 @@ class JPEGSharpnessMonitor: return data_index, final_z_position def move_data(self, istart, istop=None): - "Extract sharpness as a function of (interpolated) z" + """Extract sharpness as a function of (interpolated) z""" if istop is None: istop = istart + 2 jpeg_times = np.array(self.jpeg_times)