Fix memory leak in streak finder #3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user