Add parameter sf_min_hit_streaks to streak finder - Minimum number of discovered streaks to categorize frame as a hit
This commit is contained in:
@@ -134,6 +134,7 @@ options:
|
||||
streak is no more than ``sf_xtol``.
|
||||
* `'sf_nfa': 1` - Number of false alarms, allowed number of unaligned points in a streak.
|
||||
* `'sf_num_threads': int` - Number of threads to use for peak finder algorithm
|
||||
* `'sf_min_hit_streaks': int` - Minimum number of discovered streaks to categorize frame as a hit.
|
||||
* `'sf_mask_rois': list[(int, int, int, int)]` - [optional] list of `(y_min, y_max, x_min, x_max)` coordinates of ROIs to mask out during peak finding.
|
||||
* `'sf_crop_roi': [int, int, int, int]` - [optional] run streak finder on a cropped image, e.g. one quadrant, for purpose of spedup.
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ from streak_finder import CrystData
|
||||
from streak_finder.label import Structure2D
|
||||
|
||||
DEFAULT_NUM_THREADS = 16
|
||||
DEFAULT_MIN_HIT_STREAKS = 5
|
||||
|
||||
|
||||
def calc_streakfinder_analysis(results, data, pf_pixel_mask):
|
||||
@@ -120,6 +121,8 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
|
||||
nfa = results["sf_nfa"]
|
||||
num_threads = results["sf_num_threads"]
|
||||
|
||||
min_hit_streaks = results.get("sf_min_hit_streaks", DEFAULT_MIN_HIT_STREAKS)
|
||||
|
||||
x_center = results.get("beam_center_x", None)
|
||||
y_center = results.get("beam_center_y", None)
|
||||
|
||||
@@ -184,7 +187,7 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
|
||||
bragg_counts = [streak.total_mass() for streak in detected_streaks]
|
||||
|
||||
results["number_of_streaks"] = number_of_streaks
|
||||
results["is_hit_frame"] = (number_of_streaks > 5)
|
||||
results["is_hit_frame"] = (number_of_streaks > min_hit_streaks)
|
||||
results["streaks"] = list_result
|
||||
results["streak_lengths"] = streak_lengths
|
||||
results["bragg_counts"] = bragg_counts
|
||||
|
||||
Reference in New Issue
Block a user