fixes during real tests
This commit is contained in:
@@ -20,7 +20,7 @@ import subprocess as sp
|
||||
|
||||
|
||||
def set_focus(foc_val):
|
||||
cmd = ["fli_control", "-g", str(foc_val)]
|
||||
cmd = ["fli_control", "-g", str(int(foc_val))]
|
||||
ret = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE)
|
||||
return ret.returncode
|
||||
|
||||
@@ -32,7 +32,7 @@ def get_image(filename, exp_time):
|
||||
# convert it to 'rootname'
|
||||
#
|
||||
|
||||
fname = filename.split("_")
|
||||
fname = str(filename).split("_")
|
||||
fname = fname[0]
|
||||
|
||||
cmd = [
|
||||
@@ -137,6 +137,8 @@ if __name__ == "__main__":
|
||||
print("START FOCUSSING SEQUENCE ...")
|
||||
|
||||
if args.guess: # rough focus estimation
|
||||
if args.verbose:
|
||||
print("\trough focus estimation ...")
|
||||
result = obsutil.focussingSequence(
|
||||
[focus_start, focus_stop],
|
||||
set_focus,
|
||||
@@ -156,6 +158,10 @@ if __name__ == "__main__":
|
||||
focus_start = result["focus_value"] - r
|
||||
focus_stop = result["focus_value"] + r
|
||||
|
||||
if args.verbose:
|
||||
print("\testimate guess focus position in range [{:g},{:g}]".format(focus_start, focus_stop))
|
||||
|
||||
|
||||
if np.isfinite(args.focus_step):
|
||||
result = obsutil.focussingSequence(
|
||||
[focus_start, focus_stop, focus_step],
|
||||
@@ -178,7 +184,7 @@ if __name__ == "__main__":
|
||||
if args.verbose:
|
||||
print("\tThe best focus value: {:g}".format(result["focus_value"]))
|
||||
|
||||
if not args.do_no_set:
|
||||
if not args.do_not_set:
|
||||
if args.verbose:
|
||||
print("\n\tSet focus to the best value ...", end="")
|
||||
set_focus(result["focus_value"])
|
||||
|
||||
Reference in New Issue
Block a user