DAQ: added has_sufficient_low_res_spots function but forgot to commit it - sorry!
This commit is contained in:
@@ -297,3 +297,22 @@ def raster_centre_of_mass(result_array, images) -> CenterOfMassModel | None:
|
||||
logger.warning("No valid center of mass found")
|
||||
return None
|
||||
|
||||
def has_sufficient_low_res_spots(
|
||||
result_array: np.ndarray,
|
||||
min_spots_low_res: float,
|
||||
) -> bool:
|
||||
if result_array is None or result_array.size == 0:
|
||||
logger.warning("Empty result_array passed to has_sufficient_low_res_spots")
|
||||
return False
|
||||
|
||||
max_val = float(np.nanmax(result_array))
|
||||
logger.info(f"Max spots_low_res in raster result_array: {max_val}")
|
||||
|
||||
if max_val < min_spots_low_res:
|
||||
logger.info(
|
||||
"Raster rejected: max spots_low_res "
|
||||
f"{max_val} < required {min_spots_low_res}"
|
||||
)
|
||||
return False
|
||||
|
||||
return True
|
||||
Reference in New Issue
Block a user