fix: truncate requested detector position if request is impossible

This commit is contained in:
2026-07-13 10:52:05 +02:00
parent af4db11d82
commit c657a6ca20
+6 -4
View File
@@ -1996,13 +1996,15 @@ class AareDAQ:
if request.dtz is not None:
if request.dtz < self.__cfg.cached_dtz_low:
raise ValueError(
f"Requested DTZ {request.dtz} is less than low detector limit {self.__cfg.cached_dtz_low}"
logger.error(
f"Requested DTZ {request.dtz} is less than low detector limit {self.__cfg.cached_dtz_low}. Truncating to the nearest allowable value."
)
request.dtz = self.__cfg.cached_dtz_low
elif request.dtz > self.__cfg.cached_dtz_high:
raise ValueError(
f"Requested DTZ {request.dtz} exceeds high detector limit {self.__cfg.cached_dtz_high}"
logger.error(
f"Requested DTZ {request.dtz} exceeds high detector limit {self.__cfg.cached_dtz_high}. Truncating to the nearest allowable value."
)
request.dtz = self.__cfg.cached_dtz_high
logger.info(f"requesting dtz to move to {request.dtz}")
self.__cfg.dtz = request.dtz
else: