Fix memory leak in streak finder #3

Merged
augustin_s merged 15 commits from ext-dorofe_e/dap:cbd_bugfix into main 2025-07-15 10:21:21 +02:00
Showing only changes of commit e3efd82b2c - Show all commits

View File

@@ -48,7 +48,7 @@ def calc_streakfinder_analysis(results, data, pf_pixel_mask):
data = cryst_data #.snr[0].copy()
try:
_calc_streakfinder_analysis(results, cryst_data)
_calc_streakfinder_analysis(results, cryst_data, pf_pixel_mask)
except Exception as error: # Broad exception - we don't want to break anything here
results["cbd_error"] = f"Error processing CBD data:\n{error}"
# print(f"Deleting cryst data;\nmem used before {virtual_memory().used // pow(2, 30)} Gb ")
@@ -219,8 +219,8 @@ def _calc_streakfinder_analysis(results, snr, mask):
detected_streaks = detected_streaks[streaks_mask]
streak_lengths = np.sqrt(
np.pow((streak_lines[..., 2] - streak_lines[..., 0]), 2) +
np.pow((streak_lines[..., 2] - streak_lines[..., 0]), 2)
np.power((streak_lines[..., 2] - streak_lines[..., 0]), 2) +
np.power((streak_lines[..., 2] - streak_lines[..., 0]), 2)
).tolist()
streak_lines = streak_lines.T