Streak Finder algorithm for CBD experiment #2
@@ -15,14 +15,14 @@ def calc_apply_additional_mask_from_file(results, pixel_mask_pf):
|
||||
# Support for hdf5 and npy
|
||||
if mask_file.endswith(".npy"):
|
||||
try:
|
||||
mask = np.load(mask_file)
|
||||
mask = np.asarray(np.load(mask_file), dtype=bool)
|
||||
except Exception as error:
|
||||
print(f"Error loading mask data from NumPy file {mask_file}:\n{error}")
|
||||
return
|
||||
else:
|
||||
try:
|
||||
with h5py.File(mask_file, "r") as mask_file:
|
||||
mask = np.asarray(mask_file[mask_dataset])
|
||||
mask = np.asarray(mask_file[mask_dataset], dtype=bool)
|
||||
except Exception as error:
|
||||
print(f"Error loading mask from hdf5 file {mask_file}:\n{error}")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user