manage exit code of 'get_image' and 'set_focus' functions
This commit is contained in:
@@ -388,12 +388,16 @@ def focussingSequence(
|
|||||||
executor = ProcessPoolExecutor(max_workers=max_wks)
|
executor = ProcessPoolExecutor(max_workers=max_wks)
|
||||||
|
|
||||||
i_foc = 0
|
i_foc = 0
|
||||||
|
ret_code = 0
|
||||||
for foc_val in focus_value:
|
for foc_val in focus_value:
|
||||||
print(log_ident, file=log_output, end="")
|
print(log_ident, file=log_output, end="")
|
||||||
print("set focus value to {:g} ...\t".format(foc_val), file=log_output, end="")
|
print("set focus value to {:g} ...\t".format(foc_val), file=log_output, end="")
|
||||||
|
|
||||||
set_focus_func(foc_val)
|
ret_code = set_focus_func(foc_val)
|
||||||
|
if ret_code:
|
||||||
|
print("FAIL!", file=log_output)
|
||||||
|
break
|
||||||
|
else:
|
||||||
print("OK", file=log_output)
|
print("OK", file=log_output)
|
||||||
|
|
||||||
filename = "{}_{:04d}{}".format(fname, i_foc, file_ext)
|
filename = "{}_{:04d}{}".format(fname, i_foc, file_ext)
|
||||||
@@ -417,11 +421,16 @@ def focussingSequence(
|
|||||||
|
|
||||||
print("OK", file=log_output)
|
print("OK", file=log_output)
|
||||||
|
|
||||||
|
if ret_code == 0:
|
||||||
fit_res = fitFocusCurve(focus_value, flux_rad, **seq_kwds)
|
fit_res = fitFocusCurve(focus_value, flux_rad, **seq_kwds)
|
||||||
|
|
||||||
ret_val["focus_value"] = fit_res[0]
|
ret_val["focus_value"] = fit_res[0]
|
||||||
ret_val["coeffs"] = fit_res[1]
|
ret_val["coeffs"] = fit_res[1]
|
||||||
ret_val["is_robust"] = fit_res[2]
|
ret_val["is_robust"] = fit_res[2]
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
"THERE WERE ERRORS DURING FOCUSSING SEQUENCE SO NO BEST FOCUS IS AVAILABLE!!!"
|
||||||
|
)
|
||||||
|
|
||||||
return ret_val
|
return ret_val
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user