From f60fee1976cd7dc5db1c74d1a89764396838601e Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 25 Nov 2025 09:11:58 +0100 Subject: [PATCH] Find_crystal: fix bug in quality filter and add new filter for 30% max spots. --- common/src/aaredaqlib/find_xtal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/aaredaqlib/find_xtal.py b/common/src/aaredaqlib/find_xtal.py index 5352a273..82860832 100644 --- a/common/src/aaredaqlib/find_xtal.py +++ b/common/src/aaredaqlib/find_xtal.py @@ -145,7 +145,7 @@ def create_quality_filtered_array(scan_results: List, if exclude_ice and (result.spots_ice / max(result.spots_low_res, 1.0)) == 1.0: # print(f"all ice for {result.number}") return False - if result.spots_low_res < min_res_spots: + if min_low_res_spots and result.spots_low_res < min_low_res_spots: return False if result.spots_low_res < (max_spots_low_res * (30/100)): return False @@ -155,7 +155,7 @@ def create_quality_filtered_array(scan_results: List, if result.index: # print(f"index is True for {result.number}") return True - if result.spots < min_spots: + if min_spots and result.spots < min_spots: # print(f"{result.spots} is less than {min_spots} for {result.number}") return False if result.spots_low_res < min_background: