add init_seq_func to focussingSequence function. Add 'start_idx' key to sequenc control dictionary (see getFocusSequencePars). Rewrite aps

This commit is contained in:
2024-10-11 17:06:08 +03:00
parent 2113f87eed
commit b7750ee029
4 changed files with 89 additions and 24 deletions

View File

@@ -17,6 +17,22 @@ import argparse as ap
import subprocess as sp
import numpy as np
import socket
import pathlib as pl
def init_seq(seq_kwds):
pt = pl.Path(seq_kwds["root_filename"])
foc_files = list(
pt.absolute().parent.glob("{}_[0-9][0-9][0-9][0-9].fit".format(pt.stem))
)
seq_kwds["start_idx"] = 1
N = len(foc_files)
if N > 0:
seq_kwds["start_idx"] = N
return 0
def set_focus(foc_val):
@@ -51,6 +67,6 @@ if __name__ == "__main__":
description="Zeiss-1000 and Andor Ixon EMCCD hardware: focussing sequence implementation.",
)
ret = focussing_app(parser, set_focus, get_image)
ret = focussing_app(parser, init_seq, set_focus, get_image)
sys.exit(ret)