add init_seq_func to focussingSequence function. Add 'start_idx' key to sequenc control dictionary (see getFocusSequencePars). Rewrite aps
This commit is contained in:
@@ -20,6 +20,26 @@ import pathlib as pl
|
||||
# --- FLI-hardware related (ROBOTEL variant)
|
||||
|
||||
|
||||
def init_seq(seq_kwds):
|
||||
# remove extension as Eddy's 'fli_control' add hardcoded '.fit'
|
||||
pt = pl.Path(seq_kwds["root_filename"]).with_suffix("")
|
||||
seq_kwds["root_filename"] = str(pt)
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
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):
|
||||
cmd = ["fli_control", "-g", str(int(foc_val))]
|
||||
ret = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE)
|
||||
@@ -55,6 +75,6 @@ if __name__ == "__main__":
|
||||
description="FLI CCD and focuser hardware: focussing sequence implementation. It is assumed that 'fli_control' software is installed in the OS.",
|
||||
)
|
||||
|
||||
ret = focussing_app(parser, set_focus, get_image)
|
||||
ret = focussing_app(parser, init_seq, set_focus, get_image)
|
||||
|
||||
sys.exit(ret)
|
||||
|
||||
Reference in New Issue
Block a user