feat: add function to get res from image number
CI / lint (pull_request) Successful in 3m12s
CI / test (3.12) (pull_request) Successful in 1m42s
CI / test (3.13) (pull_request) Canceled after 9m28s
CI / test (3.11) (pull_request) Canceled after 9m33s
CI / lint (push) Canceled after 11s
CI / test (3.11) (push) Canceled after 0s
CI / test (3.12) (push) Canceled after 0s
CI / test (3.13) (push) Canceled after 0s
Build and Publish / release (push) Successful in 11s

This commit was merged in pull request #35.
This commit is contained in:
2026-09-11 11:51:33 +02:00
parent 68ab034a51
commit e56c62027a
+11
View File
@@ -1,6 +1,7 @@
from collections.abc import Callable
import numpy as np
from jfjoch_client.models.scan_result_images_inner import ScanResultImagesInner
from scipy import ndimage
from aarecommon.config.logger import setup_logger
@@ -269,6 +270,16 @@ def get_best_res(result_list: list):
return best_res.res
def get_res_of_image_number(
result_list: list[ScanResultImagesInner], image_index: int | None
) -> float | None:
if image_index is None or image_index >= len(result_list):
return None
image = result_list[image_index]
logger.info(f"Resolution estimage for selected gridscan image (# {image_index}): {image.res}")
return image.res
def com_nan_check(com):
return not (np.isnan(com.n_x) or np.isnan(com.n_y))