...
This commit is contained in:
@@ -251,7 +251,12 @@ def computeFocus(
|
|||||||
if len(futures):
|
if len(futures):
|
||||||
print("", file=log_output)
|
print("", file=log_output)
|
||||||
print(log_ident, file=log_output, end="")
|
print(log_ident, file=log_output, end="")
|
||||||
print("waiting for the end of calculations ...\t", file=log_output, end="", flush=True)
|
print(
|
||||||
|
"waiting for the end of calculations ...\t",
|
||||||
|
file=log_output,
|
||||||
|
end="",
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
|
||||||
for i in range(len(futures)):
|
for i in range(len(futures)):
|
||||||
flux_rad.append(futures[i].result())
|
flux_rad.append(futures[i].result())
|
||||||
@@ -390,41 +395,55 @@ def focussingSequence(
|
|||||||
ret_code = 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="", flush=True)
|
print(
|
||||||
|
"set focus value to {:g} ...\t".format(foc_val),
|
||||||
|
file=log_output,
|
||||||
|
end="",
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
|
||||||
ret_code = set_focus_func(foc_val)
|
ret_code = set_focus_func(foc_val)
|
||||||
if ret_code:
|
if ret_code:
|
||||||
ret_val["ret_code"] = ret_code
|
ret_val["ret_code"] = ret_code
|
||||||
print("FAIL!", file=log_output)
|
print("FAIL!", file=log_output, flush=True)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print("OK", file=log_output)
|
print("OK", file=log_output, flush=True)
|
||||||
|
|
||||||
filename = "{}_{:04d}{}".format(fname, i_foc, file_ext)
|
filename = "{}_{:04d}{}".format(fname, i_foc, file_ext)
|
||||||
full_filename = str(pt.Path.joinpath(dir, pt.Path(filename)))
|
full_filename = str(pt.Path.joinpath(dir, pt.Path(filename)))
|
||||||
|
|
||||||
print(log_ident, file=log_output, end="")
|
print(log_ident, file=log_output, end="")
|
||||||
print("get image '{}' ...\t".format(full_filename), file=log_output, end="", flush=True)
|
print(
|
||||||
|
"get image '{}' ...\t".format(full_filename),
|
||||||
|
file=log_output,
|
||||||
|
end="",
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
|
||||||
ret_code = get_image_func(full_filename, seq_kwds["exp_time"])
|
ret_code = get_image_func(full_filename, seq_kwds["exp_time"])
|
||||||
if ret_code:
|
if ret_code:
|
||||||
ret_val["ret_code"] = ret_code
|
ret_val["ret_code"] = ret_code
|
||||||
print("FAIL!", file=log_output)
|
print("FAIL!", file=log_output, flush=True)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print("OK", file=log_output)
|
print("OK", file=log_output, flush=True)
|
||||||
|
|
||||||
futures.append(executor.submit(amt.compute_mean_flux_radius, full_filename, **seq_kwds))
|
futures.append(
|
||||||
|
executor.submit(amt.compute_mean_flux_radius, full_filename, **seq_kwds)
|
||||||
|
)
|
||||||
i_foc += 1
|
i_foc += 1
|
||||||
|
|
||||||
print("", file=log_output)
|
print("", file=log_output, flush=True)
|
||||||
print(log_ident, file=log_output, end="")
|
print(log_ident, file=log_output, end="", flush=True)
|
||||||
print("waiting for the end of calculations ...\t", file=log_output, end="")
|
print(
|
||||||
|
"waiting for the end of calculations ...\t", file=log_output, end="", flush=True
|
||||||
|
)
|
||||||
|
|
||||||
for i in range(len(futures)):
|
for i in range(len(futures)):
|
||||||
flux_rad.append(futures[i].result())
|
flux_rad.append(futures[i].result())
|
||||||
|
|
||||||
print("OK", file=log_output)
|
print("OK", file=log_output, flush=True)
|
||||||
|
|
||||||
if ret_code == 0:
|
if ret_code == 0:
|
||||||
fit_res = fitFocusCurve(focus_value, flux_rad, **seq_kwds)
|
fit_res = fitFocusCurve(focus_value, flux_rad, **seq_kwds)
|
||||||
@@ -434,7 +453,10 @@ def focussingSequence(
|
|||||||
ret_val["is_robust"] = fit_res[2]
|
ret_val["is_robust"] = fit_res[2]
|
||||||
else:
|
else:
|
||||||
print(
|
print(
|
||||||
"THERE WERE ERRORS DURING FOCUSSING SEQUENCE SO NO BEST FOCUS IS AVAILABLE!!!"
|
"THERE WERE ERRORS DURING FOCUSSING SEQUENCE SO NO BEST FOCUS IS AVAILABLE!!!",
|
||||||
|
file=log_output,
|
||||||
|
end="",
|
||||||
|
flush=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
return ret_val
|
return ret_val
|
||||||
|
|||||||
Reference in New Issue
Block a user