Simplify results dictionary updates in streak finder
This commit is contained in:
@@ -147,11 +147,11 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
|
||||
detected = detected[0]
|
||||
|
||||
if not detected.streaks:
|
||||
results.update({"number_of_streaks": 0})
|
||||
results.update({"is_hit_frame": False})
|
||||
results.update({"streaks": []})
|
||||
results.update({"streak_lengths": []})
|
||||
results.update({"bragg_counts": []})
|
||||
results["number_of_streaks"] = 0
|
||||
results["is_hit_frame"] = False
|
||||
results["streaks"] = []
|
||||
results["streak_lengths"] = []
|
||||
results["bragg_counts"] = []
|
||||
return
|
||||
|
||||
streaks = det_obj.to_streaks(detected)
|
||||
@@ -183,8 +183,8 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
|
||||
|
||||
bragg_counts = [streak.total_mass() for streak in detected_streaks]
|
||||
|
||||
results.update({"number_of_streaks": number_of_streaks})
|
||||
results.update({"is_hit_frame": number_of_streaks > 0})
|
||||
results.update({"streaks": list_result})
|
||||
results.update({"streak_lengths": streak_lengths})
|
||||
results.update({"bragg_counts": bragg_counts})
|
||||
results["number_of_streaks"] = number_of_streaks
|
||||
results["is_hit_frame"] = (number_of_streaks > 5)
|
||||
results["streaks"] = list_result
|
||||
results["streak_lengths"] = streak_lengths
|
||||
results["bragg_counts"] = bragg_counts
|
||||
|
||||
Reference in New Issue
Block a user