Compare commits

...

4 Commits

Author SHA1 Message Date
hitz_s 1a20282499 Merge pull request 'fix: update info storage with num_monitored_readouts' (#79) from fix/scan_info_readouts into main
CI for debye_bec / test (push) Successful in 57s
Reviewed-on: #79
2026-06-03 13:15:21 +02:00
wakonig_k 1a6eb5ab90 fix: update info storage with num_monitored_readouts
CI for debye_bec / test (push) Successful in 1m4s
CI for debye_bec / test (pull_request) Successful in 1m1s
2026-06-03 13:10:38 +02:00
hitz_s ea23ab2284 Merge pull request 'fix: mo1_bragg calculator' (#78) from fix-mono-calculator into main
CI for debye_bec / test (push) Successful in 54s
Reviewed-on: #78
2026-06-02 13:25:27 +02:00
x01da 52d97b2d29 fix: mo1_bragg calculator
CI for debye_bec / test (push) Successful in 57s
CI for debye_bec / test (pull_request) Failing after 38s
2026-06-02 13:24:14 +02:00
2 changed files with 14 additions and 7 deletions
+13 -7
View File
@@ -416,25 +416,31 @@ class Mo1Bragg(PSIDeviceBase, Mo1BraggPositioner):
Returns: Returns:
output (float): Converted angle or energy output (float): Converted angle or energy
""" """
self.calculator.calc_reset.put(0) self.calculator.calc_reset.put(0)
self.calculator.calc_reset.put(1) self.calculator.calc_reset.put(1)
status = CompareStatus(self.calculator.calc_done, 0) status = CompareStatus(self.calculator.calc_done, 0)
self.cancel_on_stop(status) self.cancel_on_stop(status)
status.wait(self.timeout_for_pvwait) status.wait(self.timeout_for_pvwait)
self.calculator.calc_reset.put(0)
if mode == "AngleToEnergy": if mode == "AngleToEnergy":
self.calculator.calc_angle.put(inp) in_signal = self.calculator.calc_angle
out_signal = self.calculator.calc_energy
elif mode == "EnergyToAngle": elif mode == "EnergyToAngle":
self.calculator.calc_energy.put(inp) in_signal = self.calculator.calc_energy
out_signal = self.calculator.calc_angle
else:
raise Mo1BraggError(f'Unknown mode {mode}')
in_signal.put(inp)
status = CompareStatus(self.calculator.calc_done, 1) status = CompareStatus(self.calculator.calc_done, 1)
self.cancel_on_stop(status) self.cancel_on_stop(status)
status.wait(self.timeout_for_pvwait) status.wait(self.timeout_for_pvwait)
time.sleep(0.25) # TODO needed still? Needed due to update frequency of softIOC status = CompareStatus(out_signal, 0, operation_success='>')
if mode == "AngleToEnergy": self.cancel_on_stop(status)
return self.calculator.calc_energy.get() status.wait(self.timeout_for_pvwait)
elif mode == "EnergyToAngle": return out_signal.get()
return self.calculator.calc_angle.get()
def set_advanced_xas_settings( def set_advanced_xas_settings(
self, low: float, high: float, scan_time: float, p_kink: float, e_kink: float self, low: float, high: float, scan_time: float, p_kink: float, e_kink: float
+1
View File
@@ -13,6 +13,7 @@ def fetch_scan_info(scan_info: ScanInfo) -> ScanServerScanInfo:
info = scan_info.msg.info info = scan_info.msg.info
if isinstance(info["positions"], list): if isinstance(info["positions"], list):
info["positions"] = np.array(info["positions"]) info["positions"] = np.array(info["positions"])
info["num_monitored_readouts"] = scan_info.msg.num_monitored_readouts
try: try:
msg = ScanServerScanInfo.model_validate(info) msg = ScanServerScanInfo.model_validate(info)
except ValidationError: # This means we have an old scan_info object. except ValidationError: # This means we have an old scan_info object.