Blackened
This commit is contained in:
parent
b9bed71272
commit
1677f0df76
2 changed files with 4 additions and 6 deletions
|
|
@ -228,7 +228,7 @@ def fast_autofocus(microscope, dz=2000):
|
||||||
"""Perform a down-up-down-up autofocus"""
|
"""Perform a down-up-down-up autofocus"""
|
||||||
with microscope.camera.lock, microscope.stage.lock:
|
with microscope.camera.lock, microscope.stage.lock:
|
||||||
with monitor_sharpness(microscope) as m:
|
with monitor_sharpness(microscope) as m:
|
||||||
# Move to (-dz / 2)
|
# Move to (-dz / 2)
|
||||||
m.focus_rel(-dz / 2)
|
m.focus_rel(-dz / 2)
|
||||||
# Move to dz while monitoring sharpness
|
# Move to dz while monitoring sharpness
|
||||||
# i: Sharpness monitor index for this move
|
# 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)
|
# Get the z position with highest sharpness from the previous move (index i)
|
||||||
fz = m.sharpest_z_on_move(i)
|
fz = m.sharpest_z_on_move(i)
|
||||||
# Move all the way to the start so it's consistent
|
# Move all the way to the start so it's consistent
|
||||||
# Store final absolute z position from this return move
|
# Store final absolute z position from this return move
|
||||||
i, z = m.focus_rel(-dz)
|
i, z = m.focus_rel(-dz)
|
||||||
# Move to the target position fz
|
# Move to the target position fz
|
||||||
# Can't do absolute move here yet so move by (fz - z)
|
# Can't do absolute move here yet so move by (fz - z)
|
||||||
m.focus_rel(fz - z)
|
m.focus_rel(fz - z)
|
||||||
|
|
|
||||||
|
|
@ -203,9 +203,7 @@ class ScanExtension(BaseExtension):
|
||||||
if autofocus_enabled:
|
if autofocus_enabled:
|
||||||
if fast_autofocus:
|
if fast_autofocus:
|
||||||
# Run fast autofocus. Client should provide dz ~ 2000
|
# Run fast autofocus. Client should provide dz ~ 2000
|
||||||
autofocus_extension.fast_autofocus(
|
autofocus_extension.fast_autofocus(microscope, dz=autofocus_dz)
|
||||||
microscope, dz=autofocus_dz
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
# Run slow autofocus. Client should provide dz ~ 50
|
# Run slow autofocus. Client should provide dz ~ 50
|
||||||
autofocus_extension.autofocus(
|
autofocus_extension.autofocus(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue