From 1677f0df76efbabfa1e74f0ae1ff3a557b5120fd Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 19 Oct 2020 18:34:58 +0100 Subject: [PATCH] Blackened --- openflexure_microscope/api/default_extensions/autofocus.py | 6 +++--- openflexure_microscope/api/default_extensions/scan.py | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/openflexure_microscope/api/default_extensions/autofocus.py b/openflexure_microscope/api/default_extensions/autofocus.py index 803e95ae..c292277a 100644 --- a/openflexure_microscope/api/default_extensions/autofocus.py +++ b/openflexure_microscope/api/default_extensions/autofocus.py @@ -228,7 +228,7 @@ def fast_autofocus(microscope, dz=2000): """Perform a down-up-down-up autofocus""" with microscope.camera.lock, microscope.stage.lock: with monitor_sharpness(microscope) as m: - # Move to (-dz / 2) + # Move to (-dz / 2) m.focus_rel(-dz / 2) # Move to dz while monitoring sharpness # i: Sharpness monitor index for this move @@ -237,8 +237,8 @@ def fast_autofocus(microscope, dz=2000): # Get the z position with highest sharpness from the previous move (index i) fz = m.sharpest_z_on_move(i) # Move all the way to the start so it's consistent - # Store final absolute z position from this return move - i, z = m.focus_rel(-dz) + # Store final absolute z position from this return move + i, z = m.focus_rel(-dz) # Move to the target position fz # Can't do absolute move here yet so move by (fz - z) m.focus_rel(fz - z) diff --git a/openflexure_microscope/api/default_extensions/scan.py b/openflexure_microscope/api/default_extensions/scan.py index d741893a..5f3a5c48 100644 --- a/openflexure_microscope/api/default_extensions/scan.py +++ b/openflexure_microscope/api/default_extensions/scan.py @@ -203,9 +203,7 @@ class ScanExtension(BaseExtension): if autofocus_enabled: if fast_autofocus: # Run fast autofocus. Client should provide dz ~ 2000 - autofocus_extension.fast_autofocus( - microscope, dz=autofocus_dz - ) + autofocus_extension.fast_autofocus(microscope, dz=autofocus_dz) else: # Run slow autofocus. Client should provide dz ~ 50 autofocus_extension.autofocus(