Streak Finder algorithm for CBD experiment #2

Merged
augustin_s merged 46 commits from ext-dorofe_e/dap:chapman into main 2025-07-14 11:18:07 +02:00
Showing only changes of commit b6df4986de - Show all commits

View File

@@ -48,7 +48,7 @@ def _generate_cryst_data(results, data, pf_pixel_mask) -> CrystData:
"scale_whitefield", # Bool
]
if not all([param in results.keys() for param in params_required]):
if not all(param in results.keys() for param in params_required):
raise ValueError(f"ERROR: Not enough parameters for CBD correction. Skipping\n"
f"{params_required=}")
@@ -104,7 +104,7 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
"sf_num_threads",
]
if not all([param in results.keys() for param in params_required]):
if not all(param in results.keys() for param in params_required):
print(f"ERROR: Not enough parameters for streak finder analysis. Skipping.\n"
f"{params_required=}")
return
@@ -182,7 +182,7 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
streak_lines = streak_lines.T
_, number_of_streaks = streak_lines.shape
list_result = [line.tolist() for line in streak_lines] # arr(4, n_lines); 0coord x0, y0, x1, y1
list_result = streak_lines.tolist() # arr(4, n_lines); 0coord x0, y0, x1, y1
bragg_counts = [streak.total_mass() for streak in detected_streaks]