Streak Finder algorithm for CBD experiment #2
@@ -112,7 +112,7 @@ options:
|
||||
Input parameters:
|
||||
* `'do_whitefield_correction': 1/0` - Specifies whether to do in-place white field correction.
|
||||
* `'wf_data_file': str` - Path to the hdf5 file with corrected white field image.
|
||||
* `'wf_dataset': str` - Name of the dataset containing white field image in the hdf5 file.
|
||||
* `'wf_dataset': str` [Optional] - Name of the dataset containing white field image in the hdf5 file, default is `"data/data"`.
|
||||
* `'wf_method': 'div'|'sub'` - Method of white field correction - either division or subtraction is supported.
|
||||
|
||||
Algorithm Output:
|
||||
|
||||
@@ -53,11 +53,12 @@ def calc_apply_whitefield_correction(results, data):
|
||||
f"{params_required=}")
|
||||
return
|
||||
|
||||
wf_dataset = results.get("wf_dataset", "data/data")
|
||||
# TODO: cache white field data, only reload if file changed
|
||||
# maybe store checksum in results as "_checksum"
|
||||
try:
|
||||
with h5py.File(wf_data_file, "r") as wfile:
|
||||
whitefield_image = np.asarray(wfile["data/data"])
|
||||
whitefield_image = np.asarray(wfile[wf_dataset])
|
||||
except Exception as error:
|
||||
print(f"ERROR: Can't read whitefield from file {wf_data_file}. Skipping\n"
|
||||
f"{error=}")
|
||||
|
||||
Reference in New Issue
Block a user