From 39780e31c06af611c233b19ec860bb5e8a5c95aa Mon Sep 17 00:00:00 2001 From: x12sa Date: Wed, 17 Jun 2026 11:07:43 +0200 Subject: [PATCH 01/12] add in position for scintillator in optics hutch --- csaxs_bec/device_configs/bl_optics_hutch.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/csaxs_bec/device_configs/bl_optics_hutch.yaml b/csaxs_bec/device_configs/bl_optics_hutch.yaml index 5d0edce..cd0f35d 100644 --- a/csaxs_bec/device_configs/bl_optics_hutch.yaml +++ b/csaxs_bec/device_configs/bl_optics_hutch.yaml @@ -264,6 +264,7 @@ scinx: # bl_smar_stage to use csaxs reference method. assign number according to axis channel init_position: -23 bl_smar_stage: 2 + in_position: -12.5 poly: description: polarizer holder in OPbox -- 2.52.0 From e16c6ebe87b22cd8e06bcdec0d4909c2827905c0 Mon Sep 17 00:00:00 2001 From: x12sa Date: Wed, 17 Jun 2026 14:39:39 +0200 Subject: [PATCH 02/12] update eiger 9M parameters --- csaxs_bec/device_configs/bl_detectors.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csaxs_bec/device_configs/bl_detectors.yaml b/csaxs_bec/device_configs/bl_detectors.yaml index 3df5103..354d222 100644 --- a/csaxs_bec/device_configs/bl_detectors.yaml +++ b/csaxs_bec/device_configs/bl_detectors.yaml @@ -13,8 +13,8 @@ eiger_9: description: Eiger 9M detector deviceClass: csaxs_bec.devices.jungfraujoch.eiger_9m.Eiger9M deviceConfig: - detector_distance: 100 - beam_center: [0, 0] + detector_distance: 2200 + beam_center: [1203, 875] onFailure: raise enabled: True readoutPriority: async -- 2.52.0 From ebbe1c3fd65a86b66fdb3c8881c984f8709a1db3 Mon Sep 17 00:00:00 2001 From: x12sa Date: Wed, 17 Jun 2026 17:45:11 +0200 Subject: [PATCH 03/12] correct beam center in eiger 9M config --- csaxs_bec/device_configs/bl_detectors.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csaxs_bec/device_configs/bl_detectors.yaml b/csaxs_bec/device_configs/bl_detectors.yaml index 354d222..80a159e 100644 --- a/csaxs_bec/device_configs/bl_detectors.yaml +++ b/csaxs_bec/device_configs/bl_detectors.yaml @@ -14,7 +14,7 @@ eiger_9: deviceClass: csaxs_bec.devices.jungfraujoch.eiger_9m.Eiger9M deviceConfig: detector_distance: 2200 - beam_center: [1203, 875] + beam_center: [870, 1203] onFailure: raise enabled: True readoutPriority: async -- 2.52.0 From 6b28c68efec078f7df6a29375b9cef3974473c87 Mon Sep 17 00:00:00 2001 From: x12sa Date: Wed, 17 Jun 2026 17:45:42 +0200 Subject: [PATCH 04/12] add beamstop diode and change to monitored --- csaxs_bec/device_configs/bl_endstation.yaml | 76 ++++++++++----------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/csaxs_bec/device_configs/bl_endstation.yaml b/csaxs_bec/device_configs/bl_endstation.yaml index d9e6534..09e644a 100644 --- a/csaxs_bec/device_configs/bl_endstation.yaml +++ b/csaxs_bec/device_configs/bl_endstation.yaml @@ -1089,47 +1089,47 @@ bim_xbox3_slowrb: -# #################### -# ### Beamstop diode control for flight tube -# ### This requires galilrioft device. On top of that the gain control device is built as well as a slow voltage readback. -# #################### +#################### +### Beamstop diode control for flight tube +### This requires galilrioft device. On top of that the gain control device is built as well as a slow voltage readback. +#################### -# galilrioesft: -# description: Galil RIO for remote gain switching and slow reading FlightTube -# deviceClass: csaxs_bec.devices.omny.galil.galil_rio.GalilRIO -# deviceConfig: -# host: galilrioesft.psi.ch -# enabled: true -# onFailure: retry -# readOnly: false -# readoutPriority: baseline -# connectionTimeout: 20 +galilrioesft: + description: Galil RIO for remote gain switching and slow reading FlightTube + deviceClass: csaxs_bec.devices.omny.galil.galil_rio.GalilRIO + deviceConfig: + host: galilrioesft.psi.ch + enabled: true + onFailure: retry + readOnly: false + readoutPriority: baseline + connectionTimeout: 20 -# gain_beamstop_diode: -# description: Gain control for beamstop flightube -# deviceClass: csaxs_bec.devices.pseudo_devices.bpm_control.BPMControl -# deviceConfig: -# gain_lsb: galilrioesft.digital_out.ch0 # Pin 10 -> Galil ch0 -# gain_mid: galilrioesft.digital_out.ch1 # Pin 11 -> Galil ch1 -# gain_msb: galilrioesft.digital_out.ch2 # Pin 12 -> Galil ch2 -# coupling: galilrioesft.digital_out.ch3 # Pin 13 -> Galil ch3 -# speed_mode: galilrioesft.digital_out.ch4 # Pin 14 -> Galil ch4 -# enabled: true -# readoutPriority: baseline -# onFailure: retry -# needs: -# - galilrioesft +gain_beamstop_diode: + description: Gain control for beamstop flightube + deviceClass: csaxs_bec.devices.pseudo_devices.bpm_control.BPMControl + deviceConfig: + gain_lsb: galilrioesft.digital_out.ch0 # Pin 10 -> Galil ch0 + gain_mid: galilrioesft.digital_out.ch1 # Pin 11 -> Galil ch1 + gain_msb: galilrioesft.digital_out.ch2 # Pin 12 -> Galil ch2 + coupling: galilrioesft.digital_out.ch3 # Pin 13 -> Galil ch3 + speed_mode: galilrioesft.digital_out.ch4 # Pin 14 -> Galil ch4 + enabled: true + readoutPriority: baseline + onFailure: retry + needs: + - galilrioesft -# beamstop_intensity: -# description: Beamstop intensity from Galil analog input ch6 -# deviceClass: csaxs_bec.devices.pseudo_devices.signal_forwarder.SignalForwarder -# deviceConfig: -# signal: galilrioesft.analog_in.ch0 -# enabled: true -# readoutPriority: baseline -# onFailure: retry -# needs: -# - galilrioesft +beamstop_intensity: + description: Beamstop intensity from Galil analog input ch6 + deviceClass: csaxs_bec.devices.pseudo_devices.signal_forwarder.SignalForwarder + deviceConfig: + signal: galilrioesft.analog_in.ch0 + enabled: true + readoutPriority: monitored + onFailure: retry + needs: + - galilrioesft -- 2.52.0 From 18cc36bea1a287c07a2969846c3dbe4a9dada416 Mon Sep 17 00:00:00 2001 From: x12sa Date: Thu, 18 Jun 2026 10:07:10 +0200 Subject: [PATCH 05/12] refactor(bl-optics-config): Add bender to optics config --- csaxs_bec/device_configs/bl_optics_hutch.yaml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/csaxs_bec/device_configs/bl_optics_hutch.yaml b/csaxs_bec/device_configs/bl_optics_hutch.yaml index cd0f35d..e4916ee 100644 --- a/csaxs_bec/device_configs/bl_optics_hutch.yaml +++ b/csaxs_bec/device_configs/bl_optics_hutch.yaml @@ -526,3 +526,62 @@ sl3ys: deviceTags: - cSAXS - optics + +kbvbendu: + description: "KB Vertical Focusing Mirror, bender upstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:BNDU" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvbendd: + description: "KB Vertical Focusing Mirror, bender downstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:BNDD" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhbendu: + description: "KB Horizontal Focusing Mirror, bender upstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:BNDU" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhbendd: + description: "KB Horizontal Focusing Mirror, bender downstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:BNDD" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + + + -- 2.52.0 From dead2b568e0348bc57d6aa4e29c5d109dc371bf8 Mon Sep 17 00:00:00 2001 From: appel_c Date: Thu, 18 Jun 2026 10:13:21 +0200 Subject: [PATCH 06/12] fix(bl-optics-hutch): add kb motors part 1 --- csaxs_bec/device_configs/bl_optics_hutch.yaml | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/csaxs_bec/device_configs/bl_optics_hutch.yaml b/csaxs_bec/device_configs/bl_optics_hutch.yaml index e4916ee..189fb05 100644 --- a/csaxs_bec/device_configs/bl_optics_hutch.yaml +++ b/csaxs_bec/device_configs/bl_optics_hutch.yaml @@ -555,6 +555,76 @@ kbvbendd: - cSAXS - optics +kbvtrx: + description: "KB Vertical Focusing Mirror, translation X" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:TRX" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvtry: + description: "KB Vertical Focusing Mirror, translation Y" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:TRY" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvyaw: + description: "KB Vertical Focusing Mirror, yaw" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:YAW" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvroll: + description: "KB Vertical Focusing Mirror, roll" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:ROLL" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvpitch: + description: "KB Vertical Focusing Mirror, pitch" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:PITCH" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + kbhbendu: description: "KB Horizontal Focusing Mirror, bender upstream" deviceClass: ophyd_devices.EpicsMotorEC @@ -583,5 +653,72 @@ kbhbendd: - cSAXS - optics +kbhtrx: + description: "KB Horizontal Focusing Mirror, translation X" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:TRX" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics +kbhtry: + description: "KB Horizontal Focusing Mirror, translation Y" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:TRY" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics +kbhyaw: + description: "KB Horizontal Focusing Mirror, yaw" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:YAW" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhroll: + description: "KB Horizontal Focusing Mirror, roll" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:ROLL" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhpitch: + description: "KB Horizontal Focusing Mirror, pitch" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:PITCH" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics -- 2.52.0 From 12345585d6fcc7bcd22c0396ebee6cdafc47dc50 Mon Sep 17 00:00:00 2001 From: appel_c Date: Thu, 18 Jun 2026 10:22:34 +0200 Subject: [PATCH 07/12] refactor(bl-optics-config): update kb motors part 2 --- csaxs_bec/device_configs/bl_optics_hutch.yaml | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) diff --git a/csaxs_bec/device_configs/bl_optics_hutch.yaml b/csaxs_bec/device_configs/bl_optics_hutch.yaml index 189fb05..03ac6f7 100644 --- a/csaxs_bec/device_configs/bl_optics_hutch.yaml +++ b/csaxs_bec/device_configs/bl_optics_hutch.yaml @@ -625,6 +625,76 @@ kbvpitch: - cSAXS - optics +kbvtrxu: + description: "KB Vertical Focusing Mirror, translation X upstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:TRXU" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvtrxd: + description: "KB Vertical Focusing Mirror, translation X downstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:TRXD" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvtryur: + description: "KB Vertical Focusing Mirror, translation Y upstream ring" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:TRYUR" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvtryw: + description: "KB Vertical Focusing Mirror, translation Y wall" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:TRYW" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbvtrydr: + description: "KB Vertical Focusing Mirror, translation Y downstream ring" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-VFM:TRYDR" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + kbhbendu: description: "KB Horizontal Focusing Mirror, bender upstream" deviceClass: ophyd_devices.EpicsMotorEC @@ -722,3 +792,73 @@ kbhpitch: deviceTags: - cSAXS - optics + +kbhtrxu: + description: "KB Horizontal Focusing Mirror, translation X upstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:TRXU" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhtrxd: + description: "KB Horizontal Focusing Mirror, translation X downstream" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:TRXD" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhtryur: + description: "KB Horizontal Focusing Mirror, translation Y upstream ring" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:TRYUR" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhtryw: + description: "KB Horizontal Focusing Mirror, translation Y wall" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:TRYW" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics + +kbhtrydr: + description: "KB Horizontal Focusing Mirror, translation Y downstream ring" + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: "X12SA-OP-HFM:TRYDR" + onFailure: raise + enabled: true + readoutPriority: baseline + readOnly: false + softwareTrigger: false + deviceTags: + - cSAXS + - optics -- 2.52.0 From fc4bac28aa58632efb7600986d67c145c02b533c Mon Sep 17 00:00:00 2001 From: x12sa Date: Thu, 18 Jun 2026 10:54:34 +0200 Subject: [PATCH 08/12] correct epics channels for the KB HFM --- csaxs_bec/device_configs/bl_optics_hutch.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/csaxs_bec/device_configs/bl_optics_hutch.yaml b/csaxs_bec/device_configs/bl_optics_hutch.yaml index 03ac6f7..4410326 100644 --- a/csaxs_bec/device_configs/bl_optics_hutch.yaml +++ b/csaxs_bec/device_configs/bl_optics_hutch.yaml @@ -821,11 +821,11 @@ kbhtrxd: - cSAXS - optics -kbhtryur: - description: "KB Horizontal Focusing Mirror, translation Y upstream ring" +kbhtryuw: + description: "KB Horizontal Focusing Mirror, translation Y upstream wall" deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: - prefix: "X12SA-OP-HFM:TRYUR" + prefix: "X12SA-OP-HFM:TRYUW" onFailure: raise enabled: true readoutPriority: baseline @@ -835,11 +835,11 @@ kbhtryur: - cSAXS - optics -kbhtryw: - description: "KB Horizontal Focusing Mirror, translation Y wall" +kbhtryr: + description: "KB Horizontal Focusing Mirror, translation Y ring" deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: - prefix: "X12SA-OP-HFM:TRYW" + prefix: "X12SA-OP-HFM:TRYR" onFailure: raise enabled: true readoutPriority: baseline @@ -849,11 +849,11 @@ kbhtryw: - cSAXS - optics -kbhtrydr: - description: "KB Horizontal Focusing Mirror, translation Y downstream ring" +kbhtrydw: + description: "KB Horizontal Focusing Mirror, translation Y downstream wall" deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: - prefix: "X12SA-OP-HFM:TRYDR" + prefix: "X12SA-OP-HFM:TRYDW" onFailure: raise enabled: true readoutPriority: baseline -- 2.52.0 From 9bc290412c555fcef92f4ae1c56be06f2e85b456 Mon Sep 17 00:00:00 2001 From: x12sa Date: Thu, 18 Jun 2026 11:56:17 +0200 Subject: [PATCH 09/12] add diodes in optics hutch --- csaxs_bec/device_configs/bl_optics_hutch.yaml | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/csaxs_bec/device_configs/bl_optics_hutch.yaml b/csaxs_bec/device_configs/bl_optics_hutch.yaml index 4410326..14bdaf3 100644 --- a/csaxs_bec/device_configs/bl_optics_hutch.yaml +++ b/csaxs_bec/device_configs/bl_optics_hutch.yaml @@ -329,25 +329,25 @@ polrot: # readOnly: false # softwareTrigger: false -# #################### -# ### BPM and polarization diag XBox1 (optics hutch) -# ### This requires galilrioop device. On top of that the gain control devices and slow readback devices are built. -# ### dev.galilrioop.read() shows the analog inputs -# ### another example ...analog_in.ch0.get() -# ### dev.galilrioop.read_configuration() shows the digital channels -# ### example for direct access dev.galilrioesxbox.digital_out.ch1.put(0) -# #################### +#################### +### BPM and polarization diag XBox1 (optics hutch) +### This requires galilrioop device. On top of that the gain control devices and slow readback devices are built. +### dev.galilrioop.read() shows the analog inputs +### another example ...analog_in.ch0.get() +### dev.galilrioop.read_configuration() shows the digital channels +### example for direct access dev.galilrioesxbox.digital_out.ch1.put(0) +#################### -# galilrioop: -# description: Galil RIO for remote gain switching and slow reading XBox OP -# deviceClass: csaxs_bec.devices.omny.galil.galil_rio.GalilRIO -# deviceConfig: -# host: galilrioop.psi.ch -# enabled: true -# onFailure: retry -# readOnly: false -# readoutPriority: monitored -# connectionTimeout: 20 +galilrioop: + description: Galil RIO for remote gain switching and slow reading XBox OP + deviceClass: csaxs_bec.devices.omny.galil.galil_rio.GalilRIO + deviceConfig: + host: galilrioop.psi.ch + enabled: true + onFailure: retry + readOnly: false + readoutPriority: monitored + connectionTimeout: 20 # gain_bpm_xbox1: # description: Gain control for BPM XBox1 (OP hutch) @@ -378,42 +378,42 @@ polrot: # needs: # - galilrioop -# gain_diodes_xbox1: -# description: Gain control for diodes (horizontal and vertical) XBox1 -# deviceClass: csaxs_bec.devices.pseudo_devices.bpm_control.BPMControl -# deviceConfig: -# gain_lsb: galilrioop.digital_out.ch6 # Pin 10 -> Galil ch0 -# gain_mid: galilrioop.digital_out.ch7 # Pin 11 -> Galil ch1 -# gain_msb: galilrioop.digital_out.ch8 # Pin 12 -> Galil ch2 -# coupling: galilrioop.digital_out.ch9 # Pin 13 -> Galil ch3 -# speed_mode: galilrioop.digital_out.ch10 # Pin 14 -> Galil ch4 -# enabled: true -# readoutPriority: baseline -# onFailure: retry -# needs: -# - galilrioop +gain_diodes_xbox1: + description: Gain control for diodes (horizontal and vertical) XBox1 + deviceClass: csaxs_bec.devices.pseudo_devices.bpm_control.BPMControl + deviceConfig: + gain_lsb: galilrioop.digital_out.ch6 # Pin 10 -> Galil ch0 + gain_mid: galilrioop.digital_out.ch7 # Pin 11 -> Galil ch1 + gain_msb: galilrioop.digital_out.ch8 # Pin 12 -> Galil ch2 + coupling: galilrioop.digital_out.ch9 # Pin 13 -> Galil ch3 + speed_mode: galilrioop.digital_out.ch10 # Pin 14 -> Galil ch4 + enabled: true + readoutPriority: baseline + onFailure: retry + needs: + - galilrioop -# diode_horizontal_xbox1_slowrb: -# description: Slow readback diode horizontal XBox OP (polarization diagnostics) -# deviceClass: csaxs_bec.devices.pseudo_devices.signal_forwarder.SignalForwarder -# deviceConfig: -# signal: galilrioop.analog_in.ch6 -# enabled: true -# readoutPriority: baseline -# onFailure: retry -# needs: -# - galilrioop +diode_horizontal_xbox1_slowrb: + description: Slow readback diode horizontal XBox OP (polarization diagnostics) + deviceClass: csaxs_bec.devices.pseudo_devices.signal_forwarder.SignalForwarder + deviceConfig: + signal: galilrioop.analog_in.ch6 + enabled: true + readoutPriority: monitored + onFailure: retry + needs: + - galilrioop -# diode_vertical_xbox1_slowrb: -# description: Slow readback diode vertical XBox OP (polarization diagnostics) -# deviceClass: csaxs_bec.devices.pseudo_devices.signal_forwarder.SignalForwarder -# deviceConfig: -# signal: galilrioop.analog_in.ch7 -# enabled: true -# readoutPriority: baseline -# onFailure: retry -# needs: -# - galilrioop +diode_vertical_xbox1_slowrb: + description: Slow readback diode vertical XBox OP (polarization diagnostics) + deviceClass: csaxs_bec.devices.pseudo_devices.signal_forwarder.SignalForwarder + deviceConfig: + signal: galilrioop.analog_in.ch7 + enabled: true + readoutPriority: monitored + onFailure: retry + needs: + - galilrioop sl3xi: description: "slit 2 (optics) x ring" -- 2.52.0 From b4c3c0e9adb35bce049d501e44589e7333f6ad2e Mon Sep 17 00:00:00 2001 From: appel_c Date: Fri, 19 Jun 2026 13:04:30 +0200 Subject: [PATCH 10/12] fix(eiger): Eiger should take initial energy from ccm --- csaxs_bec/devices/jungfraujoch/eiger.py | 38 ++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/csaxs_bec/devices/jungfraujoch/eiger.py b/csaxs_bec/devices/jungfraujoch/eiger.py index e8d94d2..a868783 100644 --- a/csaxs_bec/devices/jungfraujoch/eiger.py +++ b/csaxs_bec/devices/jungfraujoch/eiger.py @@ -36,6 +36,7 @@ import os import time from typing import TYPE_CHECKING, Literal +import numpy as np import yaml from bec_lib.file_utils import get_full_path from bec_lib.logger import bec_logger @@ -117,6 +118,8 @@ class Eiger(PSIDeviceBase): self._full_path = "" self._num_triggers = 0 self._wait_for_on_complete = 20 # seconds + # Initial incident energy in keV, if restarted None + self._incident_energy: float | None = None if self.device_manager is not None: self.device_manager: DeviceManagerDS self.scan_parameters: ScanServerScanInfo | None = None @@ -272,7 +275,25 @@ class Eiger(PSIDeviceBase): # TODO: Check mono energy from device in BEC # Setting incident energy in keV - incident_energy = 12.0 + + try: + incident_energy = self._get_beam_energy(self.device_manager) + if self._incident_energy is None: + self._incident_energy = incident_energy + elif not np.isclose( + self._incident_energy, incident_energy, atol=0.01 + ): # 10 keV tolerance + logger.warning( + f"Incident energy changed from {self._incident_energy} keV to {incident_energy} keV for device {self.name}. " + ) + self._incident_energy = incident_energy + except Exception as e: + logger.warning(f"Failed to set up beam energy for {self.name}: {e}") + incident_energy = 12.0 # default to 12 keV if error occurs + self._incident_energy = incident_energy + + logger.info(f"Device {self.name} uses incident energy of {incident_energy} keV.") + # Setting up exp_time and num_triggers acquisition parameter exp_time = self.scan_parameters.exp_time if exp_time <= self._readout_time: # Exp_time must be at least the readout time @@ -417,3 +438,18 @@ class Eiger(PSIDeviceBase): self.jfj_preview_client.stop() self.on_stop() return super().on_destroy() + + def _get_beam_energy(self, device_manager: DeviceManagerDS) -> float: + """ + Fetch the beam energy from the device manager. + + Args: + device_manager (DeviceManagerDS): The device manager to fetch the beam energy from. + + Returns: + float: The beam energy in keV. + """ + if hasattr(device_manager, "devices") and hasattr(device_manager.devices, "ccm_energy"): + energy = device_manager.devices.ccm_energy.get() + + return energy -- 2.52.0 From 50a494114043faff84bc1d5f50b337a6be96ebf9 Mon Sep 17 00:00:00 2001 From: appel_c Date: Fri, 19 Jun 2026 13:08:27 +0200 Subject: [PATCH 11/12] fix(eiger): fix fetching energy --- csaxs_bec/devices/jungfraujoch/eiger.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/csaxs_bec/devices/jungfraujoch/eiger.py b/csaxs_bec/devices/jungfraujoch/eiger.py index a868783..b9ec6ca 100644 --- a/csaxs_bec/devices/jungfraujoch/eiger.py +++ b/csaxs_bec/devices/jungfraujoch/eiger.py @@ -279,18 +279,18 @@ class Eiger(PSIDeviceBase): try: incident_energy = self._get_beam_energy(self.device_manager) if self._incident_energy is None: - self._incident_energy = incident_energy + self._incident_energy = round(float(incident_energy, 3)) elif not np.isclose( self._incident_energy, incident_energy, atol=0.01 ): # 10 keV tolerance logger.warning( f"Incident energy changed from {self._incident_energy} keV to {incident_energy} keV for device {self.name}. " ) - self._incident_energy = incident_energy + self._incident_energy = round(float(incident_energy, 3)) except Exception as e: logger.warning(f"Failed to set up beam energy for {self.name}: {e}") incident_energy = 12.0 # default to 12 keV if error occurs - self._incident_energy = incident_energy + self._incident_energy = round(float(incident_energy, 3)) logger.info(f"Device {self.name} uses incident energy of {incident_energy} keV.") @@ -450,6 +450,8 @@ class Eiger(PSIDeviceBase): float: The beam energy in keV. """ if hasattr(device_manager, "devices") and hasattr(device_manager.devices, "ccm_energy"): - energy = device_manager.devices.ccm_energy.get() + energy = device_manager.devices.ccm_energy.read()[ + device_manager.devices.ccm_energy.name + ]["value"] return energy -- 2.52.0 From 66efcb2b92aabf959479b2dc7a10279c817de0c6 Mon Sep 17 00:00:00 2001 From: appel_c Date: Fri, 19 Jun 2026 13:25:02 +0200 Subject: [PATCH 12/12] fix: incident energy --- csaxs_bec/devices/jungfraujoch/eiger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csaxs_bec/devices/jungfraujoch/eiger.py b/csaxs_bec/devices/jungfraujoch/eiger.py index b9ec6ca..eccb857 100644 --- a/csaxs_bec/devices/jungfraujoch/eiger.py +++ b/csaxs_bec/devices/jungfraujoch/eiger.py @@ -279,20 +279,20 @@ class Eiger(PSIDeviceBase): try: incident_energy = self._get_beam_energy(self.device_manager) if self._incident_energy is None: - self._incident_energy = round(float(incident_energy, 3)) + self._incident_energy = round(float(incident_energy), 3) elif not np.isclose( self._incident_energy, incident_energy, atol=0.01 ): # 10 keV tolerance logger.warning( f"Incident energy changed from {self._incident_energy} keV to {incident_energy} keV for device {self.name}. " ) - self._incident_energy = round(float(incident_energy, 3)) + self._incident_energy = round(float(incident_energy), 3) except Exception as e: logger.warning(f"Failed to set up beam energy for {self.name}: {e}") incident_energy = 12.0 # default to 12 keV if error occurs - self._incident_energy = round(float(incident_energy, 3)) + self._incident_energy = round(float(incident_energy), 3) - logger.info(f"Device {self.name} uses incident energy of {incident_energy} keV.") + logger.info(f"Device {self.name} uses incident energy of {self._incident_energy} keV.") # Setting up exp_time and num_triggers acquisition parameter exp_time = self.scan_parameters.exp_time -- 2.52.0