SETTLING_TIME global in stacking
This commit is contained in:
parent
478c3629c9
commit
968bd339c2
2 changed files with 8 additions and 3 deletions
|
|
@ -36,8 +36,8 @@ from .capture import CaptureThing
|
||||||
|
|
||||||
CaptureDep = direct_thing_client_dependency(CaptureThing, "/capture/")
|
CaptureDep = direct_thing_client_dependency(CaptureThing, "/capture/")
|
||||||
|
|
||||||
SETTLING_TIME = 0.3
|
|
||||||
STACK_OVERSHOOT = 200
|
STACK_OVERSHOOT = 200
|
||||||
|
SETTLING_TIME = 0.3
|
||||||
|
|
||||||
|
|
||||||
class JPEGSharpnessMonitor:
|
class JPEGSharpnessMonitor:
|
||||||
|
|
@ -322,7 +322,8 @@ class AutofocusThing(Thing):
|
||||||
if capture_count + 1 < images_to_capture:
|
if capture_count + 1 < images_to_capture:
|
||||||
stage.move_relative(z=stack_dz)
|
stage.move_relative(z=stack_dz)
|
||||||
moved = time.time()
|
moved = time.time()
|
||||||
image = image.resize(target_resolution, Image.BOX)
|
if image.size != target_resolution:
|
||||||
|
image = image.resize(target_resolution, Image.BOX)
|
||||||
downsampled = time.time()
|
downsampled = time.time()
|
||||||
capture._save_capture(
|
capture._save_capture(
|
||||||
jpeg_path=jpeg_path,
|
jpeg_path=jpeg_path,
|
||||||
|
|
@ -331,6 +332,11 @@ class AutofocusThing(Thing):
|
||||||
logger=logger,
|
logger=logger,
|
||||||
)
|
)
|
||||||
saved = time.time()
|
saved = time.time()
|
||||||
|
if saved - start < SETTLING_TIME:
|
||||||
|
time.sleep(SETTLING_TIME - (saved - start))
|
||||||
|
logger.info(
|
||||||
|
f"Settled for an extra {round(SETTLING_TIME - (saved - start), 3)} seconds"
|
||||||
|
)
|
||||||
logger.debug(f"Capturing took {round(captured - start, 2)} s")
|
logger.debug(f"Capturing took {round(captured - start, 2)} s")
|
||||||
logger.debug(f"Resizing took {round(downsampled - moved, 2)} s")
|
logger.debug(f"Resizing took {round(downsampled - moved, 2)} s")
|
||||||
logger.debug(f"Saving took {round(saved - downsampled, 2)} s")
|
logger.debug(f"Saving took {round(saved - downsampled, 2)} s")
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,6 @@ class CameraProtocol(Protocol):
|
||||||
for the main stream"""
|
for the main stream"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@thing_action
|
|
||||||
def capture_image(self, stream_name, wait):
|
def capture_image(self, stream_name, wait):
|
||||||
"""Capture a PIL image from stream stream_name with timeout wait"""
|
"""Capture a PIL image from stream stream_name with timeout wait"""
|
||||||
...
|
...
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue