Compare commits
2 Commits
66c10e2f31
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ca66cd142 | |||
| 8a783405bb |
@@ -7,6 +7,10 @@
|
|||||||
# This variant of the script uses Eddy Emelianov's
|
# This variant of the script uses Eddy Emelianov's
|
||||||
# 'fli_control' executable
|
# 'fli_control' executable
|
||||||
#
|
#
|
||||||
|
# 27.04.2026 (Fatkhullin T.A.)
|
||||||
|
# changes according to Eddy Emelianov's "ccd_capture" executable
|
||||||
|
# (a new age FLI hardware control software)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
from OBSUTILS import focussing_app
|
from OBSUTILS import focussing_app
|
||||||
@@ -16,20 +20,44 @@ import subprocess as sp
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pathlib as pl
|
import pathlib as pl
|
||||||
|
|
||||||
|
|
||||||
# --- FLI-hardware related (ROBOTEL variant)
|
# --- FLI-hardware related (ROBOTEL variant)
|
||||||
|
|
||||||
|
# common "ccd_capture" executable commandline options
|
||||||
|
ccd_capture_cmd_common = [
|
||||||
|
"ccd_capture",
|
||||||
|
"-VVV",
|
||||||
|
"--plugin",
|
||||||
|
"libdevfli.so",
|
||||||
|
"-r",
|
||||||
|
"/tmp/10micron.fitsheader",
|
||||||
|
"-r",
|
||||||
|
"/tmp/telescope.fitsheader",
|
||||||
|
"-r",
|
||||||
|
"/tmp/dome.fitsheader",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def init_seq(seq_kwds):
|
def init_seq(seq_kwds):
|
||||||
# replace extension since Eddy's 'fli_control' adds hardcoded '.fit'
|
# # replace extension since Eddy's 'fli_control' adds hardcoded '.fit'
|
||||||
pt = pl.Path(seq_kwds["root_filename"]).with_suffix(".fit")
|
# pt = pl.Path(seq_kwds["root_filename"]).with_suffix(".fit")
|
||||||
|
# seq_kwds["root_filename"] = str(pt)
|
||||||
|
|
||||||
|
pt = pl.Path(seq_kwds["root_filename"])
|
||||||
|
if not len(pt.suffix):
|
||||||
|
pt.with_suffix(".fits")
|
||||||
seq_kwds["root_filename"] = str(pt)
|
seq_kwds["root_filename"] = str(pt)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
# search for existing files
|
||||||
|
# and compute start index of focus file
|
||||||
#
|
#
|
||||||
|
|
||||||
foc_files = list(
|
foc_files = list(
|
||||||
pt.absolute().parent.glob("{}_[0-9][0-9][0-9][0-9].fit".format(pt.stem))
|
# 27.04.2026
|
||||||
|
pt.absolute().parent.glob(
|
||||||
|
"{}_[0-9][0-9][0-9][0-9]{}".format(pt.stem, pt.suffix)
|
||||||
|
)
|
||||||
|
# pt.absolute().parent.glob("{}_[0-9][0-9][0-9][0-9].fit".format(pt.stem))
|
||||||
)
|
)
|
||||||
|
|
||||||
seq_kwds["start_idx"] = 1
|
seq_kwds["start_idx"] = 1
|
||||||
@@ -51,7 +79,12 @@ def set_focus(foc_val):
|
|||||||
print("INVALID FLI-FOCUSER VALUE! IT MUST BE NON-NEGATIVE VALUE!")
|
print("INVALID FLI-FOCUSER VALUE! IT MUST BE NON-NEGATIVE VALUE!")
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
cmd = ["fli_control", "-g", str(int(foc_val))]
|
# cmd = ["fli_control", "-g", str(int(foc_val))]
|
||||||
|
|
||||||
|
# 27.04.2026
|
||||||
|
# cmd = ["ccd_capture", "-VVV", "--plugin", "libdevfli.so", "-r", "/tmp/10micron.fitsheader", "-r", "/tmp/telescope.fitsheader", "-r", "/tmp/dome.fitsheader", "-g", str(foc_val)]
|
||||||
|
cmd = ccd_capture_cmd_common + ["-g", str(foc_val)]
|
||||||
|
|
||||||
ret = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE)
|
ret = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE)
|
||||||
return ret.returncode
|
return ret.returncode
|
||||||
|
|
||||||
@@ -61,19 +94,22 @@ def get_image(filename, exp_time):
|
|||||||
# Eddy's 'fli_control' related stub:
|
# Eddy's 'fli_control' related stub:
|
||||||
# filename is expected in form 'rootname_DDDD.ext'
|
# filename is expected in form 'rootname_DDDD.ext'
|
||||||
# convert it to 'rootname'
|
# convert it to 'rootname'
|
||||||
#
|
|
||||||
|
|
||||||
fname = str(filename).split("_")
|
# fname = str(filename).split("_")
|
||||||
fname = fname[0]
|
# fname = fname[0]
|
||||||
|
|
||||||
cmd = [
|
# cmd = [
|
||||||
"fli_control",
|
# "fli_control",
|
||||||
"-r",
|
# "-r",
|
||||||
"/tmp/10micron.fitsheader",
|
# "/tmp/10micron.fitsheader",
|
||||||
"-x",
|
# "-x",
|
||||||
"{:d}".format(int(np.round(exp_time * 1000))), # to microseconds
|
# "{:d}".format(int(np.round(exp_time * 1000))), # to microseconds
|
||||||
fname,
|
# fname,
|
||||||
]
|
# ]
|
||||||
|
|
||||||
|
# 27.04.2026
|
||||||
|
# cmd = ["ccd_capture", "-VVV", "--plugin", "libdevfli.so", "-r", "/tmp/10micron.fitsheader", "-r", "/tmp/telescope.fitsheader", "-r", "/tmp/dome.fitsheader", "-x", str(exp_time), "-o", filename]
|
||||||
|
cmd = ccd_capture_cmd_common + ["-x", str(exp_time), "-o", filename]
|
||||||
|
|
||||||
ret = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE)
|
ret = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE)
|
||||||
return ret.returncode
|
return ret.returncode
|
||||||
@@ -82,7 +118,9 @@ def get_image(filename, exp_time):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = ap.ArgumentParser(
|
parser = ap.ArgumentParser(
|
||||||
prog="{}".format(pl.Path(sys.argv[0]).name),
|
prog="{}".format(pl.Path(sys.argv[0]).name),
|
||||||
description="FLI CCD and focuser hardware: focussing sequence implementation. It is assumed that 'fli_control' software is installed in the OS.",
|
# 27.04.2026
|
||||||
|
description="FLI CCD and focuser hardware: focussing sequence implementation. It is assumed that 'ccd_capture' software is installed in the OS.",
|
||||||
|
# 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, init_seq, set_focus, get_image)
|
ret = focussing_app(parser, init_seq, set_focus, get_image)
|
||||||
|
|||||||
Reference in New Issue
Block a user