Only undershoot z stack if image count > 1, settle before first capture

This commit is contained in:
jaknapper 2025-05-08 20:05:16 +01:00 committed by Julian Stirling
parent 744ec28f93
commit 0d32983b62

View file

@ -299,8 +299,10 @@ class AutofocusThing(Thing):
images_to_capture = self.stack_images_to_capture
stack_z_range = stack_dz * (images_to_capture - 1)
stage.move_relative(z=-(STACK_OVERSHOOT + stack_z_range / 2))
stage.move_relative(z=STACK_OVERSHOOT)
if stack_z_range > 0:
stage.move_relative(z=-(STACK_OVERSHOOT + stack_z_range / 2))
stage.move_relative(z=STACK_OVERSHOOT)
time.sleep(0.3)
for capture_count in range(images_to_capture):
time.sleep(SETTLING_TIME)