Remove verify_autofocus from autofocus

This commit is contained in:
jaknapper 2025-05-08 17:32:04 +01:00
parent ee190ec66b
commit bdb307ca18

View file

@ -253,22 +253,6 @@ class AutofocusThing(Thing):
stage.move_absolute(z=peak_height)
return heights.tolist(), sizes.tolist()
@thing_action
def verify_focus_sharpness(
self, sweep_sizes: list, camera: WrappedCamera, threshold: float = 0.95
):
"""Take the sharpness curve of the autofocus, and the size of the current frame
to see if the autofocus completed successfully. Returns True if current sharpness
is within "leniency" number of frames from the peak of the autofocus"""
current_sharpness = camera.grab_jpeg_size(stream_name="lores")
peak = np.max(sweep_sizes)
base = np.min(sweep_sizes)
cutoff = threshold * (peak - base)
return current_sharpness >= base + cutoff
@thing_property
def stack_images_to_capture(self) -> int:
"""The number of images to capture and save in a stack