Cleaned up settling time maths to only calculate once
This commit is contained in:
parent
35e1d6cdee
commit
628fd145f3
1 changed files with 5 additions and 6 deletions
|
|
@ -318,7 +318,7 @@ class AutofocusThing(Thing):
|
|||
logger=logger,
|
||||
)
|
||||
captured_time = time.time()
|
||||
# There's an unnecessary move up at the end of the stack
|
||||
|
||||
if capture_count + 1 < images_to_capture:
|
||||
stage.move_relative(z=stack_dz)
|
||||
moved_time = time.time()
|
||||
|
|
@ -332,11 +332,10 @@ class AutofocusThing(Thing):
|
|||
logger=logger,
|
||||
)
|
||||
saved_time = time.time()
|
||||
if saved_time - start_time < SETTLING_TIME:
|
||||
time.sleep(SETTLING_TIME - (saved_time - start_time))
|
||||
logger.info(
|
||||
f"Settled for an extra {round(SETTLING_TIME - (saved_time - start_time), 3)} seconds"
|
||||
)
|
||||
time_remaining = SETTLING_TIME - (saved_time - start_time)
|
||||
if time_remaining > 0:
|
||||
time.sleep(time_remaining)
|
||||
logger.info(f"Settled for an extra {round(time_remaining, 3)} seconds")
|
||||
logger.debug(f"Capturing took {round(captured_time - start_time, 2)} s")
|
||||
logger.debug(f"Resizing took {round(downsampled_time - moved_time, 2)} s")
|
||||
logger.debug(f"Saving took {round(saved_time - downsampled_time, 2)} s")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue