feat: add function to get res from image number
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / lint (pull_request) Successful in 1m12s
CI / test (3.11) (pull_request) Canceled after 1m28s
CI / test (3.12) (pull_request) Canceled after 1m25s
CI / test (3.13) (pull_request) Canceled after 1m23s

This commit is contained in:
perl_d committed 2026-09-11 11:48:39 +02:00
1 parent 68ab034a51
commit 35f3d16e3f
1 file changed
+11
+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
) -> float | None:
if 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))