Streak Finder algorithm for CBD experiment #2
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user