From 19579bc708d57955aee6c20ac6abf89fb5d2e176 Mon Sep 17 00:00:00 2001 From: x10sa Date: Tue, 26 May 2026 15:46:31 +0200 Subject: [PATCH 1/3] update device configs and checker --- .../startup/post_startup.py | 6 +- pxii_bec/device_configs/pxii-devices-new.csv | 231 ++++---- pxii_bec/device_configs/pxii-devices-new.yaml | 508 ++++++++++++++++-- pxii_bec/device_configs/se_devices.yaml | 24 +- pxii_bec/macros/check.py | 478 ++++++++++++++-- 5 files changed, 1021 insertions(+), 226 deletions(-) diff --git a/pxii_bec/bec_ipython_client/startup/post_startup.py b/pxii_bec/bec_ipython_client/startup/post_startup.py index bd2dab1..e209b0f 100644 --- a/pxii_bec/bec_ipython_client/startup/post_startup.py +++ b/pxii_bec/bec_ipython_client/startup/post_startup.py @@ -34,4 +34,8 @@ to setup the prompts. """ # pylint: disable=invalid-name, unused-import, import-error, undefined-variable, unused-variable, unused-argument, no-name-in-module -init_positioned_devices() +d = init_se_devices() +states, allow_modifiers = get_states() +deps = planner_deps() +planner = StateManager(d, states, allow_modifiers, deps) + diff --git a/pxii_bec/device_configs/pxii-devices-new.csv b/pxii_bec/device_configs/pxii-devices-new.csv index 105a458..fb66ef9 100644 --- a/pxii_bec/device_configs/pxii-devices-new.csv +++ b/pxii_bec/device_configs/pxii-devices-new.csv @@ -1,50 +1,50 @@ name,description,deviceClass,PV,readoutPriority,tag,readOnly,include,userParameter, -sls_current,SLS current,SignalRO,ARS07-DPCT-0100:CURR,monitored,SLS,yes,yes,, -fe_bpm1,FE XBPM Signal 1,SignalRO,X10SA-FE-XBPM1:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpm2,FE XBPM Signal 2,SignalRO,X10SA-FE-XBPM1:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpm3,FE XBPM Signal 3,SignalRO,X10SA-FE-XBPM1:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpm4,FE XBPM Signal 4,SignalRO,X10SA-FE-XBPM1:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, +sls_current,SLS Current,SignalRO,ARS07-DPCT-0100:CURR,monitored,SLS,yes,yes,, +fe_bpm1,FE XBPM Channel 1,SignalRO,X10SA-FE-XBPM1:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, +fe_bpm2,FE XBPM Channel 2,SignalRO,X10SA-FE-XBPM1:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, +fe_bpm3,FE XBPM Channel 3,SignalRO,X10SA-FE-XBPM1:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, +fe_bpm4,FE XBPM Channel 4,SignalRO,X10SA-FE-XBPM1:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, fe_bpmsum,FE XBPM Summed,SignalRO,X10SA-FE-XBPM1:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, fe_bpm_x,FE BPM X,Motor,X10SA-FE-XBPM1:TRX,baseline,fe,no,yes,, fe_bpm_y,FE BPM Y,Motor,X10SA-FE-XBPM1:TRY,baseline,fe,no,yes,, fe_sl_xr,FE Slit X Ring,MotorEC,X10SA-FE-SL1:TRXR,baseline,fe,no,yes,, -fe_sl_yt,FE Slit Y top,MotorEC,X10SA-FE-SL1:TRYT,baseline,fe,no,yes,, +fe_sl_yt,FE Slit Y Top,MotorEC,X10SA-FE-SL1:TRYT,baseline,fe,no,yes,, fe_sl_xw,FE Slit X Wall,MotorEC,X10SA-FE-SL1:TRXW,baseline,fe,no,yes,, -fe_sl_yb,FE SlitY Bottom,MotorEC,X10SA-FE-SL1:TRYB,baseline,fe,no,yes,, +fe_sl_yb,FE Slit Y Bottom,MotorEC,X10SA-FE-SL1:TRYB,baseline,fe,no,yes,, fe_sl_xcen,FE Slit X Centre,MotorEC,X10SA-FE-SL1:CENTERX,baseline,fe,no,yes,, fe_sl_xsize,FE Slit X Size,MotorEC,X10SA-FE-SL1:SIZEX,baseline,fe,no,yes,, fe_sl_ycen,FE Slit Y Centre,MotorEC,X10SA-FE-SL1:CENTERY,baseline,fe,no,yes,, fe_sl_ysize,FE Slit Y Size,MotorEC,X10SA-FE-SL1:SIZEY,baseline,fe,no,yes,, -bsf_bpm1,BSF BPM Signal 1,SignalRO,X10SA-OP-BSFBPM:SIGNAL1,monitored,bpm,yes,no,, -bsf_bpm2,BSF BPM Signal 2,SignalRO,X10SA-OP-BSFBPM:SIGNAL2,monitored,bpm,yes,no,, -bsf_bpm3,BSF BPM Signal 3,SignalRO,X10SA-OP-BSFBPM:SIGNAL3,monitored,bpm,yes,no,, -bsf_bpm4,BSF BPM Signal 4,SignalRO,X10SA-OP-BSFBPM:SIGNAL4,monitored,bpm,yes,no,, +bsf_bpm1,BSF BPM Channel 1,SignalRO,X10SA-OP-BSFBPM:SIGNAL1,monitored,bpm,yes,no,, +bsf_bpm2,BSF BPM Channel 2,SignalRO,X10SA-OP-BSFBPM:SIGNAL2,monitored,bpm,yes,no,, +bsf_bpm3,BSF BPM Channel 3,SignalRO,X10SA-OP-BSFBPM:SIGNAL3,monitored,bpm,yes,no,, +bsf_bpm4,BSF BPM Channel 4,SignalRO,X10SA-OP-BSFBPM:SIGNAL4,monitored,bpm,yes,no,, bsf_bpmsum,BSF BPM Summed,SignalRO,X10SA-OP-BSFBPM:SUM,monitored,bpm,yes,no,, -bsf_sl_xw,BSF slit outboard,MotorEC,X10SA-OP-BSFSLH:TRXW,baseline,bsf,no,yes,, -bsf_sl_xr,BSF slit inboard,MotorEC,X10SA-OP-BSFSLH:TRXR,baseline,bsf,no,yes,, -bsf_sl_yt,BSF slit top,MotorEC,X10SA-OP-BSFSLV:TRYT,baseline,bsf,no,yes,, -bsf_sl_yb,BSF slit bottom,MotorEC,X10SA-OP-BSFSLV:TRYB,baseline,bsf,no,yes,, -bsf_sl_xcen,BSF X centre,MotorEC,X10SA-OP-BSFSLH:CENTER,baseline,bsf,no,yes,, -bsf_sl_xsize,BSF X size,MotorEC,X10SA-OP-BSFSLH:SIZE,baseline,bsf,no,yes,, -bsf_sl_ycen,BSF Y centre,MotorEC,X10SA-OP-BSFSLV:CENTER,baseline,bsf,no,yes,, -bsf_sl_ysize,BSF Y size,MotorEC,X10SA-OP-BSFSLV:SIZE,baseline,bsf,no,yes,, +bsf_sl_xw,BSF Slit Wall,MotorEC,X10SA-OP-BSFSLH:TRXW,baseline,bsf,no,yes,, +bsf_sl_xr,BSF Slit Ring,MotorEC,X10SA-OP-BSFSLH:TRXR,baseline,bsf,no,yes,, +bsf_sl_yt,BSF Slit Top,MotorEC,X10SA-OP-BSFSLV:TRYT,baseline,bsf,no,yes,, +bsf_sl_yb,BSF Slit Bottom,MotorEC,X10SA-OP-BSFSLV:TRYB,baseline,bsf,no,yes,, +bsf_sl_xcen,BSF X Centre,MotorEC,X10SA-OP-BSFSLH:CENTER,baseline,bsf,no,yes,, +bsf_sl_xsize,BSF X Size,MotorEC,X10SA-OP-BSFSLH:SIZE,baseline,bsf,no,yes,, +bsf_sl_ycen,BSF Y Centre,MotorEC,X10SA-OP-BSFSLV:CENTER,baseline,bsf,no,yes,, +bsf_sl_ysize,BSF Y Size,MotorEC,X10SA-OP-BSFSLV:SIZE,baseline,bsf,no,yes,, bsf_f1_y,BSF Filter 1 Y,MotorEC,X10SA-OP-BSFFI1:TRY,baseline,bsf,no,yes,, bsf_f2_y,BSF Filter 2 Y,MotorEC,X10SA-OP-BSFFI2:TRY,baseline,bsf,no,yes,, -dcm_bragg,DCM Bragg angle,MotorEC,X10SA-OP-DCM:ROTY,baseline,dcm,no,yes,, -dcm_x,DCM lateral,MotorEC,X10SA-OP-DCM:TRX,baseline,dcm,no,yes,, -dcm_perp,DCM Perp,MotorEC,X10SA-OP-DCM:TRX-CR2,baseline,dcm,no,yes,, -dcm_pitch,DCM 2nd crystal pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-PITCH,baseline,dcm,no,yes,, -dcm_fpitch,DCM 2nd crystal fine pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-FINEPITCH,baseline,dcm,no,yes,, -dcm_froll,DCM 2nd crystal fine roll,MotorEC,X10SA-OP-DCM:ROTZ-CR2-FINEROLL,baseline,dcm,no,yes,, -lu_bpm1,LU BPM Signal 1,SignalRO,X10SA-OP-LUBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm2,LU BPM Signal 2,SignalRO,X10SA-OP-LUBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm3,LU BPM Signal 3,SignalRO,X10SA-OP-LUBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm4,LU BPM Signal 4,SignalRO,X10SA-OP-LUBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, +dcm_bragg,DCM Bragg Angle,MotorEC,X10SA-OP-DCM:ROTY,baseline,dcm,no,yes,, +dcm_x,DCM Lateral,MotorEC,X10SA-OP-DCM:TRX,baseline,dcm,no,yes,, +dcm_perp,DCM Perpendicular,MotorEC,X10SA-OP-DCM:TRX-CR2,baseline,dcm,no,yes,, +dcm_pitch,DCM 2nd Crystal Pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-PITCH,baseline,dcm,no,yes,, +dcm_fpitch,DCM 2nd Crystal Fine Pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-FINEPITCH,baseline,dcm,no,yes,, +dcm_froll,DCM 2nd Crystal Fine roll,MotorEC,X10SA-OP-DCM:ROTZ-CR2-FINEROLL,baseline,dcm,no,yes,, +lu_bpm1,LU BPM Channel 1,SignalRO,X10SA-OP-LUBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, +lu_bpm2,LU BPM Channel 2,SignalRO,X10SA-OP-LUBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, +lu_bpm3,LU BPM Channel 3,SignalRO,X10SA-OP-LUBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, +lu_bpm4,LU BPM Channel 4,SignalRO,X10SA-OP-LUBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, lu_bpmsum,LU BPM Summed,SignalRO,X10SA-OP-LUBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm_x,BPM2 X translation,Motor,X10SA-OP-LUBPM:TRX,baseline,lu,no,yes,, -lu_bpm_y,BPM2 Y translation,Motor,X10SA-OP-LUBPM:TRY,baseline,lu,no,yes,, -lu_z1,Lens Z1 Motion,Motor,X10SA-OP-LUTRZ1:TRZ,baseline,lu,no,yes,, -lu_z2,Lens Z2 Motion,Motor,X10SA-OP-LUTRZ2:TRZ,baseline,lu,no,yes,, +lu_bpm_x,BPM2 X ,Motor,X10SA-OP-LUBPM:TRX,baseline,lu,no,yes,, +lu_bpm_y,BPM2 Y ,Motor,X10SA-OP-LUBPM:TRY,baseline,lu,no,yes,, +lu_z1,Lens Z1 ,Motor,X10SA-OP-LUTRZ1:TRZ,baseline,lu,no,yes,, +lu_z2,Lens Z2 ,Motor,X10SA-OP-LUTRZ2:TRZ,baseline,lu,no,yes,, lu_pod1_x,SmarPod1 X,Motor,X10SA-OP-LUPOD1:TRX1,baseline,lu,no,no,, lu_lens1_x2,Lenses1 X,Motor,X10SA-OP-LUPOD1:TRX2,baseline,lu,no,no,, lu_pod1_y,SmarPod1 Y,Motor,X10SA-OP-LUPOD1:TRY,baseline,lu,no,yes,, @@ -59,10 +59,10 @@ lu_pod2_z,SmarPod2 Z,Motor,X10SA-OP-LUPOD2:TRZ,baseline,lu,no,yes,, lu_pod2_rotx,SmarPod2 RX,Motor,X10SA-OP-LUPOD2:ROTX,baseline,lu,no,yes,, lu_pod2_roty,SmarPod2 RY,Motor,X10SA-OP-LUPOD2:ROTY,baseline,lu,no,yes,, lu_pod2_rotz,SmarPod2 RZ,Motor,X10SA-OP-LUPOD2:ROTZ,baseline,lu,no,yes,, -ss_bpm1,SS BPM Signal 1,SignalRO,X10SA-ES-SSBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm2,SS BPM Signal 2,SignalRO,X10SA-ES-SSBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm3,SS BPM Signal 3,SignalRO,X10SA-ES-SSBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm4,SS BPM Signal 4,SignalRO,X10SA-ES-SSBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, +ss_bpm1,SS BPM Channel 1,SignalRO,X10SA-ES-SSBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, +ss_bpm2,SS BPM Channel 2,SignalRO,X10SA-ES-SSBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, +ss_bpm3,SS BPM Channel 3,SignalRO,X10SA-ES-SSBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, +ss_bpm4,SS BPM Channel 4,SignalRO,X10SA-ES-SSBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, ss_bpmsum,SS BPM Summed,SignalRO,X10SA-ES-SSBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, ss_bpm_x,SS BPM X,Motor,X10SA-ES-SSBPM:TRX,baseline,ss,no,yes,, ss_bpm_y,SS BPM Y,Motor,X10SA-ES-SSBPM:TRY,baseline,ss,no,yes,, @@ -70,100 +70,101 @@ ss_f1_x,SS Filter 1 X,Motor,X10SA-ES-SSFI1:TRX,baseline,ss,no,yes,, ss_f2_x,SS Filter 2 X,Motor,X10SA-ES-SSFI2:TRX,baseline,ss,no,yes,, ss_f3_x,SS Filter 2 X,Motor,X10SA-ES-SSFI3:TRX,baseline,ss,no,yes,, ss_f4_x,SS Filter 4 X,Motor,X10SA-ES-SSFI4:TRX,baseline,ss,no,yes,, -ss_sl_xw,SS slit wall,Motor,X10SA-ES-SSSLH:TRXW,baseline,ss,no,yes,, -ss_sl_xr,SS slit ring,Motor,X10SA-ES-SSSLH:TRXR,baseline,ss,no,yes,, -ss_sl_xcen,SS slit X centre,Motor,X10SA-ES-SSSLH:CENTER,baseline,ss,no,yes,, -ss_sl_xsize,SS slit X size,Motor,X10SA-ES-SSSLH:SIZE,baseline,ss,no,yes,, -ss_sl_yt,SS slit top,Motor,X10SA-ES-SSSLV:TRYT,baseline,ss,no,yes,, -ss_sl_yb,SS slit bottom,Motor,X10SA-ES-SSSLV:TRYB,baseline,ss,no,yes,, -ss_sl_ycen,SS slit Y centre,Motor,X10SA-ES-SSSLV:CENTER,baseline,ss,no,yes,, -ss_sl_ysize,SS slit Y size,Motor,X10SA-ES-SSSLV:SIZE,baseline,ss,no,yes,, +ss_sl_xw,SS Slit Wall,Motor,X10SA-ES-SSSLH:TRXW,baseline,ss,no,yes,, +ss_sl_xr,SS Slit Ring,Motor,X10SA-ES-SSSLH:TRXR,baseline,ss,no,yes,, +ss_sl_xcen,SS Slit X Centre,Motor,X10SA-ES-SSSLH:CENTER,baseline,ss,no,yes,, +ss_sl_xsize,SS Slit X Size,Motor,X10SA-ES-SSSLH:SIZE,baseline,ss,no,yes,, +ss_sl_yt,SS Slit Top,Motor,X10SA-ES-SSSLV:TRYT,baseline,ss,no,yes,, +ss_sl_yb,SS Slit Bottom,Motor,X10SA-ES-SSSLV:TRYB,baseline,ss,no,yes,, +ss_sl_ycen,SS Slit Y Centre,Motor,X10SA-ES-SSSLV:CENTER,baseline,ss,no,yes,, +ss_sl_ysize,SS Slit Y Size,Motor,X10SA-ES-SSSLV:SIZE,baseline,ss,no,yes,, ss_xi_x,SS X-ray eye X,Motor,X10SA-ES-SSXI:TRX,baseline,ss,no,yes,"{""type"": multi-position,""in"": 7.5, ""out"": -2.1}", ss_xi_y,SS X-ray eye Y,Motor,X10SA-ES-SSXI:TRY,baseline,ss,no,yes,, -ss_xicam_x,ss cam X,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidX_RBV,baseline,ss,yes,no,, -ss_xicam_y,ss cam Y,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidY_RBV,baseline,ss,yes,no,, -ss_xicam_max,ss cam max value,SignalRO,X10SA-ES-SSXI:cam1:Stats5:MaxValue_RBV,monitored,ss,yes,no,, -ss_xicam_exp,ss camera exposure,Signal,X10SA-ES-SSXI:cam1:AcquireTime,baseline,ss,no,no,, -ss_xicam_gain,ss camera gain,Signal,X10SA-ES-SSXI:cam1:cam1:Gain,baseline,ss,no,no,, -ss_xicam_xsig,ss camera x sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaX_RBV,baseline,ss,yes,no,, -ss_xicam_ysig,ss camera y sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaY_RBV,baseline,ss,yes,no,, -vfm_xu,VFM Upstream X,MotorEC,X10SA-ES-KBV:TRXU,baseline,vfm,no,no,, -vfm_xd,VFM Downstream X,MotorEC,X10SA-ES-KBV:TRXD,baseline,vfm,no,no,, -vfm_yur,VFM Upstream Ring Y,MotorEC,X10SA-ES-KBV:TRYUR,baseline,vfm,no,no,, -vfm_yw,VFM Wall Y,MotorEC,X10SA-ES-KBV:TRYW,baseline,vfm,no,no,, -vfm_ydr,VFM Downstream Ring Y,MotorEC,X10SA-ES-KBV:TRYDR,baseline,vfm,no,no,, -vfm_bu,VFM Upstream Bender,MotorEC,X10SA-ES-KBV:BNDU,baseline,vfm,no,no,, -vfm_bd,VFM Downstream Bender,MotorEC,X10SA-ES-KBV:BNDD,baseline,vfm,no,no,, -vfm_yaw,VFM Virtual Yaw,MotorEC,X10SA-ES-KBV:YAW,baseline,vfm,no,no,, -vfm_roll,VFM Virtual Roll,MotorEC,X10SA-ES-KBV:ROLL,baseline,vfm,no,no,, -vfm_pitch,VFM Virtual Pitch,MotorEC,X10SA-ES-KBV:PITCH,baseline,vfm,no,no,, -vfm_x,VFM Virtual X,MotorEC,X10SA-ES-KBV:TRX,baseline,vfm,no,no,, -vfm_y,VFM Virtual Y ,MotorEC,X10SA-ES-KBV:TRY,baseline,vfm,no,no,, -hfm_xu,HFM Upstream X,MotorEC,X10SA-ES-KBH:TRXU,baseline,hfm,no,no,, -hfm_xd,HFM Downstream X,MotorEC,X10SA-ES-KBH:TRXD,baseline,hfm,no,no,, -hfm_yuw,HFM Upstream Wall Y,MotorEC,X10SA-ES-KBH:TRYUW,baseline,hfm,no,no,, -hfm_yr,HFM Ring Y,MotorEC,X10SA-ES-KBH:TRYR,baseline,hfm,no,no,, -hfm_ydw,HFM Downstream Wall Y,MotorEC,X10SA-ES-KBH:TRYDW,baseline,hfm,no,no,, -hfm_bu,HFM Upstream Bender,MotorEC,X10SA-ES-KBH:BNDU,baseline,hfm,no,no,, -hfm_bd,HFM Downstream Bender,MotorEC,X10SA-ES-KBH:BNDD,baseline,hfm,no,no,, -hfm_yaw,HFM Virtual Yaw,MotorEC,X10SA-ES-KBH:YAW,baseline,hfm,no,no,, -hfm_roll,HFM Virtual Roll,MotorEC,X10SA-ES-KBH:ROLL,baseline,hfm,no,no,, -hfm_pitch,HFM Virtual Pitch,MotorEC,X10SA-ES-KBH:PITCH,baseline,hfm,no,no,, -hfm_x,HFM Virtual X,MotorEC,X10SA-ES-KBH:TRX,baseline,hfm,no,no,, -hfm_y,HFM Virtual Y ,MotorEC,X10SA-ES-KBH:TRY,baseline,hfm,no,no,, -bcu_bpm1,BCU BPM Signal 1 ,SignalRO,X10SA-ES-BCBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpm2,BCU BPM Signal 2,SignalRO,X10SA-ES-BCBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpm3,BCU BPM Signal 3,SignalRO,X10SA-ES-BCBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpm4,BCU BPM Signal 4,SignalRO,X10SA-ES-BCBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, +ss_xicam_x,SS Camera X,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidX_RBV,baseline,ss,yes,no,, +ss_xicam_y,SS Camera Y,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidY_RBV,baseline,ss,yes,no,, +ss_xicam_max,SS Cam Max,SignalRO,X10SA-ES-SSXI:cam1:Stats5:MaxValue_RBV,monitored,ss,yes,no,, +ss_xicam_exp,SS Camera Exposure,Signal,X10SA-ES-SSXI:cam1:AcquireTime,baseline,ss,no,no,, +ss_xicam_gain,SS Camera Gain,Signal,X10SA-ES-SSXI:cam1:cam1:Gain,baseline,ss,no,no,, +ss_xicam_xsig,SS Camera X Sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaX_RBV,baseline,ss,yes,no,, +ss_xicam_ysig,SS Camera Y Sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaY_RBV,baseline,ss,yes,no,, +vfm_xu,VFM Upstream X,MotorEC,X10SA-ES-VFM:TRXU,baseline,vfm,no,yes,, +vfm_xd,VFM Downstream X,MotorEC,X10SA-ES-VFM:TRXD,baseline,vfm,no,yes,, +vfm_yur,VFM Upstream Ring Y,MotorEC,X10SA-ES-VFM:TRYUR,baseline,vfm,no,yes,, +vfm_yw,VFM Wall Y,MotorEC,X10SA-ES-VFM:TRYW,baseline,vfm,no,yes,, +vfm_ydr,VFM Downstream Ring Y,MotorEC,X10SA-ES-VFM:TRYDR,baseline,vfm,no,yes,, +vfm_bu,VFM Upstream Bender,MotorEC,X10SA-ES-VFM:BNDU,baseline,vfm,no,yes,, +vfm_bd,VFM Downstream Bender,MotorEC,X10SA-ES-VFM:BNDD,baseline,vfm,no,yes,, +vfm_yaw,VFM Virtual Yaw,MotorEC,X10SA-ES-VFM:YAW,baseline,vfm,no,yes,, +vfm_roll,VFM Virtual Roll,MotorEC,X10SA-ES-VFM:ROLL,baseline,vfm,no,yes,, +vfm_pitch,VFM Virtual Pitch,MotorEC,X10SA-ES-VFM:PITCH,baseline,vfm,no,yes,, +vfm_x,VFM Virtual X,MotorEC,X10SA-ES-VFM:TRX,baseline,vfm,no,yes,, +vfm_y,VFM Virtual Y ,MotorEC,X10SA-ES-VFM:TRY,baseline,vfm,no,yes,, +hfm_xu,HFM Upstream X,MotorEC,X10SA-ES-HFM:TRXU,baseline,hfm,no,yes,, +hfm_xd,HFM Downstream X,MotorEC,X10SA-ES-HFM:TRXD,baseline,hfm,no,yes,, +hfm_yuw,HFM Upstream Wall Y,MotorEC,X10SA-ES-HFM:TRYUW,baseline,hfm,no,yes,, +hfm_yr,HFM Ring Y,MotorEC,X10SA-ES-HFM:TRYR,baseline,hfm,no,yes,, +hfm_ydw,HFM Downstream Wall Y,MotorEC,X10SA-ES-HFM:TRYDW,baseline,hfm,no,yes,, +hfm_bu,HFM Upstream Bender,MotorEC,X10SA-ES-HFM:BNDU,baseline,hfm,no,yes,, +hfm_bd,HFM Downstream Bender,MotorEC,X10SA-ES-HFM:BNDD,baseline,hfm,no,yes,, +hfm_yaw,HFM Virtual Yaw,MotorEC,X10SA-ES-HFM:YAW,baseline,hfm,no,yes,, +hfm_roll,HFM Virtual Roll,MotorEC,X10SA-ES-HFM:ROLL,baseline,hfm,no,yes,, +hfm_pitch,HFM Virtual Pitch,MotorEC,X10SA-ES-HFM:PITCH,baseline,hfm,no,yes,, +hfm_x,HFM Virtual X,MotorEC,X10SA-ES-HFM:TRX,baseline,hfm,no,yes,, +hfm_y,HFM Virtual Y ,MotorEC,X10SA-ES-HFM:TRY,baseline,hfm,no,yes,, +bcu_bpm1,BCU BPM Channel 1 ,SignalRO,X10SA-ES-BCBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, +bcu_bpm2,BCU BPM Channel 2,SignalRO,X10SA-ES-BCBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, +bcu_bpm3,BCU BPM Channel 3,SignalRO,X10SA-ES-BCBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, +bcu_bpm4,BCU BPM Channel 4,SignalRO,X10SA-ES-BCBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, bcu_bpmsum,BCU BPM Summed,SignalRO,X10SA-ES-BCBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, bcu_bpm_x,BCU BPM X,Motor,X10SA-ES-BCBPM:TRX,baseline,bcu,no,yes,, bcu_bpm_y,BCU BPM Y ,Motor,X10SA-ES-BCBPM:TRY,baseline,bcu,no,yes,, -bcu_sl_xw,BCU slit wall,Motor,X10SA-ES-BCSLH:TRXW,baseline,bcu,no,no,, -bcu_sl_xr,BCU slit ring,Motor,X10SA-ES-BCSLH:TRXR,baseline,bcu,no,no,, -bcu_sl_xcen,BCU slit X centre,Motor,X10SA-ES-BCSLH:CENTER,baseline,bcu,no,no,, -bcu_sl_xsize,BCU slit X size,Motor,X10SA-ES-BCSLH:SIZEX,baseline,bcu,no,no,, -bcu_sl_yt,BCU slit top,Motor,X10SA-ES-BCSLV:TRYT,baseline,bcu,no,no,, -bcu_sl_yb,BCU slit bottom,Motor,X10SA-ES-BCSLV:TRYB,baseline,bcu,no,no,, -bcu_sl_ycen,BCU slit Y centre,Motor,X10SA-ES-BCSLV:CENTER,baseline,bcu,no,no,, -bcu_sl_ysize,BCU slit Y size,Motor,X10SA-ES-BCSLV:SIZE,baseline,bcu,no,no,, -xrf_pos,XRF det in/out,Signal,X10SA-ES-XRF:POS-SET,baseline,se,no,no,"{""type"":positioner}", -samcam_x,sample cam X ,SignalRO,X10SA-ES-MS:Stats5:CentroidX_RBV,baseline,scam,yes,yes,, -samcam_xsig,sample cam X sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaX_RBV,monitored,scam,yes,yes,, -samcam_y,sample cam Y ,SignalRO,X10SA-ES-MS:Stats5:CentroidY_RBV,baseline,scam,yes,yes,, -samcam_ysig,sample cam Y sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaY_RBV,monitored,scam,yes,yes,, -samcam_max,sample cam max value,SignalRO,X10SA-ES-MS:Stats5:MaxValue_RBV,monitored,scam,yes,yes,, -samcam_exp,sample cam exp time,Signal,X10SA-ES-MS:cam1:AcquireTime,baseline,scam,no,yes,, -samcam_gain,sample cam gain,Signal,X10SA-ES-MS:cam1:Gain,baseline,scam,no,yes,, -scam_zoom,Sample cam zoom,Motor,X10SA-ES-MS:ZOOM,baseline,scam,no,yes,, -fl_bright,Frontlight brightness,Signal,X10SA-ES-FL:SET,baseline,se,no,no,, +bcu_sl_xw,BCU Slit Wall,Motor,X10SA-ES-BCSLH:TRXW,baseline,bcu,no,yes,, +bcu_sl_xr,BCU Slit Ring,Motor,X10SA-ES-BCSLH:TRXR,baseline,bcu,no,yes,, +bcu_sl_xcen,BCU Slit X Centre,Motor,X10SA-ES-BCSLH:CENTER,baseline,bcu,no,yes,, +bcu_sl_xsize,BCU Slit X Size,Motor,X10SA-ES-BCSLH:SIZE,baseline,bcu,no,yes,, +bcu_sl_yt,BCU Slit Top,Motor,X10SA-ES-BCSLV:TRYT,baseline,bcu,no,yes,, +bcu_sl_yb,BCU Slit Bottom,Motor,X10SA-ES-BCSLV:TRYB,baseline,bcu,no,yes,, +bcu_sl_ycen,BCU Slit Y Centre,Motor,X10SA-ES-BCSLV:CENTER,baseline,bcu,no,yes,, +bcu_sl_ysize,BCU Slit Y Size,Motor,X10SA-ES-BCSLV:SIZE,baseline,bcu,no,yes,, +xrf_pos,XRF Positioner,Signal,X10SA-ES-XRF:POS-SET,baseline,se,no,no,"{""type"":positioner}", +samcam_x,Sample Camera X ,SignalRO,X10SA-ES-MS:Stats5:CentroidX_RBV,baseline,scam,yes,yes,, +samcam_xsig,Sample Camera X Sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaX_RBV,monitored,scam,yes,yes,, +samcam_y,Sample Camera Y ,SignalRO,X10SA-ES-MS:Stats5:CentroidY_RBV,baseline,scam,yes,yes,, +samcam_ysig,Sample Camera Y Sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaY_RBV,monitored,scam,yes,yes,, +samcam_max,Sample Camera Max ,SignalRO,X10SA-ES-MS:Stats5:MaxValue_RBV,monitored,scam,yes,yes,, +samcam_exp,Sample Camera Exposure,Signal,X10SA-ES-MS:cam1:AcquireTime,baseline,scam,no,yes,, +samcam_gain,Sample Camera Gain,Signal,X10SA-ES-MS:cam1:Gain,baseline,scam,no,yes,, +scam_zoom,Sample Camera Zoom,Motor,X10SA-ES-MS:ZOOM,baseline,scam,no,yes,, +fl_bright,Frontlight Brightness,Signal,X10SA-ES-FL:SET,baseline,se,no,no,, coll_x,Collimator X,Motor,X10SA-ES-COL:TRX,baseline,se,no,yes,, coll_y,Collimator Y,Motor,X10SA-ES-COL:TRY,baseline,se,no,no,"{""type"": multi-position, ""in"": 41.5, ""out"": 20.0, ""park"": 0,""tol"":0.05}", diag_y,Scintillator/diode Y,Motor,X10SA-ES-SCL:TRY,baseline,se,no,no,"{""type"": multi-position, ""scint"": 38.62, ""i1"": 44.0, ""out"": 20.0,""park"": 0,""tol"":0.3}", diag_z,Scintillator/diode Z,Motor,X10SA-ES-SCL:TRZ,baseline,se,no,yes,, -i1,i1 diode reading,SignalRO,X10SA-ES-SCLDI:READOUT,monitored,bpm,yes,yes,, -bl_pos,Backlight positioner,Signal,X10SA-ES-BL:POS-SET,baseline,se,no,no,"{""type"":positioner}", -bl_bright,Backlight brightness,Signal,X10SA-ES-BL:SET,baseline,se,no,no,, +i1,I1 Diode,SignalRO,X10SA-ES-SCLDI:READOUT,monitored,bpm,yes,yes,, +bl_pos,Backlight Positioner,Signal,X10SA-ES-BL:POS-SET,baseline,se,no,no,"{""type"":positioner}", +bl_bright,Backlight Brightness,Signal,X10SA-ES-BL:SET,baseline,se,no,no,, bs_x,Beamstop X,Motor,X10SA-ES-BS:TRX,baseline,se,no,yes,, bs_y,Beamstop Y,Motor,X10SA-ES-BS:TRY,baseline,se,no,yes,, bs_z,Beamstop Z,Motor,X10SA-ES-BS:TRZ,baseline,se,no,no,"{""type"": guarded, ""min"": 13, ""samp"": 15, ""work_min"": 20, ""safe"": 41, ""max_blin"": 42, ""max_blout"": 70}", -bs_pos,Beamstop positioner,Signal,X10SA-ES-BS:POS-SET,baseline,se,no,no,"{""type"":positioner}", +bs_pos,Beamstop Positioner,Signal,X10SA-ES-BS:POS-SET,baseline,se,no,no,"{""type"":positioner}", gon_x,Goniometer X,Motor,X10SA-ES-DF1:TRX1,baseline,det,no,no,"{""type"": guarded, ""in"": 18.0, ""out"": -10.0, ""safe"": -100,""tol"":0.5}", gon_y,Goniometer Y,Motor,X10SA-ES-DF1:TRY1,baseline,det,no,yes,, gon_z,Goniometer X,Motor,X10SA-ES-DF1:TRZ1,baseline,det,no,yes,, omega,Omega,Motor,X10SA-ES-DF1:ROTU,baseline,det,no,yes,, cryo_pos,Cryo positioner,Signal,X10SA-ES-CS:POS-SET,baseline,se,no,no,"{""type"":positioner}", -cryo_x,Cryojet X ,Motor,X10SA-ES-CS:TRX,baseline,se,no,yes,, -det_xi_focus,X-ray eye 2 Focus,Motor,X10SA-ES-XEYE:FOCUS,baseline,det,no,yes,, -det_xi_zoom,X-ray eye 2 Zoom,Motor,X10SA-ES-XEYE:ZOOM,baseline,det,no,yes,, -det_xi_x,X-ray eye X,Motor,X10SA-ES-XEYE:TRX,baseline,det,no,yes,, -i2,i2,SignalRO,X10SA-ES-XEYEDI:READOUT,monitored,bpm,yes,yes,, -det_xicam_x,sample cam X ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidX_RBV,baseline,scam,yes,no,, -det_xicam_xsig,sample cam X sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaX_RBV,monitored,scam,yes,no,, -det_xicam_y,sample cam Y ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidY_RBV,baseline,scam,yes,no,, -det_xicam_ysig,sample cam Y sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaY_RBV,monitored,scam,yes,no,, -det_xicam_max,sample cam max value,SignalRO,X10SA-ES-XEYE:cam1:Stats5:MaxValue_RBV,monitored,scam,yes,no,, -det_xicam_exp,sample cam exp time,Signal,X10SA-ES-XEYE:cam1:cam1:AcquireTime,baseline,scam,no,no,, -det_xicam_gain,sample cam gain,Signal,X10SA-ES-XEYE:cam1:cam1:Gain,baseline,scam,no,no,, -det_cov,Detector cover,Signal,X10SA-ES-DETCOV:SET,baseline,det,no,no,"{""type"":positioner}", +cryo_x,Cryo X ,Motor,X10SA-ES-CS:TRX,baseline,se,no,yes,, +cryo_temp,Cryo Temperature,Signal,X10SA-ES-CS:TEMP_RBV,baseline,se,yes,yes,, +det_xi_focus,X-ray Eye 2 Focus,Motor,X10SA-ES-XEYE:FOCUS,baseline,det,no,yes,, +det_xi_zoom,X-ray Eye 2 Zoom,Motor,X10SA-ES-XEYE:ZOOM,baseline,det,no,yes,, +det_xi_x,X-ray Eye X,Motor,X10SA-ES-XEYE:TRX,baseline,det,no,yes,, +i2,I2 Diode,SignalRO,X10SA-ES-XEYEDI:READOUT,monitored,bpm,yes,yes,, +det_xicam_x,Det Camera X ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidX_RBV,baseline,scam,yes,no,, +det_xicam_xsig,Det Camera X Sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaX_RBV,monitored,scam,yes,no,, +det_xicam_y,Det Camera Y ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidY_RBV,baseline,scam,yes,no,, +det_xicam_ysig,Det Camera Y Sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaY_RBV,monitored,scam,yes,no,, +det_xicam_max,Det Camera Max,SignalRO,X10SA-ES-XEYE:cam1:Stats5:MaxValue_RBV,monitored,scam,yes,no,, +det_xicam_exp,Det Camera Exposure,Signal,X10SA-ES-XEYE:cam1:cam1:AcquireTime,baseline,scam,no,no,, +det_xicam_gain,Det Camera Gain,Signal,X10SA-ES-XEYE:cam1:cam1:Gain,baseline,Sigma,no,no,, +det_cov,Detector Cover,Signal,X10SA-ES-DETCOV:SET,baseline,det,no,no,"{""type"":positioner}", det_y,Detector Y,Motor,X10SA-ES-DET:TRY,baseline,det,no,yes,, det_z,Detector Z,Motor,X10SA-ES-DET:TRZ,baseline,det,no,yes,, diff --git a/pxii_bec/device_configs/pxii-devices-new.yaml b/pxii_bec/device_configs/pxii-devices-new.yaml index e3d02f4..0f7aa0f 100644 --- a/pxii_bec/device_configs/pxii-devices-new.yaml +++ b/pxii_bec/device_configs/pxii-devices-new.yaml @@ -1,5 +1,5 @@ sls_current: - description: SLS current + description: SLS Current deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'ARS07-DPCT-0100:CURR', auto_monitor: true} onFailure: buffer @@ -11,7 +11,7 @@ sls_current: softwareTrigger: false fe_bpm1: - description: FE XBPM Signal 1 + description: FE XBPM Channel 1 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current1:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -23,7 +23,7 @@ fe_bpm1: softwareTrigger: false fe_bpm2: - description: FE XBPM Signal 2 + description: FE XBPM Channel 2 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current2:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -35,7 +35,7 @@ fe_bpm2: softwareTrigger: false fe_bpm3: - description: FE XBPM Signal 3 + description: FE XBPM Channel 3 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current3:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -47,7 +47,7 @@ fe_bpm3: softwareTrigger: false fe_bpm4: - description: FE XBPM Signal 4 + description: FE XBPM Channel 4 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current4:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -107,7 +107,7 @@ fe_sl_xr: softwareTrigger: false fe_sl_yt: - description: FE Slit Y top + description: FE Slit Y Top deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-FE-SL1:TRYT'} onFailure: buffer @@ -131,7 +131,7 @@ fe_sl_xw: softwareTrigger: false fe_sl_yb: - description: FE SlitY Bottom + description: FE Slit Y Bottom deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-FE-SL1:TRYB'} onFailure: buffer @@ -191,7 +191,7 @@ fe_sl_ysize: softwareTrigger: false bsf_sl_xw: - description: BSF slit outboard + description: BSF Slit Wall deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLH:TRXW'} onFailure: buffer @@ -203,7 +203,7 @@ bsf_sl_xw: softwareTrigger: false bsf_sl_xr: - description: BSF slit inboard + description: BSF Slit Ring deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLH:TRXR'} onFailure: buffer @@ -215,7 +215,7 @@ bsf_sl_xr: softwareTrigger: false bsf_sl_yt: - description: BSF slit top + description: BSF Slit Top deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLV:TRYT'} onFailure: buffer @@ -227,7 +227,7 @@ bsf_sl_yt: softwareTrigger: false bsf_sl_yb: - description: BSF slit bottom + description: BSF Slit Bottom deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLV:TRYB'} onFailure: buffer @@ -239,7 +239,7 @@ bsf_sl_yb: softwareTrigger: false bsf_sl_xcen: - description: BSF X centre + description: BSF X Centre deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLH:CENTER'} onFailure: buffer @@ -251,7 +251,7 @@ bsf_sl_xcen: softwareTrigger: false bsf_sl_xsize: - description: BSF X size + description: BSF X Size deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLH:SIZE'} onFailure: buffer @@ -263,7 +263,7 @@ bsf_sl_xsize: softwareTrigger: false bsf_sl_ycen: - description: BSF Y centre + description: BSF Y Centre deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLV:CENTER'} onFailure: buffer @@ -275,7 +275,7 @@ bsf_sl_ycen: softwareTrigger: false bsf_sl_ysize: - description: BSF Y size + description: BSF Y Size deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-BSFSLV:SIZE'} onFailure: buffer @@ -311,7 +311,7 @@ bsf_f2_y: softwareTrigger: false dcm_bragg: - description: DCM Bragg angle + description: DCM Bragg Angle deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY'} onFailure: buffer @@ -323,7 +323,7 @@ dcm_bragg: softwareTrigger: false dcm_x: - description: DCM lateral + description: DCM Lateral deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-DCM:TRX'} onFailure: buffer @@ -335,7 +335,7 @@ dcm_x: softwareTrigger: false dcm_perp: - description: DCM Perp + description: DCM Perpendicular deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-DCM:TRX-CR2'} onFailure: buffer @@ -347,7 +347,7 @@ dcm_perp: softwareTrigger: false dcm_pitch: - description: DCM 2nd crystal pitch + description: DCM 2nd Crystal Pitch deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY-CR2-PITCH'} onFailure: buffer @@ -359,7 +359,7 @@ dcm_pitch: softwareTrigger: false dcm_fpitch: - description: DCM 2nd crystal fine pitch + description: DCM 2nd Crystal Fine Pitch deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY-CR2-FINEPITCH'} onFailure: buffer @@ -371,7 +371,7 @@ dcm_fpitch: softwareTrigger: false dcm_froll: - description: DCM 2nd crystal fine roll + description: DCM 2nd Crystal Fine roll deviceClass: ophyd_devices.EpicsMotorEC deviceConfig: {prefix: 'X10SA-OP-DCM:ROTZ-CR2-FINEROLL'} onFailure: buffer @@ -383,7 +383,7 @@ dcm_froll: softwareTrigger: false lu_bpm1: - description: LU BPM Signal 1 + description: LU BPM Channel 1 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current1:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -395,7 +395,7 @@ lu_bpm1: softwareTrigger: false lu_bpm2: - description: LU BPM Signal 2 + description: LU BPM Channel 2 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current2:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -407,7 +407,7 @@ lu_bpm2: softwareTrigger: false lu_bpm3: - description: LU BPM Signal 3 + description: LU BPM Channel 3 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current3:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -419,7 +419,7 @@ lu_bpm3: softwareTrigger: false lu_bpm4: - description: LU BPM Signal 4 + description: LU BPM Channel 4 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current4:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -443,7 +443,7 @@ lu_bpmsum: softwareTrigger: false lu_bpm_x: - description: BPM2 X translation + description: BPM2 X deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-OP-LUBPM:TRX'} onFailure: buffer @@ -455,7 +455,7 @@ lu_bpm_x: softwareTrigger: false lu_bpm_y: - description: BPM2 Y translation + description: BPM2 Y deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-OP-LUBPM:TRY'} onFailure: buffer @@ -467,7 +467,7 @@ lu_bpm_y: softwareTrigger: false lu_z1: - description: Lens Z1 Motion + description: Lens Z1 deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-OP-LUTRZ1:TRZ'} onFailure: buffer @@ -479,7 +479,7 @@ lu_z1: softwareTrigger: false lu_z2: - description: Lens Z2 Motion + description: Lens Z2 deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-OP-LUTRZ2:TRZ'} onFailure: buffer @@ -611,7 +611,7 @@ lu_pod2_rotz: softwareTrigger: false ss_bpm1: - description: SS BPM Signal 1 + description: SS BPM Channel 1 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current1:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -623,7 +623,7 @@ ss_bpm1: softwareTrigger: false ss_bpm2: - description: SS BPM Signal 2 + description: SS BPM Channel 2 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current2:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -635,7 +635,7 @@ ss_bpm2: softwareTrigger: false ss_bpm3: - description: SS BPM Signal 3 + description: SS BPM Channel 3 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current3:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -647,7 +647,7 @@ ss_bpm3: softwareTrigger: false ss_bpm4: - description: SS BPM Signal 4 + description: SS BPM Channel 4 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current4:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -743,7 +743,7 @@ ss_f4_x: softwareTrigger: false ss_sl_xw: - description: SS slit wall + description: SS Slit Wall deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXW'} onFailure: buffer @@ -755,7 +755,7 @@ ss_sl_xw: softwareTrigger: false ss_sl_xr: - description: SS slit ring + description: SS Slit Ring deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXR'} onFailure: buffer @@ -767,7 +767,7 @@ ss_sl_xr: softwareTrigger: false ss_sl_xcen: - description: SS slit X centre + description: SS Slit X Centre deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLH:CENTER'} onFailure: buffer @@ -779,7 +779,7 @@ ss_sl_xcen: softwareTrigger: false ss_sl_xsize: - description: SS slit X size + description: SS Slit X Size deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLH:SIZE'} onFailure: buffer @@ -791,7 +791,7 @@ ss_sl_xsize: softwareTrigger: false ss_sl_yt: - description: SS slit top + description: SS Slit Top deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLV:TRYT'} onFailure: buffer @@ -803,7 +803,7 @@ ss_sl_yt: softwareTrigger: false ss_sl_yb: - description: SS slit bottom + description: SS Slit Bottom deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLV:TRYB'} onFailure: buffer @@ -815,7 +815,7 @@ ss_sl_yb: softwareTrigger: false ss_sl_ycen: - description: SS slit Y centre + description: SS Slit Y Centre deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLV:CENTER'} onFailure: buffer @@ -827,7 +827,7 @@ ss_sl_ycen: softwareTrigger: false ss_sl_ysize: - description: SS slit Y size + description: SS Slit Y Size deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLV:SIZE'} onFailure: buffer @@ -863,8 +863,296 @@ ss_xi_y: readOnly: False softwareTrigger: false +vfm_xu: + description: VFM Upstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:TRXU'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_xd: + description: VFM Downstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:TRXD'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_yur: + description: VFM Upstream Ring Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:TRYUR'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_yw: + description: VFM Wall Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:TRYW'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_ydr: + description: VFM Downstream Ring Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:TRYDR'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_bu: + description: VFM Upstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:BNDU'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_bd: + description: VFM Downstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:BNDD'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_yaw: + description: VFM Virtual Yaw + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:YAW'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_roll: + description: VFM Virtual Roll + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:ROLL'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_pitch: + description: VFM Virtual Pitch + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:PITCH'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_x: + description: VFM Virtual X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:TRX'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +vfm_y: + description: VFM Virtual Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-VFM:TRY'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - vfm + readOnly: False + softwareTrigger: false + +hfm_xu: + description: HFM Upstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:TRXU'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_xd: + description: HFM Downstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:TRXD'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_yuw: + description: HFM Upstream Wall Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:TRYUW'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_yr: + description: HFM Ring Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:TRYR'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_ydw: + description: HFM Downstream Wall Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:TRYDW'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_bu: + description: HFM Upstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:BNDU'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_bd: + description: HFM Downstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:BNDD'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_yaw: + description: HFM Virtual Yaw + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:YAW'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_roll: + description: HFM Virtual Roll + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:ROLL'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_pitch: + description: HFM Virtual Pitch + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:PITCH'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_x: + description: HFM Virtual X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:TRX'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + +hfm_y: + description: HFM Virtual Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: {prefix: 'X10SA-ES-HFM:TRY'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - hfm + readOnly: False + softwareTrigger: false + bcu_bpm1: - description: BCU BPM Signal 1 + description: BCU BPM Channel 1 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current1:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -876,7 +1164,7 @@ bcu_bpm1: softwareTrigger: false bcu_bpm2: - description: BCU BPM Signal 2 + description: BCU BPM Channel 2 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current2:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -888,7 +1176,7 @@ bcu_bpm2: softwareTrigger: false bcu_bpm3: - description: BCU BPM Signal 3 + description: BCU BPM Channel 3 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current3:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -900,7 +1188,7 @@ bcu_bpm3: softwareTrigger: false bcu_bpm4: - description: BCU BPM Signal 4 + description: BCU BPM Channel 4 deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current4:MeanValue_RBV', auto_monitor: true} onFailure: buffer @@ -947,8 +1235,104 @@ bcu_bpm_y: readOnly: False softwareTrigger: false +bcu_sl_xw: + description: BCU Slit Wall + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLH:TRXW'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + +bcu_sl_xr: + description: BCU Slit Ring + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLH:TRXR'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + +bcu_sl_xcen: + description: BCU Slit X Centre + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLH:CENTER'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + +bcu_sl_xsize: + description: BCU Slit X Size + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLH:SIZE'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + +bcu_sl_yt: + description: BCU Slit Top + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLV:TRYT'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + +bcu_sl_yb: + description: BCU Slit Bottom + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLV:TRYB'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + +bcu_sl_ycen: + description: BCU Slit Y Centre + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLV:CENTER'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + +bcu_sl_ysize: + description: BCU Slit Y Size + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BCSLV:SIZE'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - bcu + readOnly: False + softwareTrigger: false + samcam_x: - description: sample cam X + description: Sample Camera X deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:CentroidX_RBV', auto_monitor: true} onFailure: buffer @@ -960,7 +1344,7 @@ samcam_x: softwareTrigger: false samcam_xsig: - description: sample cam X sigma + description: Sample Camera X Sigma deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:SigmaX_RBV', auto_monitor: true} onFailure: buffer @@ -972,7 +1356,7 @@ samcam_xsig: softwareTrigger: false samcam_y: - description: sample cam Y + description: Sample Camera Y deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:CentroidY_RBV', auto_monitor: true} onFailure: buffer @@ -984,7 +1368,7 @@ samcam_y: softwareTrigger: false samcam_ysig: - description: sample cam Y sigma + description: Sample Camera Y Sigma deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:SigmaY_RBV', auto_monitor: true} onFailure: buffer @@ -996,7 +1380,7 @@ samcam_ysig: softwareTrigger: false samcam_max: - description: sample cam max value + description: Sample Camera Max deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:MaxValue_RBV', auto_monitor: true} onFailure: buffer @@ -1008,7 +1392,7 @@ samcam_max: softwareTrigger: false samcam_exp: - description: sample cam exp time + description: Sample Camera Exposure deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-MS:cam1:AcquireTime', auto_monitor: true} onFailure: buffer @@ -1020,7 +1404,7 @@ samcam_exp: softwareTrigger: false samcam_gain: - description: sample cam gain + description: Sample Camera Gain deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-MS:cam1:Gain', auto_monitor: true} onFailure: buffer @@ -1032,7 +1416,7 @@ samcam_gain: softwareTrigger: false scam_zoom: - description: Sample cam zoom + description: Sample Camera Zoom deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-MS:ZOOM'} onFailure: buffer @@ -1068,7 +1452,7 @@ diag_z: softwareTrigger: false i1: - description: i1 diode reading + description: I1 Diode deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-SCLDI:READOUT', auto_monitor: true} onFailure: buffer @@ -1140,7 +1524,7 @@ omega: softwareTrigger: false cryo_x: - description: Cryojet X + description: Cryo X deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-CS:TRX'} onFailure: buffer @@ -1151,6 +1535,18 @@ cryo_x: readOnly: False softwareTrigger: false +cryo_temp: + description: Cryo Temperature + deviceClass: ophyd.EpicsSignal + deviceConfig: {read_pv: 'X10SA-ES-CS:TEMP_RBV', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - se + readOnly: True + softwareTrigger: false + det_xi_focus: description: X-ray eye 2 Focus deviceClass: ophyd_devices.EpicsMotor @@ -1188,7 +1584,7 @@ det_xi_x: softwareTrigger: false i2: - description: i2 + description: I2 Diode deviceClass: ophyd.EpicsSignalRO deviceConfig: {read_pv: 'X10SA-ES-XEYEDI:READOUT', auto_monitor: true} onFailure: buffer diff --git a/pxii_bec/device_configs/se_devices.yaml b/pxii_bec/device_configs/se_devices.yaml index e2f0a36..994a7dd 100644 --- a/pxii_bec/device_configs/se_devices.yaml +++ b/pxii_bec/device_configs/se_devices.yaml @@ -1,6 +1,6 @@ ss_sl_xw: description: SS slit wall - deviceClass: ophyd.EpicsMotor + deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXW'} onFailure: buffer enabled: True @@ -16,7 +16,7 @@ ss_sl_xw: bs_z: description: Beamstop Z - deviceClass: ophyd.EpicsMotor + deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-BS:TRZ'} onFailure: buffer enabled: True @@ -36,7 +36,7 @@ bs_z: gon_x: description: Goniometer X - deviceClass: ophyd.EpicsMotor + deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-DF1:TRX1'} onFailure: buffer enabled: True @@ -54,7 +54,7 @@ gon_x: diag_y: description: Scintillator/diode Y - deviceClass: ophyd.EpicsMotor + deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SCL:TRY'} onFailure: buffer enabled: True @@ -73,7 +73,7 @@ diag_y: coll_y: description: Collimator Y - deviceClass: ophyd.EpicsMotor + deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-COL:TRY'} onFailure: buffer enabled: True @@ -91,7 +91,7 @@ coll_y: tol: 0.05 bs_pos: - description: Beamstop positioner + description: Beamstop Positioner deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-BS:POS-SET', auto_monitor: true} onFailure: buffer @@ -107,7 +107,7 @@ bs_pos: out: 0.0 xrf_pos: - description: XRF positioner + description: XRF Positioner deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-XRF:POS-SET', auto_monitor: true} onFailure: buffer @@ -123,7 +123,7 @@ xrf_pos: out: 0.0 cryo_pos: - description: Cryo positioner + description: Cryo Positioner deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-CS:POS-SET', auto_monitor: true} onFailure: buffer @@ -139,7 +139,7 @@ cryo_pos: out: 0.0 det_cov: - description: Detector cover + description: Detector Cover deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-DETCOV:SET', auto_monitor: true} onFailure: buffer @@ -155,7 +155,7 @@ det_cov: 'close': 1.0 bl_bright: - description: Backlight brightness + description: Backlight Brightness deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-BL:SET', auto_monitor: true} onFailure: buffer @@ -173,7 +173,7 @@ bl_bright: bl_pos: - description: Backlight positioner + description: Backlight Positioner deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-BL:POS-SET', auto_monitor: true} onFailure: buffer @@ -189,7 +189,7 @@ bl_pos: out: 0.0 fl_bright: - description: Frontlight brightness + description: Frontlight Brightness deviceClass: ophyd.EpicsSignal deviceConfig: {read_pv: 'X10SA-ES-FL:SET', auto_monitor: true} onFailure: buffer diff --git a/pxii_bec/macros/check.py b/pxii_bec/macros/check.py index 66af021..2b5c993 100644 --- a/pxii_bec/macros/check.py +++ b/pxii_bec/macros/check.py @@ -1,62 +1,456 @@ +from dataclasses import dataclass, field +from enum import Enum +from typing import Any, Callable + from bec_lib.device import Signal, Positioner -def check(): - check_devices(tolerance = 0.02) +# ------------------------------------------------------------------- +# Status Enum +# ------------------------------------------------------------------- + + +class Status(Enum): + OK = 0 + WARNING = 1 + ERROR = 2 + UNKNOWN = 3 + + @property + def color(self): + return { + Status.OK: "green", + Status.WARNING: "yellow", + Status.ERROR: "red", + Status.UNKNOWN: "blue", + }[self] + + +# ------------------------------------------------------------------- +# Health Result Object +# ------------------------------------------------------------------- + + +@dataclass +class HealthCheckResult: + + name: str + description: str + status: Status + + value: Any = None + + message: str = "" + + category: str = "general" + + def __str__(self): + + if self.status == Status.OK: + return f"[{self.status.name}] {self.description}" + + return ( + f"[{self.status.name}] " + f"{self.description}: {self.message}" + ) + def formatted_message(self): + if self.status == Status.OK: + return f"[{self.status.name} {self.name}]" + -def check_devices(tolerance): - devices = list(dev.items()) - for name, obj in devices: + return ( + f"[{self.status.name}] " + f"{self.description}: {self.message}" + ) + +# ------------------------------------------------------------------- +# Send to SciLog +# ------------------------------------------------------------------- + +def send_to_scilog(results): + + msg = bec.messaging.scilog.new() + + for result in results: + msg.add_text( + result.formatted_message(), + # bold=result.status != Status.OK, + color = result.status.color + ) + # msg.add_text(result.formatted_message()) + msg.add_text("\n") + msg.add_tags(["beamline health check"]) + msg.send() + + +# ------------------------------------------------------------------- +# Configuration +# ------------------------------------------------------------------- + +@dataclass +class BeamlineHealthConfig: + + signal_rules: dict[str, Callable] = field( + default_factory=lambda: { + "cam": lambda x: x != 0, + "bpm": lambda x: x != 0, + } + ) + + motor_tolerances: dict[str, float] = field( + default_factory=lambda: { + # examples + # "mono_theta": 0.001, + # "detector_z": 0.1, + } + ) + + default_motor_tolerance: float = 0.02 + + +# ------------------------------------------------------------------- +# Device Collection +# ------------------------------------------------------------------- + + +def get_devices(): + return list(dev.items()) + + +# ------------------------------------------------------------------- +# Signal Checks +# ------------------------------------------------------------------- + + +def check_signals(devices, config: BeamlineHealthConfig): + + results = [] + + signal_devices = [ + (name, obj) + for name, obj in devices + if isinstance(obj, Signal) + ] + + for name, obj in signal_devices: try: data = obj.read() - # deal with smargon - if "smargon" in name: - continue - + actual = data[name]["value"] + description = obj.description + + except Exception as e: + + results.append( + HealthCheckResult( + name=name, + description=name, + status=Status.UNKNOWN, + message=f"Failed to read signal: {e}", + category="signals", + ) + ) + + continue + + matched = False + + for keyword, rule in config.signal_rules.items(): + + if keyword in name: + + matched = True + + try: + passed = rule(actual) + + except Exception as e: + + results.append( + HealthCheckResult( + name=name, + description=name, + status=Status.UNKNOWN, + value=actual, + message=f"Rule evaluation failed: {e}", + category="signals", + ) + ) + + break + + if passed: + + results.append( + HealthCheckResult( + name=name, + description=description, + status=Status.OK, + value=actual, + category="signals", + ) + ) + + else: + + results.append( + HealthCheckResult( + name=name, + description=description, + status=Status.ERROR, + value=actual, + message=f"Signal value {actual} failed validation", + category="signals", + ) + ) + break + + if not matched: + continue + + return results + + +# ------------------------------------------------------------------- +# Motor Checks +# ------------------------------------------------------------------- + + +def check_motors(devices, config: BeamlineHealthConfig): + + results = [] + + motor_devices = [ + (name, obj) + for name, obj in devices + if isinstance(obj, Positioner) + ] + + for name, obj in motor_devices: + + try: + + data = obj.read() + + description = obj.description + actual = data[name]["value"] - # If signal and a camera or bpm, check reading is not 0 - if isinstance(obj, Signal): - if 'cam' in name or 'bpm' in name: - if actual == 0.0: - print(f"{name} is reading 0") + error_code = obj.motor_status.get() - # if signal is a motor, check in position, error, moving - if isinstance(obj, Positioner): - # Check set position = real position + move_state = obj.motor_is_moving.get() - sp_key = f"{name}_user_setpoint" + except Exception as e: - if sp_key not in data: - continue + results.append( + HealthCheckResult( + name=name, + description=name, + status=Status.UNKNOWN, + message=f"Failed to read motor: {e}", + category="motors", + ) + ) - setpoint = data[sp_key]["value"] + continue - diff = abs(actual - setpoint) - inpos = diff <= tolerance - if not inpos: - print( - f"{name}: " - # f"actual={actual:.4f}, " - # f"setpoint={setpoint:.4f}, " - # f"diff={diff:.4f}, " - f"in position = {inpos}" + # ----------------------------------------------------------- + # Error state + # ----------------------------------------------------------- + + if error_code != 0: + + results.append( + HealthCheckResult( + name=name, + description=description, + status=Status.ERROR, + value=error_code, + message=f"motor error code: {error_code}", + category="motors", + ) + ) + + continue + + # ----------------------------------------------------------- + # Moving state + # ----------------------------------------------------------- + + if move_state != 0: + + results.append( + HealthCheckResult( + name=name, + description=description, + status=Status.WARNING, + value=move_state, + message="motor is currently moving", + category="motors", + ) + ) + + continue + + # ----------------------------------------------------------- + # Setpoint comparison + # ----------------------------------------------------------- + + sp_key = f"{name}_user_setpoint" + + if sp_key in data: + + setpoint = data[sp_key]["value"] + + diff = abs(actual - setpoint) + + tolerance = config.motor_tolerances.get( + name, + config.default_motor_tolerance, + ) + + if diff > tolerance: + + results.append( + HealthCheckResult( + name=name, + description=description, + status=Status.WARNING, + value=diff, + message=( + f"Setpoint {setpoint:.5g} differs " + f"from readback {actual:.5g} " + f"by {diff:.4g}" + ), + category="motors", ) - # check if motor is in error state - error_status = obj.motor_status.get() + ) + + else: + + results.append( + HealthCheckResult( + name=name, + description=description, + status=Status.OK, + value=actual, + category="motors", + ) + ) + + else: + + results.append( + HealthCheckResult( + name=name, + description=description, + status=Status.UNKNOWN, + message="No setpoint available", + category="motors", + ) + ) + + return results + + +# ------------------------------------------------------------------- +# Main Check Entry Point +# ------------------------------------------------------------------- + + +def check2(config: BeamlineHealthConfig | None = None): + if config is None: + config = BeamlineHealthConfig() + + devices = get_devices() + + results = [] + + results.extend(check_signals(devices, config)) + + results.extend(check_motors(devices, config)) + + # --------------------------------------------------------------- + # Sort by severity + # --------------------------------------------------------------- + + results.sort( + key=lambda r: r.status.value, + ) + + return results + + +# ------------------------------------------------------------------- +# Summary Printer +# ------------------------------------------------------------------- + + +def print_summary(results): + + n_ok = sum(r.status == Status.OK for r in results) + + n_warn = sum(r.status == Status.WARNING for r in results) + + n_err = sum(r.status == Status.ERROR for r in results) + + n_unknown = sum(r.status == Status.UNKNOWN for r in results) + + print("\n==============================") + print(" Beamline Health Summary") + print("==============================") + print(f"OK : {n_ok}") + print(f"WARNING : {n_warn}") + print(f"ERROR : {n_err}") + print(f"UNKNOWN : {n_unknown}") + print("==============================\n") + +# ------------------------------------------------------------------- +# Filter results +# ------------------------------------------------------------------- +def filter_results(results, statuses = None): + if statuses is None: + return results + + return [ + r for r in results + if r.status in statuses + ] + +# ------------------------------------------------------------------- +# CLI Entry Point +# ------------------------------------------------------------------- + + +def run_check(show_all= False): + + results = check2() + + print_summary(results) + + problem_results = filter_results( + results, + statuses={ + Status.WARNING, + Status.ERROR, + Status.UNKNOWN, + } + ) + # send_to_scilog(problem_results) + + if not show_all: + results = filter_results( + results, + statuses={ + Status.WARNING, + Status.ERROR, + Status.UNKNOWN + } + ) + for result in results: + print(result) - if error_status != 0: - print(f"{name}: error_state = {error_status}") - - # check if motor is moving - move_status = obj.motor_is_moving.get() - if move_status != 0: - print(f"{name} is moving") - - except Exception as exc: - print(f"{name}: ERROR -> {exc}") -- 2.54.0 From d237d815b792b5182e46d0ad5dc236d1eb6d6e9c Mon Sep 17 00:00:00 2001 From: x10sa Date: Mon, 8 Jun 2026 14:13:39 +0200 Subject: [PATCH 2/3] updates to planner and state devices --- .../startup/post_startup.py | 6 +- .../device_configs/pxii-autogenerated.yaml | 1906 ----------------- ..._states.yaml => pxii-beamline-states.yaml} | 102 +- pxii_bec/device_configs/pxii-devices-new.csv | 170 -- .../device_configs/pxii-rest-devices.yaml | 18 + ...es-new.yaml => pxii-standard-devices.yaml} | 46 +- ...e_devices.yaml => pxii-state-devices.yaml} | 270 +-- pxii_bec/device_configs/pxiii-devices-new.csv | 146 -- .../device_configs/x10sa_device_config.yaml | 15 +- .../x10sa_device_config_testing.yaml | 99 - pxii_bec/devices/aerotech.py | 4 +- pxii_bec/macros/APscripts.py | 39 +- pxii_bec/macros/Undu_Helpers.py | 48 +- .../{planner.py => beamline_planner.py} | 153 +- pxii_bec/macros/beamline_state_manager.py | 21 + pxii_bec/macros/build_devices.py | 70 + pxii_bec/macros/check.py | 109 +- pxii_bec/macros/config.py | 24 - pxii_bec/macros/dependencies.py | 36 + pxii_bec/macros/devices.py | 167 -- pxii_bec/macros/devices_manager.py | 22 + pxii_bec/macros/findattr.py | 0 pxii_bec/macros/guards.py | 4 +- pxii_bec/macros/init_beamline.py | 163 ++ pxii_bec/macros/policies.py | 38 +- pxii_bec/macros/position_device.py | 254 +++ pxii_bec/macros/pxii_parameters.py | 34 +- pxii_bec/macros/test.py | 51 +- 28 files changed, 1082 insertions(+), 2933 deletions(-) delete mode 100644 pxii_bec/device_configs/pxii-autogenerated.yaml rename pxii_bec/device_configs/{beamline_states.yaml => pxii-beamline-states.yaml} (54%) delete mode 100644 pxii_bec/device_configs/pxii-devices-new.csv create mode 100644 pxii_bec/device_configs/pxii-rest-devices.yaml rename pxii_bec/device_configs/{pxii-devices-new.yaml => pxii-standard-devices.yaml} (97%) rename pxii_bec/device_configs/{se_devices.yaml => pxii-state-devices.yaml} (60%) delete mode 100644 pxii_bec/device_configs/pxiii-devices-new.csv delete mode 100644 pxii_bec/device_configs/x10sa_device_config_testing.yaml rename pxii_bec/macros/{planner.py => beamline_planner.py} (57%) mode change 100644 => 100755 create mode 100755 pxii_bec/macros/beamline_state_manager.py create mode 100755 pxii_bec/macros/build_devices.py mode change 100644 => 100755 pxii_bec/macros/check.py delete mode 100644 pxii_bec/macros/config.py create mode 100755 pxii_bec/macros/dependencies.py delete mode 100644 pxii_bec/macros/devices.py create mode 100755 pxii_bec/macros/devices_manager.py mode change 100644 => 100755 pxii_bec/macros/findattr.py mode change 100644 => 100755 pxii_bec/macros/guards.py create mode 100755 pxii_bec/macros/init_beamline.py mode change 100644 => 100755 pxii_bec/macros/policies.py create mode 100755 pxii_bec/macros/position_device.py mode change 100644 => 100755 pxii_bec/macros/test.py diff --git a/pxii_bec/bec_ipython_client/startup/post_startup.py b/pxii_bec/bec_ipython_client/startup/post_startup.py index e209b0f..eae64ae 100644 --- a/pxii_bec/bec_ipython_client/startup/post_startup.py +++ b/pxii_bec/bec_ipython_client/startup/post_startup.py @@ -34,8 +34,4 @@ to setup the prompts. """ # pylint: disable=invalid-name, unused-import, import-error, undefined-variable, unused-variable, unused-argument, no-name-in-module -d = init_se_devices() -states, allow_modifiers = get_states() -deps = planner_deps() -planner = StateManager(d, states, allow_modifiers, deps) - +d, planner = init_beamline_environment() diff --git a/pxii_bec/device_configs/pxii-autogenerated.yaml b/pxii_bec/device_configs/pxii-autogenerated.yaml deleted file mode 100644 index c56b82c..0000000 --- a/pxii_bec/device_configs/pxii-autogenerated.yaml +++ /dev/null @@ -1,1906 +0,0 @@ -sls_current: - description: SLS current - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'ARS07-DPCT-0100:CURR', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - SLS - readOnly: True - softwareTrigger: false - -fe_bpm1: - description: FE XBPM Signal 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm2: - description: FE XBPM Signal 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm3: - description: FE XBPM Signal 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm4: - description: FE XBPM Signal 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpmsum: - description: FE XBPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm_x: - description: FE BPM X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-XBPM1:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_bpm_y: - description: FE BPM Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-XBPM1:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xr: - description: FE Slit X Ring - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_yt: - description: FE Slit Y top - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xw: - description: FE Slit X Wall - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_yb: - description: FE SlitY Bottom - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xcen: - description: FE Slit X Centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:CENTERX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xsize: - description: FE Slit X Size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:SIZEX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_ycen: - description: FE Slit Y Centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:CENTERY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_ysize: - description: FE Slit Y Size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SL1:SIZEY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -bsf_sl_xw: - description: BSF slit outboard - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_xr: - description: BSF slit inboard - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_yt: - description: BSF slit top - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_yb: - description: BSF slit bottom - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_xcen: - description: BSF X centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_xsize: - description: BSF X size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_ycen: - description: BSF Y centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_ysize: - description: BSF Y size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_f1_y: - description: BSF Filter 1 Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFFI1:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_f2_y: - description: BSF Filter 2 Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-BSFFI2:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -dcm_bragg: - description: DCM Bragg angle - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_x: - description: DCM lateral - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_perp: - description: DCM Perp - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:TRX-CR2'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_pitch: - description: DCM 2nd crystal pitch - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY-CR2-PITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_fpitch: - description: DCM 2nd crystal fine pitch - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY-CR2-FINEPITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_froll: - description: DCM 2nd crystal fine roll - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTZ-CR2-FINEROLL'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -lu_bpm1: - description: LU BPM Signal 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm2: - description: LU BPM Signal 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm3: - description: LU BPM Signal 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm4: - description: LU BPM Signal 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpmsum: - description: LU BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm_x: - description: BPM2 X translation - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUBPM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_bpm_y: - description: BPM2 Y translation - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUBPM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_z1: - description: Lens Z1 Motion - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUTRZ1:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_z2: - description: Lens Z2 Motion - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUTRZ2:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_y: - description: SmarPod1 Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_z: - description: SmarPod1 Z - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_rotx: - description: SmarPod1 RX - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:ROTX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_roty: - description: SmarPod1 RY - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:ROTY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_rotz: - description: SmarPod1 RZ - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:ROTZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_y: - description: SmarPod2 Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_z: - description: SmarPod2 Z - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_rotx: - description: SmarPod2 RX - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:ROTX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_roty: - description: SmarPod2 RY - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:ROTY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_rotz: - description: SmarPod2 RZ - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:ROTZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -ss_bpm1: - description: SS BPM Signal 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm2: - description: SS BPM Signal 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm3: - description: SS BPM Signal 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm4: - description: SS BPM Signal 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpmsum: - description: SS BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm_x: - description: SS BPM X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSBPM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_bpm_y: - description: SS BPM Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSBPM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f1_x: - description: SS Filter 1 X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI1:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f2_x: - description: SS Filter 2 X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI2:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f3_x: - description: SS Filter 2 X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI3:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f4_x: - description: SS Filter 4 X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI4:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_xr: - description: SS slit ring - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_xcen: - description: SS slit X centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_xsize: - description: SS slit X size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_yt: - description: SS slit top - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_yb: - description: SS slit bottom - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_ycen: - description: SS slit Y centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_ysize: - description: SS slit Y size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_xi_x: - description: SS X-ray eye X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSXI:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - userParameter: {"type": multi-position,"in": 7.5, "out": -2.1} - -ss_xi_y: - description: SS X-ray eye Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSXI:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_xicam_x: - description: ss cam X - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSCAM:Stats5:CentroidX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: True - softwareTrigger: false - -ss_xicam_y: - description: ss cam Y - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSCAM:Stats5:CentroidY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: True - softwareTrigger: false - -ss_xicam_max: - description: ss cam max value - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSCAM:Stats5:MaxValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: True - softwareTrigger: false - -ss_xicam_exp: - description: ss camera exposure - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-SSCAM:cam1:AcquireTime', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_xicam_gain: - description: ss camera gain - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-SSCAM:cam1:Gain', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_xicam_xsig: - description: ss camera x sigma - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-SSCAM:Stats5:SigmaX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: True - softwareTrigger: false - -ss_xicam_ysig: - description: ss camera y sigma - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-SSCAM:Stats5:SigmaY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: True - softwareTrigger: false - -vfm_xu: - description: VFM Upstream X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRXU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_xd: - description: VFM Downstream X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRXD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_yur: - description: VFM Upstream Ring Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYUR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_yw: - description: VFM Wall Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_ydr: - description: VFM Downstream Ring Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYDR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_bu: - description: VFM Upstream Bender - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:BNDU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_bd: - description: VFM Downstream Bender - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:BNDD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_yaw: - description: VFM Virtual Yaw - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:YAW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_roll: - description: VFM Virtual Roll - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:ROLL'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_pitch: - description: VFM Virtual Pitch - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:PITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_x: - description: VFM Virtual X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_y: - description: VFM Virtual Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -hfm_xu: - description: HFM Upstream X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRXU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_xd: - description: HFM Downstream X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRXD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_yuw: - description: HFM Upstream Wall Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYUW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_yr: - description: HFM Ring Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_ydw: - description: HFM Downstream Wall Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYDW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_bu: - description: HFM Upstream Bender - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:BNDU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_bd: - description: HFM Downstream Bender - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:BNDD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_yaw: - description: HFM Virtual Yaw - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:YAW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_roll: - description: HFM Virtual Roll - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:ROLL'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_pitch: - description: HFM Virtual Pitch - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:PITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_x: - description: HFM Virtual X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_y: - description: HFM Virtual Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -bcu_bpm1: - description: BCU BPM Signal 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm2: - description: BCU BPM Signal 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm3: - description: BCU BPM Signal 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm4: - description: BCU BPM Signal 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpmsum: - description: BCU BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm_x: - description: BCU BPM X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCBPM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_bpm_y: - description: BCU BPM Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCBPM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xw: - description: BCU slit wall - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xr: - description: BCU slit ring - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xcen: - description: BCU slit X centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xsize: - description: BCU slit X size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_yt: - description: BCU slit top - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_yb: - description: BCU slit bottom - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_ycen: - description: BCU slit Y centre - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_ysize: - description: BCU slit Y size - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -# xrf_pos: -# description: XRF det in/out -# deviceClass: ophyd.EpicsSignal -# deviceConfig: {read_pv: 'X10SA-ES-XRF:POS-SET', auto_monitor: true} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false -# userParameter: {"type":positioner} - -samcam_x: - description: sample cam X - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:CentroidX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_xsig: - description: sample cam X sigma - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:SigmaX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_y: - description: sample cam Y - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:CentroidY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_ysig: - description: sample cam Y sigma - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:SigmaY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_max: - description: sample cam max value - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:MaxValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_exp: - description: sample cam exp time - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-MS:cam1:AcquireTime', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: False - softwareTrigger: false - -samcam_gain: - description: sample cam gain - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-MS:cam1:Gain', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: False - softwareTrigger: false - -scam_zoom: - description: Sample cam zoom - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-MS:ZOOM'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: False - softwareTrigger: false - -# fl_bright: -# description: Frontlight brightness -# deviceClass: ophyd.EpicsSignal -# deviceConfig: {read_pv: 'X10SA-ES-FL:SET', auto_monitor: true} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false - -coll_x: - description: Collimator X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-COL:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -# coll_y: -# description: Collimator Y -# deviceClass: ophyd.EpicsMotor -# deviceConfig: {prefix: 'X10SA-ES-COL:TRY'} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false -# userParameter: {"type": multi-position, "in": 41.5, "out": 20.0, "park": 0,"tol":0.05} - -# diag_y: -# description: Scintillator/diode Y -# deviceClass: ophyd.EpicsMotor -# deviceConfig: {prefix: 'X10SA-ES-SCL:TRY'} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false -# userParameter: {"type": multi-position, "scint": 38.62, "i1": 44.0, "out": 20.0,"park": 0,"tol":0.3} - -diag_z: - description: Scintillator/diode Z - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SCL:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -i1: - description: i1 diode reading - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SCLDI:READOUT', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -# bl_pos: -# description: Backlight positioner -# deviceClass: ophyd.EpicsSignal -# deviceConfig: {read_pv: 'X10SA-ES-BL:POS-SET', auto_monitor: true} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false -# userParameter: {"type":positioner} - -# bl_bright: -# description: Backlight brightness -# deviceClass: ophyd.EpicsSignal -# deviceConfig: {read_pv: 'X10SA-ES-BL:SET', auto_monitor: true} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false - -bs_x: - description: Beamstop X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BS:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -bs_y: - description: Beamstop Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BS:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -# bs_z: -# description: Beamstop Z -# deviceClass: ophyd.EpicsMotor -# deviceConfig: {prefix: 'X10SA-ES-BS:TRZ'} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false -# userParameter: {"type": guarded, "min": 13, "samp": 15, "work_min": 20, "safe": 41, "max_blin": 42, "max_blout": 70} - -# bs_pos: -# description: Beamstop positioner -# deviceClass: ophyd.EpicsSignal -# deviceConfig: {read_pv: 'X10SA-ES-BS:POS-SET', auto_monitor: true} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false -# userParameter: {"type":positioner} - -# gon_x: -# description: Goniometer X -# deviceClass: ophyd.EpicsMotor -# deviceConfig: {prefix: 'X10SA-ES-DF1:TRX1'} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - det -# readOnly: False -# softwareTrigger: false -# userParameter: {"type": guarded, "in": 18.0, "out": -10.0, "safe": -100,"tol":0.5} - -gon_y: - description: Goniometer Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DF1:TRY1'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -gon_z: - description: Goniometer X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DF1:TRZ1'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -omega: - description: Omega - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DF1:ROTU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -# cryo_pos: -# description: Cryo positioner -# deviceClass: ophyd.EpicsSignal -# deviceConfig: {read_pv: 'X10SA-ES-CS:POS-SET', auto_monitor: true} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - se -# readOnly: False -# softwareTrigger: false -# userParameter: {"type":positioner} - -cryo_x: - description: Cryojet X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-CS:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -det_xi_focus: - description: X-ray eye 2 Focus - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-XEYE:FOCUS'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - detxi - readOnly: False - softwareTrigger: false - -det_xi_zoom: - description: X-ray eye 2 Zoom - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-XEYE:ZOOM'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - detxi - readOnly: False - softwareTrigger: false - -det_xi_x: - description: X-ray eye X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-XEYE:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - detxi - readOnly: False - softwareTrigger: false - -i2: - description: i2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-XEYEDI:READOUT', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -det_xicam_x: - description: sample cam X - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-XEYE:Stats5:CentroidX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - detxi - readOnly: True - softwareTrigger: false - -det_xicam_xsig: - description: sample cam X sigma - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-XEYE:Stats5:SigmaX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - detxi - readOnly: True - softwareTrigger: false - -det_xicam_y: - description: sample cam Y - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-XEYE:Stats5:CentroidY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - detxi - readOnly: True - softwareTrigger: false - -det_xicam_ysig: - description: sample cam Y sigma - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-XEYE:Stats5:SigmaY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - detxi - readOnly: True - softwareTrigger: false - -det_xicam_max: - description: sample cam max value - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-XEYE:Stats5:MaxValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - detxi - readOnly: True - softwareTrigger: false - -det_xicam_exp: - description: sample cam exp time - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-XEYE:cam1:AcquireTime', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - detxi - readOnly: False - softwareTrigger: false - -det_xicam_gain: - description: sample cam gain - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-XEYE:cam1:Gain', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - detxi - readOnly: False - softwareTrigger: false - -# det_cov: -# description: Detector cover -# deviceClass: ophyd.EpicsSignal -# deviceConfig: {read_pv: 'X10SA-ES-DETCOV:SET', auto_monitor: true} -# onFailure: buffer -# enabled: True -# readoutPriority: baseline -# deviceTags: -# - det -# readOnly: False -# softwareTrigger: false -# userParameter: {"type":positioner} - -det_y: - description: Detector Y - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DET:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -det_z: - description: Detector Z - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DET:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - diff --git a/pxii_bec/device_configs/beamline_states.yaml b/pxii_bec/device_configs/pxii-beamline-states.yaml similarity index 54% rename from pxii_bec/device_configs/beamline_states.yaml rename to pxii_bec/device_configs/pxii-beamline-states.yaml index 8015eab..ee4e938 100644 --- a/pxii_bec/device_configs/beamline_states.yaml +++ b/pxii_bec/device_configs/pxii-beamline-states.yaml @@ -10,8 +10,14 @@ states: det_cov: 'close' diag_y: out fl_bright: 'off' - gon_x: in -# smargon: not implemented + aerotech_x: in + aerotech_y: mount + aerotech_z: mount + aerotech_u: mount + smargon_x: mount + smargon_y: mount + smargon_chi: mount + smargon_phi: mount xrf_pos: out sample_alignment: @@ -25,8 +31,14 @@ states: det_cov: 'close' diag_y: out fl_bright: 'on' - gon_x: in - # smargon: not implemented + aerotech_x: in + aerotech_y: work + aerotech_z: work + # aerotech_u: mount + # smargon_x: mount + # smargon_y: mount + # smargon_chi: mount + # smargon_phi: mount xrf_pos: out data_collection: @@ -40,8 +52,14 @@ states: det_cov: 'open' diag_y: out fl_bright: 'on' - gon_x: in - # smargon: not implemented + aerotech_x: in + aerotech_y: work + aerotech_z: work + # aerotech_u: mount + # smargon_x: mount + # smargon_y: mount + # smargon_chi: mount + # smargon_phi: mount xrf_pos: out DC_XRF: @@ -55,9 +73,15 @@ states: det_cov: 'close' diag_y: out fl_bright: 'on' - gon_x: in - # smargon: not implemented - xrf_pos: in + aerotech_x: in + aerotech_y: work + aerotech_z: work + aerotech_u: mount + # smargon_x: mount + # smargon_y: mount + # smargon_chi: mount + # smargon_phi: mount + xrf_pos: out manual_sample_exchange: allow_modifiers: true @@ -70,8 +94,14 @@ states: det_cov: 'close' diag_y: park fl_bright: 'off' - gon_x: in - # smargon: not implemented + aerotech_x: in + aerotech_y: mount + aerotech_z: mount + aerotech_u: mount + smargon_x: mount + smargon_y: mount + smargon_chi: mount + smargon_phi: mount xrf_pos: out beam_visualisation: @@ -84,8 +114,14 @@ states: det_cov: 'close' diag_y: scint fl_bright: 'off' - gon_x: out - # smargon: not implemented + aerotech_x: out + aerotech_y: mount + aerotech_z: mount + aerotech_u: mount + smargon_x: mount + smargon_y: mount + smargon_chi: mount + smargon_phi: mount xrf_pos: out flux_measurement: @@ -98,8 +134,14 @@ states: det_cov: 'close' diag_y: i1 fl_bright: 'off' - gon_x: out - # smargon: not implemented + aerotech_x: out + aerotech_y: mount + aerotech_z: mount + aerotech_u: mount + smargon_x: mount + smargon_y: mount + smargon_chi: mount + smargon_phi: mount xrf_pos: out beamstop_alignment: @@ -112,8 +154,14 @@ states: det_cov: 'close' diag_y: out fl_bright: 'on' - gon_x: out - # smargon: not implemented + aerotech_x: out + aerotech_y: mount + aerotech_z: mount + aerotech_u: mount + smargon_x: mount + smargon_y: mount + smargon_chi: mount + smargon_phi: mount xrf_pos: out maintenance: @@ -127,8 +175,14 @@ states: det_cov: 'close' diag_y: park fl_bright: 'off' - gon_x: out - # smargon: not implemented + aerotech_x: out + aerotech_y: mount + aerotech_z: mount + aerotech_u: mount + smargon_x: mount + smargon_y: mount + smargon_chi: mount + smargon_phi: mount xrf_pos: out xtal_snapshot: @@ -142,8 +196,14 @@ states: det_cov: 'close' diag_y: out fl_bright: 'on' - gon_x: in - # smargon: not implemented + aerotech_x: in + aerotech_y: work + aerotech_z: work + aerotech_u: mount + smargon_x: mount + smargon_y: mount + smargon_chi: mount + smargon_phi: mount xrf_pos: out diff --git a/pxii_bec/device_configs/pxii-devices-new.csv b/pxii_bec/device_configs/pxii-devices-new.csv deleted file mode 100644 index fb66ef9..0000000 --- a/pxii_bec/device_configs/pxii-devices-new.csv +++ /dev/null @@ -1,170 +0,0 @@ -name,description,deviceClass,PV,readoutPriority,tag,readOnly,include,userParameter, -sls_current,SLS Current,SignalRO,ARS07-DPCT-0100:CURR,monitored,SLS,yes,yes,, -fe_bpm1,FE XBPM Channel 1,SignalRO,X10SA-FE-XBPM1:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpm2,FE XBPM Channel 2,SignalRO,X10SA-FE-XBPM1:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpm3,FE XBPM Channel 3,SignalRO,X10SA-FE-XBPM1:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpm4,FE XBPM Channel 4,SignalRO,X10SA-FE-XBPM1:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpmsum,FE XBPM Summed,SignalRO,X10SA-FE-XBPM1:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, -fe_bpm_x,FE BPM X,Motor,X10SA-FE-XBPM1:TRX,baseline,fe,no,yes,, -fe_bpm_y,FE BPM Y,Motor,X10SA-FE-XBPM1:TRY,baseline,fe,no,yes,, -fe_sl_xr,FE Slit X Ring,MotorEC,X10SA-FE-SL1:TRXR,baseline,fe,no,yes,, -fe_sl_yt,FE Slit Y Top,MotorEC,X10SA-FE-SL1:TRYT,baseline,fe,no,yes,, -fe_sl_xw,FE Slit X Wall,MotorEC,X10SA-FE-SL1:TRXW,baseline,fe,no,yes,, -fe_sl_yb,FE Slit Y Bottom,MotorEC,X10SA-FE-SL1:TRYB,baseline,fe,no,yes,, -fe_sl_xcen,FE Slit X Centre,MotorEC,X10SA-FE-SL1:CENTERX,baseline,fe,no,yes,, -fe_sl_xsize,FE Slit X Size,MotorEC,X10SA-FE-SL1:SIZEX,baseline,fe,no,yes,, -fe_sl_ycen,FE Slit Y Centre,MotorEC,X10SA-FE-SL1:CENTERY,baseline,fe,no,yes,, -fe_sl_ysize,FE Slit Y Size,MotorEC,X10SA-FE-SL1:SIZEY,baseline,fe,no,yes,, -bsf_bpm1,BSF BPM Channel 1,SignalRO,X10SA-OP-BSFBPM:SIGNAL1,monitored,bpm,yes,no,, -bsf_bpm2,BSF BPM Channel 2,SignalRO,X10SA-OP-BSFBPM:SIGNAL2,monitored,bpm,yes,no,, -bsf_bpm3,BSF BPM Channel 3,SignalRO,X10SA-OP-BSFBPM:SIGNAL3,monitored,bpm,yes,no,, -bsf_bpm4,BSF BPM Channel 4,SignalRO,X10SA-OP-BSFBPM:SIGNAL4,monitored,bpm,yes,no,, -bsf_bpmsum,BSF BPM Summed,SignalRO,X10SA-OP-BSFBPM:SUM,monitored,bpm,yes,no,, -bsf_sl_xw,BSF Slit Wall,MotorEC,X10SA-OP-BSFSLH:TRXW,baseline,bsf,no,yes,, -bsf_sl_xr,BSF Slit Ring,MotorEC,X10SA-OP-BSFSLH:TRXR,baseline,bsf,no,yes,, -bsf_sl_yt,BSF Slit Top,MotorEC,X10SA-OP-BSFSLV:TRYT,baseline,bsf,no,yes,, -bsf_sl_yb,BSF Slit Bottom,MotorEC,X10SA-OP-BSFSLV:TRYB,baseline,bsf,no,yes,, -bsf_sl_xcen,BSF X Centre,MotorEC,X10SA-OP-BSFSLH:CENTER,baseline,bsf,no,yes,, -bsf_sl_xsize,BSF X Size,MotorEC,X10SA-OP-BSFSLH:SIZE,baseline,bsf,no,yes,, -bsf_sl_ycen,BSF Y Centre,MotorEC,X10SA-OP-BSFSLV:CENTER,baseline,bsf,no,yes,, -bsf_sl_ysize,BSF Y Size,MotorEC,X10SA-OP-BSFSLV:SIZE,baseline,bsf,no,yes,, -bsf_f1_y,BSF Filter 1 Y,MotorEC,X10SA-OP-BSFFI1:TRY,baseline,bsf,no,yes,, -bsf_f2_y,BSF Filter 2 Y,MotorEC,X10SA-OP-BSFFI2:TRY,baseline,bsf,no,yes,, -dcm_bragg,DCM Bragg Angle,MotorEC,X10SA-OP-DCM:ROTY,baseline,dcm,no,yes,, -dcm_x,DCM Lateral,MotorEC,X10SA-OP-DCM:TRX,baseline,dcm,no,yes,, -dcm_perp,DCM Perpendicular,MotorEC,X10SA-OP-DCM:TRX-CR2,baseline,dcm,no,yes,, -dcm_pitch,DCM 2nd Crystal Pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-PITCH,baseline,dcm,no,yes,, -dcm_fpitch,DCM 2nd Crystal Fine Pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-FINEPITCH,baseline,dcm,no,yes,, -dcm_froll,DCM 2nd Crystal Fine roll,MotorEC,X10SA-OP-DCM:ROTZ-CR2-FINEROLL,baseline,dcm,no,yes,, -lu_bpm1,LU BPM Channel 1,SignalRO,X10SA-OP-LUBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm2,LU BPM Channel 2,SignalRO,X10SA-OP-LUBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm3,LU BPM Channel 3,SignalRO,X10SA-OP-LUBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm4,LU BPM Channel 4,SignalRO,X10SA-OP-LUBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpmsum,LU BPM Summed,SignalRO,X10SA-OP-LUBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, -lu_bpm_x,BPM2 X ,Motor,X10SA-OP-LUBPM:TRX,baseline,lu,no,yes,, -lu_bpm_y,BPM2 Y ,Motor,X10SA-OP-LUBPM:TRY,baseline,lu,no,yes,, -lu_z1,Lens Z1 ,Motor,X10SA-OP-LUTRZ1:TRZ,baseline,lu,no,yes,, -lu_z2,Lens Z2 ,Motor,X10SA-OP-LUTRZ2:TRZ,baseline,lu,no,yes,, -lu_pod1_x,SmarPod1 X,Motor,X10SA-OP-LUPOD1:TRX1,baseline,lu,no,no,, -lu_lens1_x2,Lenses1 X,Motor,X10SA-OP-LUPOD1:TRX2,baseline,lu,no,no,, -lu_pod1_y,SmarPod1 Y,Motor,X10SA-OP-LUPOD1:TRY,baseline,lu,no,yes,, -lu_pod1_z,SmarPod1 Z,Motor,X10SA-OP-LUPOD1:TRZ,baseline,lu,no,yes,, -lu_pod1_rotx,SmarPod1 RX,Motor,X10SA-OP-LUPOD1:ROTX,baseline,lu,no,yes,, -lu_pod1_roty,SmarPod1 RY,Motor,X10SA-OP-LUPOD1:ROTY,baseline,lu,no,yes,, -lu_pod1_rotz,SmarPod1 RZ,Motor,X10SA-OP-LUPOD1:ROTZ,baseline,lu,no,yes,, -lu_pod2_x,SmarPod2 X,Motor,X10SA-OP-LUPOD2:TRX1,baseline,lu,no,no,, -lu_lens2_x2,Lenses2 X,Motor,X10SA-OP-LUPOD2:TRX2,baseline,lu,no,no,, -lu_pod2_y,SmarPod2 Y,Motor,X10SA-OP-LUPOD2:TRY,baseline,lu,no,yes,, -lu_pod2_z,SmarPod2 Z,Motor,X10SA-OP-LUPOD2:TRZ,baseline,lu,no,yes,, -lu_pod2_rotx,SmarPod2 RX,Motor,X10SA-OP-LUPOD2:ROTX,baseline,lu,no,yes,, -lu_pod2_roty,SmarPod2 RY,Motor,X10SA-OP-LUPOD2:ROTY,baseline,lu,no,yes,, -lu_pod2_rotz,SmarPod2 RZ,Motor,X10SA-OP-LUPOD2:ROTZ,baseline,lu,no,yes,, -ss_bpm1,SS BPM Channel 1,SignalRO,X10SA-ES-SSBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm2,SS BPM Channel 2,SignalRO,X10SA-ES-SSBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm3,SS BPM Channel 3,SignalRO,X10SA-ES-SSBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm4,SS BPM Channel 4,SignalRO,X10SA-ES-SSBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpmsum,SS BPM Summed,SignalRO,X10SA-ES-SSBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm_x,SS BPM X,Motor,X10SA-ES-SSBPM:TRX,baseline,ss,no,yes,, -ss_bpm_y,SS BPM Y,Motor,X10SA-ES-SSBPM:TRY,baseline,ss,no,yes,, -ss_f1_x,SS Filter 1 X,Motor,X10SA-ES-SSFI1:TRX,baseline,ss,no,yes,, -ss_f2_x,SS Filter 2 X,Motor,X10SA-ES-SSFI2:TRX,baseline,ss,no,yes,, -ss_f3_x,SS Filter 2 X,Motor,X10SA-ES-SSFI3:TRX,baseline,ss,no,yes,, -ss_f4_x,SS Filter 4 X,Motor,X10SA-ES-SSFI4:TRX,baseline,ss,no,yes,, -ss_sl_xw,SS Slit Wall,Motor,X10SA-ES-SSSLH:TRXW,baseline,ss,no,yes,, -ss_sl_xr,SS Slit Ring,Motor,X10SA-ES-SSSLH:TRXR,baseline,ss,no,yes,, -ss_sl_xcen,SS Slit X Centre,Motor,X10SA-ES-SSSLH:CENTER,baseline,ss,no,yes,, -ss_sl_xsize,SS Slit X Size,Motor,X10SA-ES-SSSLH:SIZE,baseline,ss,no,yes,, -ss_sl_yt,SS Slit Top,Motor,X10SA-ES-SSSLV:TRYT,baseline,ss,no,yes,, -ss_sl_yb,SS Slit Bottom,Motor,X10SA-ES-SSSLV:TRYB,baseline,ss,no,yes,, -ss_sl_ycen,SS Slit Y Centre,Motor,X10SA-ES-SSSLV:CENTER,baseline,ss,no,yes,, -ss_sl_ysize,SS Slit Y Size,Motor,X10SA-ES-SSSLV:SIZE,baseline,ss,no,yes,, -ss_xi_x,SS X-ray eye X,Motor,X10SA-ES-SSXI:TRX,baseline,ss,no,yes,"{""type"": multi-position,""in"": 7.5, ""out"": -2.1}", -ss_xi_y,SS X-ray eye Y,Motor,X10SA-ES-SSXI:TRY,baseline,ss,no,yes,, -ss_xicam_x,SS Camera X,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidX_RBV,baseline,ss,yes,no,, -ss_xicam_y,SS Camera Y,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidY_RBV,baseline,ss,yes,no,, -ss_xicam_max,SS Cam Max,SignalRO,X10SA-ES-SSXI:cam1:Stats5:MaxValue_RBV,monitored,ss,yes,no,, -ss_xicam_exp,SS Camera Exposure,Signal,X10SA-ES-SSXI:cam1:AcquireTime,baseline,ss,no,no,, -ss_xicam_gain,SS Camera Gain,Signal,X10SA-ES-SSXI:cam1:cam1:Gain,baseline,ss,no,no,, -ss_xicam_xsig,SS Camera X Sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaX_RBV,baseline,ss,yes,no,, -ss_xicam_ysig,SS Camera Y Sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaY_RBV,baseline,ss,yes,no,, -vfm_xu,VFM Upstream X,MotorEC,X10SA-ES-VFM:TRXU,baseline,vfm,no,yes,, -vfm_xd,VFM Downstream X,MotorEC,X10SA-ES-VFM:TRXD,baseline,vfm,no,yes,, -vfm_yur,VFM Upstream Ring Y,MotorEC,X10SA-ES-VFM:TRYUR,baseline,vfm,no,yes,, -vfm_yw,VFM Wall Y,MotorEC,X10SA-ES-VFM:TRYW,baseline,vfm,no,yes,, -vfm_ydr,VFM Downstream Ring Y,MotorEC,X10SA-ES-VFM:TRYDR,baseline,vfm,no,yes,, -vfm_bu,VFM Upstream Bender,MotorEC,X10SA-ES-VFM:BNDU,baseline,vfm,no,yes,, -vfm_bd,VFM Downstream Bender,MotorEC,X10SA-ES-VFM:BNDD,baseline,vfm,no,yes,, -vfm_yaw,VFM Virtual Yaw,MotorEC,X10SA-ES-VFM:YAW,baseline,vfm,no,yes,, -vfm_roll,VFM Virtual Roll,MotorEC,X10SA-ES-VFM:ROLL,baseline,vfm,no,yes,, -vfm_pitch,VFM Virtual Pitch,MotorEC,X10SA-ES-VFM:PITCH,baseline,vfm,no,yes,, -vfm_x,VFM Virtual X,MotorEC,X10SA-ES-VFM:TRX,baseline,vfm,no,yes,, -vfm_y,VFM Virtual Y ,MotorEC,X10SA-ES-VFM:TRY,baseline,vfm,no,yes,, -hfm_xu,HFM Upstream X,MotorEC,X10SA-ES-HFM:TRXU,baseline,hfm,no,yes,, -hfm_xd,HFM Downstream X,MotorEC,X10SA-ES-HFM:TRXD,baseline,hfm,no,yes,, -hfm_yuw,HFM Upstream Wall Y,MotorEC,X10SA-ES-HFM:TRYUW,baseline,hfm,no,yes,, -hfm_yr,HFM Ring Y,MotorEC,X10SA-ES-HFM:TRYR,baseline,hfm,no,yes,, -hfm_ydw,HFM Downstream Wall Y,MotorEC,X10SA-ES-HFM:TRYDW,baseline,hfm,no,yes,, -hfm_bu,HFM Upstream Bender,MotorEC,X10SA-ES-HFM:BNDU,baseline,hfm,no,yes,, -hfm_bd,HFM Downstream Bender,MotorEC,X10SA-ES-HFM:BNDD,baseline,hfm,no,yes,, -hfm_yaw,HFM Virtual Yaw,MotorEC,X10SA-ES-HFM:YAW,baseline,hfm,no,yes,, -hfm_roll,HFM Virtual Roll,MotorEC,X10SA-ES-HFM:ROLL,baseline,hfm,no,yes,, -hfm_pitch,HFM Virtual Pitch,MotorEC,X10SA-ES-HFM:PITCH,baseline,hfm,no,yes,, -hfm_x,HFM Virtual X,MotorEC,X10SA-ES-HFM:TRX,baseline,hfm,no,yes,, -hfm_y,HFM Virtual Y ,MotorEC,X10SA-ES-HFM:TRY,baseline,hfm,no,yes,, -bcu_bpm1,BCU BPM Channel 1 ,SignalRO,X10SA-ES-BCBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpm2,BCU BPM Channel 2,SignalRO,X10SA-ES-BCBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpm3,BCU BPM Channel 3,SignalRO,X10SA-ES-BCBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpm4,BCU BPM Channel 4,SignalRO,X10SA-ES-BCBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpmsum,BCU BPM Summed,SignalRO,X10SA-ES-BCBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, -bcu_bpm_x,BCU BPM X,Motor,X10SA-ES-BCBPM:TRX,baseline,bcu,no,yes,, -bcu_bpm_y,BCU BPM Y ,Motor,X10SA-ES-BCBPM:TRY,baseline,bcu,no,yes,, -bcu_sl_xw,BCU Slit Wall,Motor,X10SA-ES-BCSLH:TRXW,baseline,bcu,no,yes,, -bcu_sl_xr,BCU Slit Ring,Motor,X10SA-ES-BCSLH:TRXR,baseline,bcu,no,yes,, -bcu_sl_xcen,BCU Slit X Centre,Motor,X10SA-ES-BCSLH:CENTER,baseline,bcu,no,yes,, -bcu_sl_xsize,BCU Slit X Size,Motor,X10SA-ES-BCSLH:SIZE,baseline,bcu,no,yes,, -bcu_sl_yt,BCU Slit Top,Motor,X10SA-ES-BCSLV:TRYT,baseline,bcu,no,yes,, -bcu_sl_yb,BCU Slit Bottom,Motor,X10SA-ES-BCSLV:TRYB,baseline,bcu,no,yes,, -bcu_sl_ycen,BCU Slit Y Centre,Motor,X10SA-ES-BCSLV:CENTER,baseline,bcu,no,yes,, -bcu_sl_ysize,BCU Slit Y Size,Motor,X10SA-ES-BCSLV:SIZE,baseline,bcu,no,yes,, -xrf_pos,XRF Positioner,Signal,X10SA-ES-XRF:POS-SET,baseline,se,no,no,"{""type"":positioner}", -samcam_x,Sample Camera X ,SignalRO,X10SA-ES-MS:Stats5:CentroidX_RBV,baseline,scam,yes,yes,, -samcam_xsig,Sample Camera X Sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaX_RBV,monitored,scam,yes,yes,, -samcam_y,Sample Camera Y ,SignalRO,X10SA-ES-MS:Stats5:CentroidY_RBV,baseline,scam,yes,yes,, -samcam_ysig,Sample Camera Y Sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaY_RBV,monitored,scam,yes,yes,, -samcam_max,Sample Camera Max ,SignalRO,X10SA-ES-MS:Stats5:MaxValue_RBV,monitored,scam,yes,yes,, -samcam_exp,Sample Camera Exposure,Signal,X10SA-ES-MS:cam1:AcquireTime,baseline,scam,no,yes,, -samcam_gain,Sample Camera Gain,Signal,X10SA-ES-MS:cam1:Gain,baseline,scam,no,yes,, -scam_zoom,Sample Camera Zoom,Motor,X10SA-ES-MS:ZOOM,baseline,scam,no,yes,, -fl_bright,Frontlight Brightness,Signal,X10SA-ES-FL:SET,baseline,se,no,no,, -coll_x,Collimator X,Motor,X10SA-ES-COL:TRX,baseline,se,no,yes,, -coll_y,Collimator Y,Motor,X10SA-ES-COL:TRY,baseline,se,no,no,"{""type"": multi-position, ""in"": 41.5, ""out"": 20.0, ""park"": 0,""tol"":0.05}", -diag_y,Scintillator/diode Y,Motor,X10SA-ES-SCL:TRY,baseline,se,no,no,"{""type"": multi-position, ""scint"": 38.62, ""i1"": 44.0, ""out"": 20.0,""park"": 0,""tol"":0.3}", -diag_z,Scintillator/diode Z,Motor,X10SA-ES-SCL:TRZ,baseline,se,no,yes,, -i1,I1 Diode,SignalRO,X10SA-ES-SCLDI:READOUT,monitored,bpm,yes,yes,, -bl_pos,Backlight Positioner,Signal,X10SA-ES-BL:POS-SET,baseline,se,no,no,"{""type"":positioner}", -bl_bright,Backlight Brightness,Signal,X10SA-ES-BL:SET,baseline,se,no,no,, -bs_x,Beamstop X,Motor,X10SA-ES-BS:TRX,baseline,se,no,yes,, -bs_y,Beamstop Y,Motor,X10SA-ES-BS:TRY,baseline,se,no,yes,, -bs_z,Beamstop Z,Motor,X10SA-ES-BS:TRZ,baseline,se,no,no,"{""type"": guarded, ""min"": 13, ""samp"": 15, ""work_min"": 20, ""safe"": 41, ""max_blin"": 42, ""max_blout"": 70}", -bs_pos,Beamstop Positioner,Signal,X10SA-ES-BS:POS-SET,baseline,se,no,no,"{""type"":positioner}", -gon_x,Goniometer X,Motor,X10SA-ES-DF1:TRX1,baseline,det,no,no,"{""type"": guarded, ""in"": 18.0, ""out"": -10.0, ""safe"": -100,""tol"":0.5}", -gon_y,Goniometer Y,Motor,X10SA-ES-DF1:TRY1,baseline,det,no,yes,, -gon_z,Goniometer X,Motor,X10SA-ES-DF1:TRZ1,baseline,det,no,yes,, -omega,Omega,Motor,X10SA-ES-DF1:ROTU,baseline,det,no,yes,, -cryo_pos,Cryo positioner,Signal,X10SA-ES-CS:POS-SET,baseline,se,no,no,"{""type"":positioner}", -cryo_x,Cryo X ,Motor,X10SA-ES-CS:TRX,baseline,se,no,yes,, -cryo_temp,Cryo Temperature,Signal,X10SA-ES-CS:TEMP_RBV,baseline,se,yes,yes,, -det_xi_focus,X-ray Eye 2 Focus,Motor,X10SA-ES-XEYE:FOCUS,baseline,det,no,yes,, -det_xi_zoom,X-ray Eye 2 Zoom,Motor,X10SA-ES-XEYE:ZOOM,baseline,det,no,yes,, -det_xi_x,X-ray Eye X,Motor,X10SA-ES-XEYE:TRX,baseline,det,no,yes,, -i2,I2 Diode,SignalRO,X10SA-ES-XEYEDI:READOUT,monitored,bpm,yes,yes,, -det_xicam_x,Det Camera X ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidX_RBV,baseline,scam,yes,no,, -det_xicam_xsig,Det Camera X Sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaX_RBV,monitored,scam,yes,no,, -det_xicam_y,Det Camera Y ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidY_RBV,baseline,scam,yes,no,, -det_xicam_ysig,Det Camera Y Sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaY_RBV,monitored,scam,yes,no,, -det_xicam_max,Det Camera Max,SignalRO,X10SA-ES-XEYE:cam1:Stats5:MaxValue_RBV,monitored,scam,yes,no,, -det_xicam_exp,Det Camera Exposure,Signal,X10SA-ES-XEYE:cam1:cam1:AcquireTime,baseline,scam,no,no,, -det_xicam_gain,Det Camera Gain,Signal,X10SA-ES-XEYE:cam1:cam1:Gain,baseline,Sigma,no,no,, -det_cov,Detector Cover,Signal,X10SA-ES-DETCOV:SET,baseline,det,no,no,"{""type"":positioner}", -det_y,Detector Y,Motor,X10SA-ES-DET:TRY,baseline,det,no,yes,, -det_z,Detector Z,Motor,X10SA-ES-DET:TRZ,baseline,det,no,yes,, diff --git a/pxii_bec/device_configs/pxii-rest-devices.yaml b/pxii_bec/device_configs/pxii-rest-devices.yaml new file mode 100644 index 0000000..abf79ff --- /dev/null +++ b/pxii_bec/device_configs/pxii-rest-devices.yaml @@ -0,0 +1,18 @@ +aerotech_x: + userParameter: {"type": continuous, "in": 0.0, "out": -10.0, "safe": -50, "tol": 0.5} +aerotech_y: + userParameter: {"type": continuous, "mount": 0.0, "work": 0.01, "tol": 0.002} +aerotech_z: + userParameter: {"type": continuous, "mount": 0.0, "work": 0.02, "tol": 0.01} +aerotech_u: + userParameter: {"type": continuous, "mount": 0.0} +smargon_x: + userParameter: {"type": continuous, "mount": 0.0} +smargon_y: + userParameter: {"type": continuous, "mount": 0.0} +smargon_z: + userParameter: {"type": continuous, "mount": 18.0} +smargon_chi: + userParameter: {"type": continuous, "mount": 0.0} +smargon_phi: + userParameter: {"type": continuous, "mount": 0.0} diff --git a/pxii_bec/device_configs/pxii-devices-new.yaml b/pxii_bec/device_configs/pxii-standard-devices.yaml similarity index 97% rename from pxii_bec/device_configs/pxii-devices-new.yaml rename to pxii_bec/device_configs/pxii-standard-devices.yaml index 0f7aa0f..6c2000f 100644 --- a/pxii_bec/device_configs/pxii-devices-new.yaml +++ b/pxii_bec/device_configs/pxii-standard-devices.yaml @@ -839,7 +839,7 @@ ss_sl_ysize: softwareTrigger: false ss_xi_x: - description: SS X-ray eye X + description: SS X-ray Eye X deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSXI:TRX'} onFailure: buffer @@ -852,7 +852,7 @@ ss_xi_x: userParameter: {"type": multi-position,"in": 7.5, "out": -2.1} ss_xi_y: - description: SS X-ray eye Y + description: SS X-ray Eye Y deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-SSXI:TRY'} onFailure: buffer @@ -1523,6 +1523,42 @@ omega: readOnly: False softwareTrigger: false +mag_ok: + description: Sample Sensor Check + deviceClass: ophyd.EpicsSignalRO + deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-CMP1', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - se + readOnly: True + softwareTrigger: false + +mag_rbv: + description: Sample Sensor RBV + deviceClass: ophyd.EpicsSignalRO + deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-USER1', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - se + readOnly: True + softwareTrigger: false + +mag_ref: + description: Sample Sensor Reference + deviceClass: ophyd.EpicsSignalRO + deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-REFVAL1', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - se + readOnly: True + softwareTrigger: false + cryo_x: description: Cryo X deviceClass: ophyd_devices.EpicsMotor @@ -1548,7 +1584,7 @@ cryo_temp: softwareTrigger: false det_xi_focus: - description: X-ray eye 2 Focus + description: X-ray Eye 2 Focus deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-XEYE:FOCUS'} onFailure: buffer @@ -1560,7 +1596,7 @@ det_xi_focus: softwareTrigger: false det_xi_zoom: - description: X-ray eye 2 Zoom + description: X-ray Eye 2 Zoom deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-XEYE:ZOOM'} onFailure: buffer @@ -1572,7 +1608,7 @@ det_xi_zoom: softwareTrigger: false det_xi_x: - description: X-ray eye X + description: X-ray Eye X deviceClass: ophyd_devices.EpicsMotor deviceConfig: {prefix: 'X10SA-ES-XEYE:TRX'} onFailure: buffer diff --git a/pxii_bec/device_configs/se_devices.yaml b/pxii_bec/device_configs/pxii-state-devices.yaml similarity index 60% rename from pxii_bec/device_configs/se_devices.yaml rename to pxii_bec/device_configs/pxii-state-devices.yaml index 994a7dd..9888dc2 100644 --- a/pxii_bec/device_configs/se_devices.yaml +++ b/pxii_bec/device_configs/pxii-state-devices.yaml @@ -1,159 +1,3 @@ -ss_sl_xw: - description: SS slit wall - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - userParameter: - type: continuous - in: 1.0 - out: 2.0 - -bs_z: - description: Beamstop Z - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BS:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - userParameter: - type: continuous - min: 13 - samp: 15 - work_min: 20 - safe: 41 - max_blin: 42 - max_blout: 70 - -gon_x: - description: Goniometer X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DF1:TRX1'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - userParameter: - type: continuous - in: 0.0 - out: -10.0 - safe: -100 - tol: 0.5 - -diag_y: - description: Scintillator/diode Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SCL:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - userParameter: - type: continuous - scint: 38.62 - i1: 44.0 - out: 20.0 - park: 1 - tol: 0.3 - -coll_y: - description: Collimator Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-COL:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - userParameter: - type: continuous - in: 41.5 - intermediate: 32 - out: 20.0 - park: 1 - tol: 0.05 - -bs_pos: - description: Beamstop Positioner - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-BS:POS-SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - userParameter: - type: discrete - in: 1.0 - out: 0.0 - -xrf_pos: - description: XRF Positioner - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-XRF:POS-SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - userParameter: - type: discrete - in: 1.0 - out: 0.0 - -cryo_pos: - description: Cryo Positioner - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-CS:POS-SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - userParameter: - type: discrete - in: 1.0 - out: 0.0 - -det_cov: - description: Detector Cover - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-DETCOV:SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - userParameter: - type: discrete - 'open': 2.0 - 'close': 1.0 - bl_bright: description: Backlight Brightness deviceClass: ophyd.EpicsSignal @@ -162,15 +6,10 @@ bl_bright: enabled: True readoutPriority: baseline deviceTags: - - se + - state readOnly: False softwareTrigger: false - userParameter: - type: continuous - 'on': 1.3 - 'off': 0.0 - 'tol': 0.01 - + userParameter: {"type": continuous, "on": 1.3, "off": 0.0, "tol": 0.01} bl_pos: description: Backlight Positioner @@ -180,13 +19,88 @@ bl_pos: enabled: True readoutPriority: baseline deviceTags: - - se + - state readOnly: False softwareTrigger: false - userParameter: - type: discrete - in: 1.0 - out: 0.0 + userParameter: {"type":discrete, "in": 1, "out": 0} + +bs_pos: + description: Beamstop Positioner + deviceClass: ophyd.EpicsSignal + deviceConfig: {read_pv: 'X10SA-ES-BS:POS-SET', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - state + readOnly: False + softwareTrigger: false + userParameter: {"type":discrete, "in": 1, "out": 0} + +bs_z: + description: Beamstop Z + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-BS:TRZ'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - state + readOnly: False + softwareTrigger: false + userParameter: {"type": continuous, "min": 13, "samp": 15, "work_min": 20, "safe": 41, "max_blin": 42, "max_blout": 70} + +coll_y: + description: Collimator Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-COL:TRY'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - state + readOnly: False + softwareTrigger: false + userParameter: {"type": continuous, "in": 41.5, "out": 20.0, "intermediate": 32, "park": 1,"tol":0.05} + +cryo_pos: + description: Cryo positioner + deviceClass: ophyd.EpicsSignal + deviceConfig: {read_pv: 'X10SA-ES-CS:POS-SET', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - state + readOnly: False + softwareTrigger: false + userParameter: {"type":discrete, "in": 1, "out": 0} + +det_cov: + description: Detector cover + deviceClass: ophyd.EpicsSignal + deviceConfig: {read_pv: 'X10SA-ES-DETCOV:SET', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - state + readOnly: False + softwareTrigger: false + userParameter: {"type":discrete, "open": 2, "close": 1} + +diag_y: + description: Scintillator/diode Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: {prefix: 'X10SA-ES-SCL:TRY'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - state + readOnly: False + softwareTrigger: false + userParameter: {"type": continuous, "scint": 38.62, "i1": 44.0, "out": 20.0,"park": 1,"tol":0.3} fl_bright: description: Frontlight Brightness @@ -196,11 +110,21 @@ fl_bright: enabled: True readoutPriority: baseline deviceTags: - - se + - state readOnly: False softwareTrigger: false - userParameter: - type: continuous - 'on': 3.0 - 'off': 0.0 + userParameter: {"type": continuous, "on": 3.0, "off": 0.0, "tol": 0.01} + +xrf_pos: + description: XRF Positioner + deviceClass: ophyd.EpicsSignal + deviceConfig: {read_pv: 'X10SA-ES-XRF:POS-SET', auto_monitor: true} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - state + readOnly: False + softwareTrigger: false + userParameter: {"type":discrete, "in": 1, "out": 0} diff --git a/pxii_bec/device_configs/pxiii-devices-new.csv b/pxii_bec/device_configs/pxiii-devices-new.csv deleted file mode 100644 index bd234a3..0000000 --- a/pxii_bec/device_configs/pxiii-devices-new.csv +++ /dev/null @@ -1,146 +0,0 @@ -name,description,deviceClass,PV,readoutPriority,tag,readOnly,include,userParameter, -sls_current,SLS current,SignalRO,ARS07-DPCT-0100:CURR,monitored,SLS,yes,yes,, -fe_sl_xr,FE Slit X Ring,Motor,X06DA-FE-SLDI:TRXR,baseline,fe,no,yes,, -fe_sl_yt,FE Slit Y top,Motor,X06DA-FE-SLDI:TRYT,baseline,fe,no,yes,, -fe_sl_xw,FE Slit X Wall,Motor,X06DA-FE-SLDI:TRXW,baseline,fe,no,yes,, -fe_sl_yb,FE SlitY Bottom,Motor,X06DA-FE-SLDI:TRYB,baseline,fe,no,yes,, -fe_sl_xcen,FE Slit X Centre,Motor,X06DA-FE-SLDI:CENTERX,baseline,fe,no,yes,, -fe_sl_xsize,FE Slit X Size,Motor,X06DA-FE-SLDI:SIZEX,baseline,fe,no,yes,, -fe_sl_ycen,FE Slit Y Centre,Motor,X06DA-FE-SLDI:CENTERY,baseline,fe,no,yes,, -fe_sl_ysize,FE Slit Y Size,Motor,X06DA-FE-SLDI:SIZEY,baseline,fe,no,yes,, -fe_cm_xu,FE Coll Mirror Upstream X,Motor,X06DA-ES-MI1:TRXU,baseline,fe_cm,no,yes,, -fe_cm_xd,FE Coll Mirror Downstream X,Motor,X06DA-ES-MI1:TRXD,baseline,fe_cm,no,yes,, -fe_cm_yur,FE Coll Mirror Upstream Ring Y,Motor,X06DA-ES-MI1:TRYUR,baseline,fe_cm,no,yes,, -fe_cm_yw,FE Coll Mirror Wall Y,Motor,X06DA-ES-MI1:TRYW,baseline,fe_cm,no,yes,, -fe_cm_ydr,FE Coll Mirror Downstream Ring Y,Motor,X06DA-ES-MI1:TRYDR,baseline,fe_cm,no,yes,, -fe_cm_b1,FE Coll Mirror Bender,Motor,X06DA-ES-MI1:BND1,baseline,fe_cm,no,yes,, -fe_cm_yaw,FE Coll Mirror Yaw,Motor,X06DA-ES-MI1:YAW,baseline,fe_cm,no,yes,, -fe_cm_roll,FE Coll Mirror Roll,Motor,X06DA-ES-MI1:ROLL,baseline,fe_cm,no,yes,, -fe_cm_pitch,FE Coll Mirror Pitch,Motor,X06DA-ES-MI1:PITCH,baseline,fe_cm,no,yes,, -fe_cm_x,FE Coll Mirror X,Motor,X06DA-ES-MI1:TRX,baseline,fe_cm,no,yes,, -fe_cm_y,FE Coll Mirror Y ,Motor,X06DA-ES-MI1:TRY,baseline,fe_cm,no,yes,, -bsf_bpm1,BSF BPM Signal 1,SignalRO,X06DA-OP-BSFBPM:SIGNAL1,monitored,bpm,yes,no,, -bsf_bpm2,BSF BPM Signal 2,SignalRO,X06DA-OP-BSFBPM:SIGNAL2,monitored,bpm,yes,no,, -bsf_bpm3,BSF BPM Signal 3,SignalRO,X06DA-OP-BSFBPM:SIGNAL3,monitored,bpm,yes,no,, -bsf_bpm4,BSF BPM Signal 4,SignalRO,X06DA-OP-BSFBPM:SIGNAL4,monitored,bpm,yes,no,, -bsf_bpmsum,BSF BPM Summed,SignalRO,X06DA-OP-BSFBPM:SUM,monitored,bpm,yes,no,, -bsf_sl_xw,BSF slit outboard,Motor,X06DA-OP-BSFSLH:TRXW,baseline,bsf,no,yes,, -bsf_sl_xr,BSF slit inboard,Motor,X06DA-OP-BSFSLH:TRXR,baseline,bsf,no,yes,, -bsf_sl_yt,BSF slit top,Motor,X06DA-OP-BSFSLV:TRYT,baseline,bsf,no,yes,, -bsf_sl_yb,BSF slit bottom,Motor,X06DA-OP-BSFSLV:TRYB,baseline,bsf,no,yes,, -bsf_sl_xcen,BSF X centre,Motor,X06DA-OP-BSFSLH:CENTER,baseline,bsf,no,yes,, -bsf_sl_xsize,BSF X size,Motor,X06DA-OP-BSFSLH:SIZE,baseline,bsf,no,yes,, -bsf_sl_ycen,BSF Y centre,Motor,X06DA-OP-BSFSLV:CENTER,baseline,bsf,no,yes,, -bsf_sl_ysize,BSF Y size,Motor,X06DA-OP-BSFSLV:SIZE,baseline,bsf,no,yes,, -bsf_f1_y,BSF Filter 1 Y,Motor,X06DA-OP-BSFFI1:TRY,baseline,bsf,no,yes,, -bsf_f2_y,BSF Filter 2 Y,Motor,X06DA-OP-BSFFI2:TRY,baseline,bsf,no,yes,, -dccm_theta1,DCCM theta1,Motor,X06DA-OP-DCCM:ROTX-CR1,baseline,dccm,no,yes,, -dccm_theta2,DCCM theta2,Motor,X06DA-OP-DCCM:ROTX-CR2,baseline,dccm,no,yes,, -dccm_rotz,DCCM Crystal 2 rotz ,Motor,X06DA-OP-DCCM:ROTZ-CR2,baseline,dccm,no,yes,, -dccm_energy,DCCM energy,Motor,X06DA-OP-DCCM:ENERGY,baseline,dccm,no,yes,, -dccm_diode_t,Top diode between mono crystals,SignalRO,X06DA-OP-XPM1:TOP:READOUT,baseline,dccm,no,yes,, -dccm_diode_b,Bottom diode between mono crystals,SignalRO,X06DA-OP-XPM1:BOT:READOUT,baseline,dccm,no,yes,, -dccm_xbpm1,XBPM after mono ch1,SignalRO,X06DA-OP-XBPM1:Current1:MeanValue_RBV,baseline,dccm,no,yes,, -dccm_xbpm2,XBPM after mono ch2,SignalRO,X06DA-OP-XBPM1:Current2:MeanValue_RBV,baseline,dccm,no,yes,, -dccm_xbpm3,XBPM after mono ch3,SignalRO,X06DA-OP-XBPM1:Current3:MeanValue_RBV,baseline,dccm,no,yes,, -dccm_xbpm4,XBPM after mono ch4,SignalRO,X06DA-OP-XBPM1:Current4:MeanValue_RBV,baseline,dccm,no,yes,, -dccm_xbpmsum,XBPM after mono summed,SignalRO,X06DA-OP-XBPM1:SumAll:MeanValue_RBV,baseline,dccm,no,yes,, -ss_bpm1,SS BPM Signal 1,SignalRO,X06DA-ES-SSBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm2,SS BPM Signal 2,SignalRO,X06DA-ES-SSBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm3,SS BPM Signal 3,SignalRO,X06DA-ES-SSBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm4,SS BPM Signal 4,SignalRO,X06DA-ES-SSBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpmsum,SS BPM Summed,SignalRO,X06DA-ES-SSBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,, -ss_bpm_x,SS BPM X,Motor,X06DA-ES-SSBPM:TRX,baseline,ss,no,yes,, -ss_bpm_y,SS BPM Y,Motor,X06DA-ES-SSBPM:TRY,baseline,ss,no,yes,, -ss_sl_xw,SS slit wall,Motor,X06DA-ES-SSSLH:TRXW,baseline,ss,no,yes,, -ss_sl_xr,SS slit ring,Motor,X06DA-ES-SSSLH:TRXR,baseline,ss,no,yes,, -ss_sl_xcen,SS slit X centre,Motor,X06DA-ES-SSSLH:CENTER,baseline,ss,no,yes,, -ss_sl_xsize,SS slit X size,Motor,X06DA-ES-SSSLH:SIZE,baseline,ss,no,yes,, -ss_sl_yt,SS slit top,Motor,X06DA-ES-SSSLV:TRYT,baseline,ss,no,yes,, -ss_sl_yb,SS slit bottom,Motor,X06DA-ES-SSSLV:TRYB,baseline,ss,no,yes,, -ss_sl_ycen,SS slit Y centre,Motor,X06DA-ES-SSSLV:CENTER,baseline,ss,no,yes,, -ss_sl_ysize,SS slit Y size,Motor,X06DA-ES-SSSLV:SIZE,baseline,ss,no,yes,, -ss_xi_x,SS X-ray eye X,Motor,X06DA-ES-SSXI:TRX,baseline,ss,no,yes,, -ss_xi_y,SS X-ray eye Y,Motor,X06DA-ES-SSXI:TRY,baseline,ss,no,yes,, -ss_xicam_x,ss cam X,SignalRO,X06DA-ES-SSXI:cam1:Stats5:CentroidX_RBV,baseline,ss,yes,yes,, -ss_xicam_y,ss cam Y,SignalRO,X06DA-ES-SSXI:cam1:Stats5:CentroidY_RBV,baseline,ss,yes,yes,, -ss_xicam_max,ss cam max value,SignalRO,X06DA-ES-SSXI:cam1:Stats5:MaxValue_RBV,monitored,ss,yes,yes,, -ss_xicam_exp,ss camera exposure,Signal,X06DA-ES-SSXI:cam1:AcquireTime,baseline,ss,no,yes,, -ss_xicam_gain,ss camera gain,Signal,X06DA-ES-SSXI:cam1:cam1:Gain,baseline,ss,no,yes,, -ss_xicam_xsig,ss camera x sigma,Signal,X06DA-ES-SSXI:cam1:Stats5:SigmaX_RBV,baseline,ss,yes,yes,, -ss_xicam_ysig,ss camera y sigma,Signal,X06DA-ES-SSXI:cam1:Stats5:SigmaY_RBV,baseline,ss,yes,yes,, -vfm_xu,VFM Upstream X,Motor,X06DA-ES-KBV:TRXU,baseline,vfm,no,no,, -vfm_xd,VFM Downstream X,Motor,X06DA-ES-KBV:TRXD,baseline,vfm,no,no,, -vfm_yur,VFM Upstream Ring Y,Motor,X06DA-ES-KBV:TRYUR,baseline,vfm,no,no,, -vfm_yw,VFM Wall Y,Motor,X06DA-ES-KBV:TRYW,baseline,vfm,no,no,, -vfm_ydr,VFM Downstream Ring Y,Motor,X06DA-ES-KBV:TRYDR,baseline,vfm,no,no,, -vfm_bu,VFM Upstream Bender,Motor,X06DA-ES-KBV:BNDU,baseline,vfm,no,no,, -vfm_bd,VFM Downstream Bender,Motor,X06DA-ES-KBV:BNDD,baseline,vfm,no,no,, -vfm_yaw,VFM Virtual Yaw,Motor,X06DA-ES-KBV:YAW,baseline,vfm,no,no,, -vfm_roll,VFM Virtual Roll,Motor,X06DA-ES-KBV:ROLL,baseline,vfm,no,no,, -vfm_pitch,VFM Virtual Pitch,Motor,X06DA-ES-KBV:PITCH,baseline,vfm,no,no,, -vfm_x,VFM Virtual X,Motor,X06DA-ES-KBV:TRX,baseline,vfm,no,no,, -vfm_y,VFM Virtual Y ,Motor,X06DA-ES-KBV:TRY,baseline,vfm,no,no,, -hfm_xu,HFM Upstream X,Motor,X06DA-ES-KBH:TRXU,baseline,hfm,no,no,, -hfm_xd,HFM Downstream X,Motor,X06DA-ES-KBH:TRXD,baseline,hfm,no,no,, -hfm_yuw,HFM Upstream Wall Y,Motor,X06DA-ES-KBH:TRYUW,baseline,hfm,no,no,, -hfm_yr,HFM Ring Y,Motor,X06DA-ES-KBH:TRYR,baseline,hfm,no,no,, -hfm_ydw,HFM Downstream Wall Y,Motor,X06DA-ES-KBH:TRYDW,baseline,hfm,no,no,, -hfm_bu,HFM Upstream Bender,Motor,X06DA-ES-KBH:BNDU,baseline,hfm,no,no,, -hfm_bd,HFM Downstream Bender,Motor,X06DA-ES-KBH:BNDD,baseline,hfm,no,no,, -hfm_yaw,HFM Virtual Yaw,Motor,X06DA-ES-KBH:YAW,baseline,hfm,no,no,, -hfm_roll,HFM Virtual Roll,Motor,X06DA-ES-KBH:ROLL,baseline,hfm,no,no,, -hfm_pitch,HFM Virtual Pitch,Motor,X06DA-ES-KBH:PITCH,baseline,hfm,no,no,, -hfm_x,HFM Virtual X,Motor,X06DA-ES-KBH:TRX,baseline,hfm,no,no,, -hfm_y,HFM Virtual Y ,Motor,X06DA-ES-KBH:TRY,baseline,hfm,no,no,, -bcu_bpm1,BCU BPM Signal 1 ,SignalRO,X06DA-ES-BCBPM:Current1:MeanValue_RBV,monitored,bpm,yes,no,, -bcu_bpm2,BCU BPM Signal 2,SignalRO,X06DA-ES-BCBPM:Current2:MeanValue_RBV,monitored,bpm,yes,no,, -bcu_bpm3,BCU BPM Signal 3,SignalRO,X06DA-ES-BCBPM:Current3:MeanValue_RBV,monitored,bpm,yes,no,, -bcu_bpm4,BCU BPM Signal 4,SignalRO,X06DA-ES-BCBPM:Current4:MeanValue_RBV,monitored,bpm,yes,no,, -bcu_bpmsum,BCU BPM Summed,SignalRO,X06DA-ES-BCBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,no,, -bcu_bpm_x,BCU BPM X,Motor,X06DA-ES-BCBPM:TRX,baseline,bcu,no,no,, -bcu_bpm_y,BCU BPM Y ,Motor,X06DA-ES-BCBPM:TRY,baseline,bcu,no,no,, -bcu_sl_xw,BCU slit wall,Motor,X06DA-ES-BCSLH:TRXW,baseline,bcu,no,no,, -bcu_sl_xr,BCU slit ring,Motor,X06DA-ES-BCSLH:TRXR,baseline,bcu,no,no,, -bcu_sl_xcen,BCU slit X centre,Motor,X06DA-ES-BCSLH:CENTER,baseline,bcu,no,no,, -bcu_sl_xsize,BCU slit X size,Motor,X06DA-ES-BCSLH:SIZEX,baseline,bcu,no,no,, -bcu_sl_yt,BCU slit top,Motor,X06DA-ES-BCSLV:TRYT,baseline,bcu,no,no,, -bcu_sl_yb,BCU slit bottom,Motor,X06DA-ES-BCSLV:TRYB,baseline,bcu,no,no,, -bcu_sl_ycen,BCU slit Y centre,Motor,X06DA-ES-BCSLV:CENTER,baseline,bcu,no,no,, -bcu_sl_ysize,BCU slit Y size,Motor,X06DA-ES-BCSLV:SIZE,baseline,bcu,no,no,, -bcu_f1_x,BCU filter 1 X,Motor,X06DA-ES-BCFI1:TRX,baseline,bcu,no,no,, -bcu_f2_x,BCU filter 2 X,Motor,X06DA-ES-BCFI2:TRX,baseline,bcu,no,no,, -bcu_f3_x,BCU filter 3 X,Motor,X06DA-ES-BCFI3:TRX,baseline,bcu,no,no,, -bcu_f4_x,BCU filter 4 X,Motor,X06DA-ES-BCFI4:TRX,baseline,bcu,no,no,, -xrf_pos,XRF det in/out,Signal,X06DA-ES-XRF:POS-SET,baseline,se,no,yes,"{""type"":positioner}", -samcam_x,sample cam X ,SignalRO,X06DA-ES-MS:Stats5:CentroidX_RBV,baseline,scam,yes,yes,, -samcam_xsig,sample cam X sigma,SignalRO,X06DA-ES-MS:Stats5:SigmaX_RBV,monitored,scam,yes,yes,, -samcam_y,sample cam Y ,SignalRO,X06DA-ES-MS:Stats5:CentroidY_RBV,baseline,scam,yes,yes,, -samcam_ysig,sample cam Y sigma,SignalRO,X06DA-ES-MS:Stats5:SigmaY_RBV,monitored,scam,yes,yes,, -samcam_max,sample cam max value,SignalRO,X06DA-ES-MS:Stats5:MaxValue_RBV,monitored,scam,yes,yes,, -samcam_exp,sample cam exp time,Signal,X06DA-ES-MS:cam1:AcquireTime,baseline,scam,no,yes,, -samcam_gain,sample cam gain,Signal,X06DA-ES-MS:cam1:Gain,baseline,scam,no,yes,, -scam_zoom,Sample cam zoom,Motor,X06DA-ES-MS:ZOOM,baseline,scam,no,yes,, -fl_bright,Frontlight brightness,Signal,X06DA-ES-FL:SET,baseline,se,no,yes,, -coll_x,Collimator X,Motor,X06DA-ES-COL:TRX,baseline,se,no,yes,, -coll_y,Collimator Y,Motor,X06DA-ES-COL:TRY,baseline,se,no,yes,"{""type"": multi-position, ""in"": 41.5, ""out"": 20.0, ""park"": 0,""tol"":0.05}", -diag_y,Scintillator/diode Y,Motor,X06DA-ES-SCL:TRY,baseline,se,no,yes,"{""type"": multi-position, ""scint"": 38.62, ""i1"": 44.0, ""out"": 20.0,""park"": 0,""tol"":0.3}", -diag_z,Scintillator/diode Z,Motor,X06DA-ES-SCL:TRZ,baseline,se,no,yes,, -i1,i1 diode reading,SignalRO,X06DA-ES-SCLDI:READOUT,monitored,bpm,yes,yes,, -bl_pos,Backlight positioner,Signal,X06DA-ES-BL:POS-SET,baseline,se,no,yes,"{""type"":positioner}", -bl_bright,Backlight brightness,Signal,X06DA-ES-BL:SET,baseline,se,no,yes,, -bs_x,Beamstop X,Motor,X06DA-ES-BS:TRX,baseline,se,no,yes,, -bs_y,Beamstop Y,Motor,X06DA-ES-BS:TRY,baseline,se,no,yes,, -bs_z,Beamstop Z,Motor,X06DA-ES-BS:TRZ,baseline,se,no,yes,"{""type"": guarded, ""min"": 13, ""samp"": 15, ""work_min"": 20, ""safe"": 41, ""max_blin"": 42, ""max_blout"": 70}", -bs_pos,Beamstop positioner,Signal,X06DA-ES-BS:POS-SET,baseline,se,no,yes,"{""type"":positioner}", -gon_x,Goniometer X,Motor,X06DA-ES-DF1:TRX1,baseline,det,no,yes,"{""type"": guarded, ""in"": 18.0, ""out"": -10.0, ""safe"": -100,""tol"":0.5}", -gon_y,Goniometer Y,Motor,X06DA-ES-DF1:TRY1,baseline,det,no,yes,, -gon_z,Goniometer X,Motor,X06DA-ES-DF1:TRZ1,baseline,det,no,yes,, -omega,Omega,Motor,X06DA-ES-DF1:ROTU,baseline,det,no,yes,, -cryo_pos,Cryo positioner,Signal,X06DA-ES-CS:POS-SET,baseline,se,no,yes,"{""type"":positioner}", -cryo_x,Cryojet X ,Motor,X06DA-ES-CS:TRX,baseline,se,no,yes,, -det_cov,Detector cover,Signal,X06DA-ES-DETCOV:SET,baseline,det,no,yes,"{""type"":positioner}", -det_y,Detector Y,Motor,X06DA-ES-DET:TRY,baseline,det,no,yes,, -det_z,Detector Z,Motor,X06DA-ES-DET:TRZ,baseline,det,no,yes,, -gonpos,Sample sensor distance,SignalRO,X06DA-ES-DF1:CBOX-USER1,baseline,se,no,yes,, -gonvalid,Sample in valid distance,SignalRO,X06DA-ES-DF1:CBOX-CMP1,baseline,se,no,yes,, diff --git a/pxii_bec/device_configs/x10sa_device_config.yaml b/pxii_bec/device_configs/x10sa_device_config.yaml index c81c1f4..630ed00 100644 --- a/pxii_bec/device_configs/x10sa_device_config.yaml +++ b/pxii_bec/device_configs/x10sa_device_config.yaml @@ -1,5 +1,5 @@ base_config: - - !include ./pxii-devices-new.yaml + - !include ./pxii-standard-devices.yaml sample_env: - !include ./se_devices.yaml id_gap: @@ -25,3 +25,16 @@ smargon: - motors readOnly: false softwareTrigger: false + +aerotech: + description: REST-based device which connects to AareScan and Aerotech + deviceClass: pxii_bec.devices.aerotech.Aerotech + deviceConfig: {prefix: 'http://mx-x10sa-queue-01:5234'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - aerotech + - motors + readOnly: false + softwareTrigger: false diff --git a/pxii_bec/device_configs/x10sa_device_config_testing.yaml b/pxii_bec/device_configs/x10sa_device_config_testing.yaml deleted file mode 100644 index 85c6592..0000000 --- a/pxii_bec/device_configs/x10sa_device_config_testing.yaml +++ /dev/null @@ -1,99 +0,0 @@ -base_config: - - !include ./pxii-autogenerated.yaml -id_gap: - readoutPriority: baseline - description: undulator gap - deviceClass: pxii_bec.devices.undulator.UndulatorGap - deviceConfig: - prefix: 'X10SA-UIND:' - onFailure: buffer - enabled: true - readOnly: false - softwareTrigger: false -coll_x: - description: Collimator X - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-COL:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: false - softwareTrigger: false -dcm_fpitch: - description: DCM 2nd crystal fine pitch - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:PITCH-C2'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: false - softwareTrigger: false -dcm_froll: - description: DCM 2nd crystal fine roll - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:ROLL-C2'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: false - softwareTrigger: false - -bcu_xasym: - description: horizontal asymmetry - deviceClass: ophyd_devices.ComputedSignal - deviceConfig: - compute_method: "def compute_xasym(signal1, signal2, signal3, signal4):\n return (signal3.get()+signal4.get() - signal1.get()- signal2.get())/(sum((signal1.get(), signal2.get(), signal3.get(), signal4.get())))" - input_signals: - - "bcu_bpm1" - - "bcu_bpm2" - - "bcu_bpm3" - - "bcu_bpm4" - enabled: true - readOnly: false - readoutPriority: baseline - -bcu_yasym: - description: vertical asymmetry - deviceClass: ophyd_devices.ComputedSignal - deviceConfig: - compute_method: "def compute_xasym(signal1, signal2, signal3, signal4):\n return (signal1.get()+signal2.get() - signal3.get()- signal4.get())/(sum((signal1.get(), signal2.get(), signal3.get(), signal4.get())))" - input_signals: - - "bcu_bpm1" - - "bcu_bpm2" - - "bcu_bpm3" - - "bcu_bpm4" - enabled: true - readOnly: false - readoutPriority: baseline - -bcu_xpos: - description: horizontal position - deviceClass: ophyd_devices.ComputedSignal - deviceConfig: - compute_method: "def compute_xpos(signal1):\n import numpy as np\n return 0.131786+ np.arctanh((signal1.get()-0.007105) /0.99342) / 9.5597 " - input_signals: - - "bcu_xasym" - enabled: true - readOnly: false - readoutPriority: baseline - -bcu_ypos: - description: vertical position - deviceClass: ophyd_devices.ComputedSignal - deviceConfig: - compute_method: "def compute_ypos(signal1):\n import numpy as np\n return -0.20283 + np.arctanh((signal1.get()- (-0.19936)) /0.80653) / (-13.18539)" - input_signals: - - "bcu_yasym" - enabled: true - readOnly: false - readoutPriority: baseline - - - - diff --git a/pxii_bec/devices/aerotech.py b/pxii_bec/devices/aerotech.py index d465e59..9bd38b0 100644 --- a/pxii_bec/devices/aerotech.py +++ b/pxii_bec/devices/aerotech.py @@ -4,8 +4,8 @@ from .http import TIMESTAMP_ID, HttpDeviceController, HttpDeviceSignal, HttpOphy class AerotechController(HttpDeviceController): - _readback_endpoint = "status" - _target_endpoint = "position" + _readback_endpoint = "/status" + _target_endpoint = "/position" def __init__(self, *, prefix, **kwargs): self._readbacks: dict[str, dict[str, float | bool]] = {} diff --git a/pxii_bec/macros/APscripts.py b/pxii_bec/macros/APscripts.py index 90bb4b7..f8d9597 100755 --- a/pxii_bec/macros/APscripts.py +++ b/pxii_bec/macros/APscripts.py @@ -138,8 +138,9 @@ def rock(**kwargs): from lmfit.models import LinearModel, GaussianModel # LorentzianModel import matplotlib.pyplot as plt + ## create a dock area: dock_area = bec.gui.new() - wr = dock_area.new().new(bec.gui.available_widgets.Waveform) + wr = dock_area.new(gui.available_widgets.Waveform) # width of rocking curve of perfect xtal: at 20 keV: 14 urad == 0.0008 deg @@ -485,7 +486,7 @@ def fit_plot(data_x, data_y, model="gauss", ibg=1, fitrange=0, fitclick=0): #################################### -### just save data +### just SAVE DATA #################################### def save_data(hindex: int, device_name: str, signal_name: str): """ @@ -494,8 +495,8 @@ def save_data(hindex: int, device_name: str, signal_name: str): Args: history_index (int): scan to fetch, e.g. -1 for the most recent scan - device_name (str): the device for which to get the monitoring data - signal_name (str): the monitor + device_name (str): the device for which to get the monitoring data, eg, device_name='dcm_pitch' + signal_name (str): the monitor, eg, signal_name='lu_bpmsum' """ h = bec.history[hindex] @@ -591,6 +592,7 @@ def save_plot_gaps(hindex: int, device_name: str, signal_name: str): """ Get data for a completed scan from the BEC history, and plot all the results, store in a CSV file + For a certain gap size, scan through energy (Bragg angle) Args: history_index (int): scan to fetch, e.g. -1 for the most recent scan @@ -923,7 +925,7 @@ def colliscan(direction: str, range=0.3, nsteps=30, stime=0.5, centre=1): ##################### -### slitscans +### SLITSCANS ##################### def slitscan(device_location: str, direction: str, range: 1, nsteps=50, centre=0): """ @@ -1032,7 +1034,7 @@ def slitscan(device_location: str, direction: str, range: 1, nsteps=50, centre=0 return dock_area = bec.gui.new() - wr = dock_area.new().new(bec.gui.available_widgets.Waveform) + wr = dock_area.new(gui.available_widgets.Waveform) pos0 = mot.user_readback.get() siz0 = size.user_readback.get() @@ -1483,24 +1485,31 @@ def scan_eg(erange, nsteps=50, fit=True): ################################################ -### open window/doch for long gap scan +### open window/dock for long gap scan ################################################ # ### Note: all deprecated !!!! def scan_window(wname="Scan", fit=True): - dock_area = bec.gui.new() # Add a new dock with a Waveform to the BECDockArea nam = "waveform_dock_"+wname - dock_area.new(name=nam, widget="Waveform") - # dock_area.panels - # dock_area.panel_list - plt1 = dock_area.panels[nam] + dock_area = bec.gui.new(name=wname, geometry = [4000, 900, 700, 700]) + + w1 = dock_area.new(gui.available_widgets.Waveform) # CALL gui.available_widgets to see what is available + w2 = dock_area.new(gui.available_widgets.ScanControl) + # Add signals to the WaveformWidget - plt1.plot(device_x='id_gap', device_y='bpm') + w1.plot(device_x = dev.id_gap, device_y = dev.lu_bpmsum) + + ###w1.plot(device_x='id_gap', device_y='bpm') + ###dock2 = dock_area.new(name="motor_dock", widget="MotorMap",relative_to=nam, position="right") - dock2 = dock_area.new(name="motor_dock", widget="MotorMap",relative_to=nam, position="right") ###do stuff + gstart = 4.5 + gend = 5.0 + resol = 0.003 # 3 um resol for gap scan + nsteps = round(gend-gstart)/resol + s = scans.line_scan(dev.id_gap, gstart, gend, steps = nsteps, exp_time = 0.1, relative = False) ### if done, remove - dock2.remove() + #w2.remove() diff --git a/pxii_bec/macros/Undu_Helpers.py b/pxii_bec/macros/Undu_Helpers.py index 7552782..12c5ead 100755 --- a/pxii_bec/macros/Undu_Helpers.py +++ b/pxii_bec/macros/Undu_Helpers.py @@ -178,11 +178,12 @@ def setu19(en, *harm_no, detune=0): def harmon_walk(estart=7.5, end_en=13): import time + harmon = 5 en = estart ans = "y" while en < end_en + 0.5 and ans == "y": print(en) - setu19(en, 5) + setu19(en, harmon) time.sleep(2) sete(en) en = en + 0.5 @@ -209,6 +210,9 @@ def gap_harm(e=12.4): ################################## +# use with estart = 6, end_en = 30.5 + +# test with estart = 6, end_en = 7.5 # should be 3 files , estimated time: 90 min def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500): import time @@ -216,13 +220,15 @@ def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500): dirname = "/sls/x10sa/config/commissioning/Data/" + enstep = 0.5 + print( - f"scanning the U19 gap from {estart} keV to {end_en} keV, for a gapsize from {g_low} to {g_high}" + f"scanning the U19 gap from {estart} keV to {end_en} keV, for a gapsize from {g_low} to {g_high} in {enstep} keV energy intervals" ) resol = (g_high - g_low) / nsteps print(f"nsteps = {nsteps}; resolution is {resol} mm") dock_area = bec.gui.new("LongGapScan") - wr = dock_area.new().new(bec.gui.available_widgets.Waveform) + wr = dock_area.new(gui.available_widgets.Waveform) mot = dev.id_gap det = dev.lu_bpmsum wr.plot(x_name=mot.name, y_name=det.name) ## names first ! @@ -237,12 +243,17 @@ def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500): ## now: probably do from 5 keV to ?? 30 keV ??? + tstart = time.perf_counter() # time logging + en = estart while en < end_en: - sete(en) - time.sleep(0.2) - rock() + #sete(en) + #time.sleep(0.2) + #rock() + # maybe use + bl_energy(en, move_gap = False, plot = False) + print(f"setting energy to {en}") time.sleep(0.2) ds = scans.line_scan(dev.id_gap, g_low, g_high, steps=nsteps, exp_time=0.1, relative=False) @@ -255,7 +266,28 @@ def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500): with open(filename, "w") as f: np.savetxt(f, combined, delimiter=",", fmt="%5f") - en += 1 + en += enstep + + # SNAKING ### + bl_energy(en, move_gap = False, plot = False) + + print(f"setting energy to {en}") + time.sleep(0.2) + ds = scans.line_scan(dev.id_gap, g_high, g_low, steps=nsteps, exp_time=0.1, relative=False) + gap_data = ds.scan.live_data.id_gap.id_gap.val + bpm_data = ds.scan.live_data.lu_bpmsum.lu_bpmsum.val + wr.plot(x=gap_data, y=bpm_data) + # writing output to simple data file for later analysis: + combined = np.column_stack((gap_data, bpm_data)) + filename = dirname + "gaps" + str(en) + ".txt" + with open(filename, "w") as f: + np.savetxt(f, combined, delimiter=",", fmt="%5f") + + en += enstep + + elapsed_time = time.perf_counter()-tstart + print(f"Runtime: {elapsed_time: .6f} seconds, i.e., {elapsed_time: .6f}/60 min") + return @@ -273,7 +305,7 @@ def gscan(centre=0, gomax=0, detune=0): import time dock_area = bec.gui.new() - wr = dock_area.new().new(bec.gui.available_widgets.Waveform) + wr = dock_area.new(gui.available_widgets.Waveform) mot = dev.id_gap det = dev.lu_bpmsum wr.plot(x_name=mot.name, y_name=det.name) ## names first ! diff --git a/pxii_bec/macros/planner.py b/pxii_bec/macros/beamline_planner.py old mode 100644 new mode 100755 similarity index 57% rename from pxii_bec/macros/planner.py rename to pxii_bec/macros/beamline_planner.py index b976571..217d589 --- a/pxii_bec/macros/planner.py +++ b/pxii_bec/macros/beamline_planner.py @@ -1,10 +1,13 @@ -"""Planner to move between beamline states""" -from enum import Enum -import yaml -from collections import defaultdict, deque +"""Planner to move between beamline statesΩ""" +import time +from collections import defaultdict, deque +from enum import Enum +# from enums import BeamlineState, TemperatureMode +# from matcher import DeviceMatcher, nonzero_is_on class BeamlineState(str, Enum): + """List of beamline states""" ROBOT_SAMPLE_EXCHANGE = "robot_sample_exchange" SAMPLE_ALIGNMENT = "sample_alignment" DATA_COLLECTION = "data_collection" @@ -16,47 +19,24 @@ class BeamlineState(str, Enum): MAINTENANCE = "maintenance" XTAL_SNAPSHOT = "xtal_snapshot" + class TemperatureMode(str, Enum): + """List of temperature modes""" CRYO = "cryo" ROOM_TEMP = "room_temp" -def get_states(): - """Returns the states defined in beamline_states.yaml""" - directory = "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/" - # directory = "./" - filename = "beamline_states.yaml" - file = directory + filename - with open(file, "r", encoding="utf-8") as f: - cfg = yaml.safe_load(f) - states = {} - allow_modifiers = {} - for name, config in cfg["states"].items(): - state = BeamlineState(name) - - allow_modifiers[state] = config.pop("allow_modifiers", False) - - states[state] = config - - return states, allow_modifiers - - # cfg = yaml.safe_load(f) - # return { - # BeamlineState(name): config - # for name, config in cfg["states"].items() - # } - - -class StateManager: +class StateChangePlanner: """Moves devices to the correct positions to achieve a given state""" - def __init__(self, - devices, - states: dict[BeamlineState, dict[str, str]], - allow_modifiers=None, - deps=None, - debug=False, - ): + def __init__( + self, + devices, + states: dict[BeamlineState, dict[str, str]], + allow_modifiers=None, + deps=None, + debug=False, + ): self.devices = devices self.states = states self.allow_modifiers = allow_modifiers or {} @@ -79,6 +59,7 @@ class StateManager: target.update(self.modifiers[modifier]) return target + def move_to(self, state_name, modifier=None): """Move devices to the correct positions to achieve a given state""" if isinstance(state_name, str): @@ -109,18 +90,6 @@ class StateManager: print("States at failure:", self.get_positions()) raise - # if self.debug: - # print(" After :", self.get_states()) - # if not d.is_at(pos): - # d.move(pos) - - # def reset(self, state): - # """Reset all devices to the given state""" - # if isinstance(state, str): - # state = BeamlineState(state) - # for dev, pos in self.states[state].items(): - # self.devices[dev].set_pos(pos) - def available_states(self): """Return a list of available states""" return list(self.states.keys()) @@ -132,7 +101,7 @@ class StateManager: def print_positions(self): """Return current state of all devices""" for name, device in self.devices.items(): - print(f"{name:10s} : {device.pos}") + print(f"{name:10s} : {device.pos:10s} value: {device.actual}") def diff_states(self, before): """Return a dict of {device: (before, after)} pairs for devices that changed state""" @@ -164,8 +133,6 @@ class StateManager: return matches if matches else None - - def is_state(self, state, modifier=None): """Check if the current state matches the given state and modifier.""" actual = self.current_state() @@ -180,65 +147,33 @@ class StateManager: def _plan(self, target): - graph = defaultdict(set) - indeg = defaultdict(int) - nodes = set() + graph = defaultdict(set) + indeg = defaultdict(int) + nodes = set() - for dev, pos in target.items(): - node = (dev, pos) - nodes.add(node) + for dev, pos in target.items(): + node = (dev, pos) + nodes.add(node) - for dep in self.deps.get(node, []): - graph[dep].add(node) - indeg[node] += 1 - nodes.add(dep) + for dep in self.deps.get(node, []): + graph[dep].add(node) + indeg[node] += 1 + nodes.add(dep) - q = deque(n for n in nodes if indeg[n] == 0) - stages = [] + q = deque(n for n in nodes if indeg[n] == 0) + stages = [] - while q: - stage = list(q) - stages.append(stage) - q.clear() - - for n in stage: - for m in graph[n]: - indeg[m] -= 1 - if indeg[m] == 0: - q.append(m) - - if sum(len(s) for s in stages) != len(nodes): - raise RuntimeError("Circular dependency in state dependencies") - return stages - - -def planner_deps(): - """Define the dependencies between beamline positions""" - return { - ("bs_z", "samp"): [ - ("gon_x", "out"), - ("diag_y", "out"), - ("coll_y", "out"), - ], - ("gon_x", "in"): [ - ("diag_y", "out"), - ("bs_z", "safe"), - ], - ("diag_y", "scint"): [ - ("gon_x", "out"), - ("cryo_pos", "out") - ], - ("diag_y", "i1"): [ - ("gon_x", "out"), - ("cryo_pos", "out")], - ("bs_pos", "out"): [("bs_z", "safe")], - ("bs_pos", "in"): [("bs_z", "safe")], - ("diag_y", "out"): [("bs_z", "safe")], - ("diag_y", "park"): [("bs_z", "safe")], - ("coll_y", "out"): [("bs_z", "safe")], - ("coll_y", "park"): [("bs_z", "safe")], - ("coll_y", "in"): [("bs_z", "safe")], - ("coll_y", "intermediate"): [("bs_z", "safe")] - } + while q: + stage = list(q) + stages.append(stage) + q.clear() + for n in stage: + for m in graph[n]: + indeg[m] -= 1 + if indeg[m] == 0: + q.append(m) + if sum(len(s) for s in stages) != len(nodes): + raise RuntimeError("Circular dependency in state dependencies") + return stages diff --git a/pxii_bec/macros/beamline_state_manager.py b/pxii_bec/macros/beamline_state_manager.py new file mode 100755 index 0000000..e2de14a --- /dev/null +++ b/pxii_bec/macros/beamline_state_manager.py @@ -0,0 +1,21 @@ +# from enums import BeamlineState +import yaml + + +class DefineStatesManager: + @staticmethod + def initialize_states(states_file): + """ + Returns the states and modifiers defined in the specified states file. + """ + with open(states_file, "r", encoding="utf-8") as f: + cfg = yaml.safe_load(f) + states = {} + allow_modifiers = {} + + for name, config in cfg["states"].items(): + state = BeamlineState(name) + allow_modifiers[state] = config.pop("allow_modifiers", False) + states[state] = config + + return states, allow_modifiers diff --git a/pxii_bec/macros/build_devices.py b/pxii_bec/macros/build_devices.py new file mode 100755 index 0000000..3c8dd2e --- /dev/null +++ b/pxii_bec/macros/build_devices.py @@ -0,0 +1,70 @@ +""" Build the sample environment devices""" +import yaml + +# from position_device import PositionDevice + +def motor_resolver(bec_name): + + candidates = [ + bec_name, + bec_name.replace("_", "."), + ] + + for path in candidates: + try: + obj = dev + + for part in path.split("."): + obj = getattr(obj, part) + + return obj + + except Exception: + pass + + raise ValueError(f"Cannot resolve motor for '{bec_name}'") + +def build_devices(yaml_file, mock_devices): + """ Build devices from the beamline states yaml""" + + + state_devices = {} + + with open(yaml_file, encoding="utf-8") as f: + data = yaml.safe_load(f) + + for bec_name, cfg in data.items(): + + user = cfg.get("userParameter") + + # Skip devices without user parameters + if not user: + continue + + + tol = user.get("tol", 0.1) + + positions = { + k: v for k, v in user.items() + if k not in ("type", "tol") + } + + allow_arbitrary = (user["type"] == "continuous") + + + + pos_dev = PositionDevice( + bec_name=bec_name, + mot_device = motor_resolver(bec_name), + positions=positions, + tol=tol, + allow_arbitrary=allow_arbitrary, + use_mock=bec_name in mock_devices, + ) + + state_devices[bec_name] = pos_dev + return state_devices + + + + diff --git a/pxii_bec/macros/check.py b/pxii_bec/macros/check.py old mode 100644 new mode 100755 index 2b5c993..b5975f3 --- a/pxii_bec/macros/check.py +++ b/pxii_bec/macros/check.py @@ -1,6 +1,7 @@ from dataclasses import dataclass, field from enum import Enum from typing import Any, Callable +from datetime import datetime from bec_lib.device import Signal, Positioner @@ -24,6 +25,15 @@ class Status(Enum): Status.ERROR: "red", Status.UNKNOWN: "blue", }[self] + + @property + def color_scilog(self): + return { + Status.OK: "green", + Status.WARNING: "", + Status.ERROR: "red", + Status.UNKNOWN: "", + }[self] # ------------------------------------------------------------------- @@ -58,7 +68,6 @@ class HealthCheckResult: if self.status == Status.OK: return f"[{self.status.name} {self.name}]" - return ( f"[{self.status.name}] " f"{self.description}: {self.message}" @@ -70,15 +79,39 @@ class HealthCheckResult: def send_to_scilog(results): + counts = { + Status.OK: 0, + Status.WARNING: 0, + Status.ERROR: 0, + Status.UNKNOWN: 0, + } + + for result in results: + counts[result.status] += 1 + + msg = bec.messaging.scilog.new() + msg.add_text( + "Beamline Health Summary", + bold = True + ) + + msg.add_text("\n") + for status, count in counts.items(): + msg.add_text( + f"{status.name:<10}: {count}", + bold=True, + ) + + msg.add_text("\n") + for result in results: msg.add_text( result.formatted_message(), # bold=result.status != Status.OK, - color = result.status.color + color = result.status.color_scilog ) - # msg.add_text(result.formatted_message()) msg.add_text("\n") msg.add_tags(["beamline health check"]) msg.send() @@ -200,7 +233,7 @@ def check_signals(devices, config: BeamlineHealthConfig): description=description, status=Status.ERROR, value=actual, - message=f"Signal value {actual} failed validation", + message=f"Signal value = {actual}, failed validation", category="signals", ) ) @@ -220,6 +253,7 @@ def check_signals(devices, config: BeamlineHealthConfig): def check_motors(devices, config: BeamlineHealthConfig): results = [] + ignore = ["id_gap", "smargon"] motor_devices = [ (name, obj) @@ -229,6 +263,9 @@ def check_motors(devices, config: BeamlineHealthConfig): for name, obj in motor_devices: + if name in ignore: + continue + try: data = obj.read() @@ -352,7 +389,26 @@ def check_motors(devices, config: BeamlineHealthConfig): ) return results - +# ------------------------------------------------------------------- +# General Info +# ------------------------------------------------------------------- +def info(): + current = dev.sls_current.get() + gap = dev.id_gap.position + energy = get_current_energy() + # state = get_state() + print(f"[INFO] Machine: {current:.4g} mA\n" + f"[INFO] Undulator gap: {gap:.4g}\n" + f"[INFO] Beamline energy: {energy:.6g} eV\n") + # f"[INFO] Beamline state: {state}") + + +# def get_state(): +# states = [] +# res = planner.current_state() +# for state in res: +# states.append(state[0]) +# return list(set(states)) # ------------------------------------------------------------------- # Main Check Entry Point @@ -387,7 +443,10 @@ def check2(config: BeamlineHealthConfig | None = None): # ------------------------------------------------------------------- -def print_summary(results): +def summary_text(results): + + timestamp = datetime.now().strftime("%Y-%m-%d %H:%M") + n_ok = sum(r.status == Status.OK for r in results) @@ -397,14 +456,18 @@ def print_summary(results): n_unknown = sum(r.status == Status.UNKNOWN for r in results) - print("\n==============================") - print(" Beamline Health Summary") - print("==============================") - print(f"OK : {n_ok}") - print(f"WARNING : {n_warn}") - print(f"ERROR : {n_err}") - print(f"UNKNOWN : {n_unknown}") - print("==============================\n") + return ( + f"==========================================\n" + f"Beamline Health Check at {timestamp}\n" + f"==========================================\n" + f"OK : {n_ok}\n" + f"WARNING : {n_warn}\n" + f"ERROR : {n_err}\n" + f"UNKNOWN : {n_unknown}\n" + "==========================================\n" + ) + # return "\n".join(lines) + # ------------------------------------------------------------------- # Filter results @@ -423,11 +486,14 @@ def filter_results(results, statuses = None): # ------------------------------------------------------------------- -def run_check(show_all= False): +def run_check(show_all= False, scilog=False): + results = check2() - print_summary(results) + print(summary_text(results)) + + info() problem_results = filter_results( results, @@ -437,7 +503,8 @@ def run_check(show_all= False): Status.UNKNOWN, } ) - # send_to_scilog(problem_results) + if scilog: + send_to_scilog(problem_results) if not show_all: results = filter_results( @@ -450,6 +517,14 @@ def run_check(show_all= False): ) for result in results: print(result) + + disclaimer = "\n======================================================\n" \ + "This reports: \n 1. If motors are in error state, if moving, or if readback != setpoint" \ + "\n 2. If camera or BPMs are reading 0 (may or may not be an error)" \ + "\nN.B. The motor checks are only done if they exist as standard ophyd motors in BEC." \ + "\nTo see which devices were checked use run_check(show_all=True)." + + print(disclaimer) diff --git a/pxii_bec/macros/config.py b/pxii_bec/macros/config.py deleted file mode 100644 index 1d07498..0000000 --- a/pxii_bec/macros/config.py +++ /dev/null @@ -1,24 +0,0 @@ -""" "Initialises the sample environment devices, guards, -dependencies and planner""" - -# import yaml -# from devices import build_devices -# from guards import attach_guards -# from policies import attach_policies - - -def init_se_devices(): - """Initialises the sample environment devices""" - directory = "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/" - # directory = "./" - filename = "se_devices.yaml" - file = directory + filename - print(f"Loading devices from {file}") - se_devices = build_devices(file) - attach_guards(se_devices) - attach_policies(se_devices) - - return se_devices - - - diff --git a/pxii_bec/macros/dependencies.py b/pxii_bec/macros/dependencies.py new file mode 100755 index 0000000..f83296c --- /dev/null +++ b/pxii_bec/macros/dependencies.py @@ -0,0 +1,36 @@ +"""Planner dependencies""" +def planner_deps(): + """Define the dependencies between beamline positions""" + return { + ("bs_z", "samp"): [ + ("aerotech_x", "out"), + ("diag_y", "out"), + ("coll_y", "out"), + ], + ("aerotech_x", "in"): [ + ("diag_y", "out"), + ("bs_z", "safe"), + ], + ("aerotech_x", "out"): [ + ("diag_y", "out"), + ("bs_z", "safe"), + ], + ("diag_y", "scint"): [ + ("aerotech_x", "out"), + ("bs_z", "safe"), + ("cryo_pos", "out"), + ], + ("diag_y", "i1"): [ + ("aerotech_x", "out"), + ("bs_z", "safe"), + ("cryo_pos", "out"), + ], + ("bs_pos", "out"): [("bs_z", "safe")], + ("bs_pos", "in"): [("bs_z", "safe")], + ("diag_y", "out"): [("bs_z", "safe")], + ("diag_y", "park"): [("bs_z", "safe")], + ("coll_y", "out"): [("bs_z", "safe")], + ("coll_y", "park"): [("bs_z", "safe")], + ("coll_y", "in"): [("bs_z", "safe")], + ("coll_y", "intermediate"): [("bs_z", "safe")], + } diff --git a/pxii_bec/macros/devices.py b/pxii_bec/macros/devices.py deleted file mode 100644 index 7956976..0000000 --- a/pxii_bec/macros/devices.py +++ /dev/null @@ -1,167 +0,0 @@ -"""Set up the positioned devices""" - -from dataclasses import dataclass, field -from typing import Callable, List, Dict, Optional, Union - -import yaml - - -@dataclass -class PositionDevice: - """Generic device that moves between named or numeric positions""" - - bec_name: str - positions: Dict[str, float] = field(default_factory=dict) - tol: float = 0.1 - - guards: List[Callable[[], None]] = field(default_factory=list) - policy: Optional[Callable[[float], None]] = None - - # line below defines if the device is permitted to move to any arbitrary position or not - allow_arbitrary: bool = False - - def __post_init__(self): - # Use this for BEC - self.mot = getattr(dev, self.bec_name) - - # Use this for testing - # self.mot = self.MockMotor() - - # Normalize position names - self.positions = {k.lower(): v for k, v in self.positions.items()} - - # ------------------------- - # internal helpers - # ------------------------- - - def _check_guards(self): - for g in self.guards: - g() - - def _resolve_target(self, target: Union[str, float]) -> float: - """Convert target into a motor position""" - - if isinstance(target, str): - name = target.lower() - - if name not in self.positions: - raise ValueError(f"Unknown position '{target}'") - - return self.positions[name] - - if isinstance(target, (float, int)): - if not self.allow_arbitrary: - raise ValueError(f"{self.bec_name} only accepts named positions") - return float(target) - - raise TypeError("Target must be str or float") - - # ------------------------- - # motion - # ------------------------- - - def move(self, target: Union[str, float]): - """Unified move interface""" - - pos = self._resolve_target(target) - - self._check_guards() - - if self.policy: - self.policy(pos) - - # Use for testing - # self.mot.move(pos) - - # Use in BEC - scans.umv(self.mot, pos, relative=False) - # s = scans.mv(self.mot, pos, relative=False) - # s.wait(timeout=5) - - # def set_position(self, target: Union[str, float]): - # """Only to be used for testing purposes""" - # pos = self._resolve_target(target) - # self.mot.move(pos) - - # ------------------------- - # readback - # ------------------------- - - @property - def actual(self) -> float: - """Return the actual position of the device.""" - return self.mot.read()[self.bec_name]["value"] - # return self.mot.position - - @property - def pos(self) -> str: - """Return the closest matching position""" - - for name, pos in self.positions.items(): - if abs(self.actual - pos) <= self.tol: - return name - - return "unknown" - - def is_at(self, position: str) -> bool: - """Return True if the device is at the given position.""" - position = position.lower() - - if position not in self.positions: - raise ValueError(f"Unknown position '{position}'") - - return abs(self.actual - self.positions[position]) <= self.tol - - # ------------------------- - # Mock Motor Implementation - # ------------------------- - - class MockMotor: - """Mock implementation of MotorLike for testing and initialization.""" - - def __init__(self): - self.position = 0.0 - - def move(self, value: float): - """Move the motor to the given position.""" - self.position = value - - def read(self): - """Read the current position of the motor.""" - return {"value": self.position} - - -def build_devices(yaml_file): - """Takes the defined positions from the device yaml file - and adds them to the PositionDevice class. - """ - # discrete_devs = [] - # continuous_devs = [] - se_devices = {} - - with open(yaml_file, encoding="utf-8") as f: - data = yaml.safe_load(f) - - for bec_name, cfg in data.items(): - # Skip devices without userParameter - user = cfg.get("userParameter") - - if not user: - continue - - tol = user.get("tol", 0.1) - - positions = {k: v for k, v in user.items() if k not in ("type", "tol")} - - if user["type"] == "discrete": - dev = PositionDevice(bec_name, positions, tol=tol, allow_arbitrary=False) - # discrete_devs.append(bec_name) - se_devices[bec_name] = dev - elif user["type"] == "continuous": - dev = PositionDevice(bec_name, positions, tol=tol, allow_arbitrary=True) - # continuous_devs.append(bec_name) - se_devices[bec_name] = dev - - # print(f"Discrete devices: {discrete_devs}") - # print(f"Continuous: {continuous_devs}") - return se_devices diff --git a/pxii_bec/macros/devices_manager.py b/pxii_bec/macros/devices_manager.py new file mode 100755 index 0000000..64b5ab3 --- /dev/null +++ b/pxii_bec/macros/devices_manager.py @@ -0,0 +1,22 @@ +""" +This module manages the initialization of devices.""" + +# from guards import attach_guards +# from policies import attach_policies +# from build_devices import build_devices + + +class DeviceManager: + """Class for building devices and attaching safety guards and policies.""" + + @staticmethod + def initialize_devices(state_devices_file, rest_devices_file, mock_devices): + """ + Initializes sample environment devices from the specified file. + """ + devices = build_devices(state_devices_file, mock_devices) + rest_devices = build_devices(rest_devices_file, mock_devices) + devices.update(rest_devices) + attach_guards(devices) + attach_policies(devices) + return devices diff --git a/pxii_bec/macros/findattr.py b/pxii_bec/macros/findattr.py old mode 100644 new mode 100755 diff --git a/pxii_bec/macros/guards.py b/pxii_bec/macros/guards.py old mode 100644 new mode 100755 index 42799d2..0446e61 --- a/pxii_bec/macros/guards.py +++ b/pxii_bec/macros/guards.py @@ -73,9 +73,9 @@ def guards_setup(d): ) guards["bs_pos_in"] = AtPositionGuard(d["bs_pos"], position="in") guards["gonx_out"] = MinMaxGuard( - d["gon_x"], direction="less_than", limit_value=d["gon_x"].positions["out"] + d["aerotech_x"], direction="less_than", limit_value=d["aerotech_x"].positions["out"] ) - guards["gonx_safe"] = AtPositionGuard(d["gon_x"], position="safe") + guards["gonx_safe"] = AtPositionGuard(d["aerotech_x"], position="safe") guards["diag_y_out"] = MinMaxGuard( d["diag_y"], direction="less_than", limit_value=d["diag_y"].positions["out"] ) diff --git a/pxii_bec/macros/init_beamline.py b/pxii_bec/macros/init_beamline.py new file mode 100755 index 0000000..6c3eb80 --- /dev/null +++ b/pxii_bec/macros/init_beamline.py @@ -0,0 +1,163 @@ +"""Initialise sample environment devices and beamline states""" + +import os +from dataclasses import dataclass + +# from devices_manager import DeviceManager +# from beamline_state_manager import DefineStatesManager +# from dependencies import planner_deps +# from beamline_planner import StateChangePlanner + +@dataclass +class Environment: + + device_mocks: dict[str, bool] = None + beamline: str = None + + beamline_configs = { + # "x06sa" : { + # "devdir": "/sls/x10sa/config/bec/production/pxi_bec/pxi_bec/device_configs/", + # "state": "pxi-state-devices.yaml", + # "rest": "pxi-rest-devices.yaml", + # "states": "pxi-beamline-states.yaml", + # }, + "x10sa" : { + "devdir": "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/", + "state": "pxii-state-devices.yaml", + "rest": "pxii-rest-devices.yaml", + "states": "pxii-beamline-states.yaml", + }, + "x06da" : { + "devdir": "/sls/x06da/config/bec/production/pxiii_bec/pxiii_bec/device_configs/", + "state": "pxiii-state-devices.yaml", + "rest": "pxiii-rest-devices.yaml", + "states": "pxiii-beamline-states.yaml", + } + } + + def __post_init__(self): + + if self.device_mocks is None: + self.device_mocks = { + "aerotech_x": "real", + "aerotech_y": "real", + "aerotech_z": "real", + "aerotech_u": "real", + "bl_bright": "real", + "bl_pos": "real", + "bs_pos": "real", + "bs_z": "real", + "coll_y": "real", + "cryo_pos": "real", + "det_cov": "real", + "diag_y": "real", + "fl_bright": "real", + "smargon_x": "real", + "smargon_y": "real", + "smargon_z": "real", + "smargon_chi": "real", + "smargon_phi": "real", + "xrf_pos": "mock", + } + + mocks = sorted( + name + for name, backend in self.device_mocks.items() + if backend == "mock" + ) + + reals = sorted( + name + for name, backend in self.device_mocks.items() + if backend == "real" + ) + + print(f"Mock devices ({len(mocks)}): {mocks}") + print(f"Real devices ({len(reals)}): {reals}") + + try: + cfg = self.beamline_configs[self.beamline] + except KeyError: + raise ValueError( + f"Unknown beamline '{self.beamline}'" + ) + + devdir = cfg["devdir"] + + self.state_devices_file = devdir + cfg["state"] + self.rest_devices_file = devdir + cfg["rest"] + self.states_file = devdir + cfg["states"] + + mock_start_positions = { + "aerotech_x": "in", + "aerotech_y": "mount", + "aerotech_z": "mount", + "aerotech_u": "mount", + "bl_bright": "off", + "bl_pos": "out", + "bs_pos": "out", + "bs_z": "safe", + "coll_y": "park", + "cryo_pos": "in", + "det_cov": "close", + "diag_y": "park", + "fl_bright": "off", + "smargon_x": "mount", + "smargon_y": "mount", + "smargon_z": "mount", + "smargon_chi": "mount", + "smargon_phi": "mount", + "xrf_pos": "out", + } + + @property + def mock_devices(self): + mock_names = set() + for name, device in self.device_mocks.items(): + if device == "mock": + mock_names.add(name) + return mock_names + +def init_beamline_environment(): + """ + Initializes the beamline with real or mock devices. + """ + + beamline = os.environ["BEAMLINE"] + + env = Environment(beamline = beamline) + + # Initialize devices + device_manager = DeviceManager() + devices = device_manager.initialize_devices( + env.state_devices_file, + env.rest_devices_file, + env.mock_devices + ) + + # Initialize states + state_manager = DefineStatesManager() + states, allow_modifiers = state_manager.initialize_states(env.states_file) + + # Setup dependencies + deps = planner_deps() + + # Setup planner + planner = StateChangePlanner(devices, states, allow_modifiers, deps) + print("Initializing beamline state planner") + + # Set mock motor starting positions + + for mock_dev, pos in env.mock_start_positions.items(): + if mock_dev in env.mock_devices: + try: + devices[mock_dev].set_position(pos) + except Exception as e: + print(f"{e} error when setting {mock_dev}") + + + return devices, planner + + + + diff --git a/pxii_bec/macros/policies.py b/pxii_bec/macros/policies.py old mode 100644 new mode 100755 index 34f7790..576edae --- a/pxii_bec/macros/policies.py +++ b/pxii_bec/macros/policies.py @@ -1,9 +1,10 @@ -'''Define guard policies for devices in the beamline.''' +"""Define guard policies for devices in the beamline.""" + # from guards import GuardViolation, guards_setup def is_sample_area_clear_for_beamstop(d): - '''Check if the sample area is clear of diag_y, coll_y, and gonx''' + """Check if the sample area is clear of diag_y, coll_y, and gonx""" g = guards_setup(d) if g["diag_y_out"].check() and g["coll_y_out"].check() and g["gonx_out"].check(): return True @@ -11,25 +12,27 @@ def is_sample_area_clear_for_beamstop(d): def is_sample_area_clear_for_gonx(d): - '''Check if the sample area is clear of diag_y and bs_z''' + """Check if the sample area is clear of diag_y and bs_z""" g = guards_setup(d) if g["diag_y_out"].check() and g["bs_work_min"].check(): return True return False -def make_gon_x_policy(d): - '''Create the policy for gon_x''' - def gon_x_policy(target): - cfg = d["gon_x"].positions +def make_aerotech_x_policy(d): + """Create the policy for aerotech_x""" + + def aerotech_x_policy(target): + cfg = d["aerotech_x"].positions if target >= cfg["out"] and not is_sample_area_clear_for_gonx(d): raise GuardViolation("Sample area is not clear") - return gon_x_policy + return aerotech_x_policy def make_bs_z_policy(d): - '''Create the policy for bs_z''' + """Create the policy for bs_z""" + def bs_z_policy(target): """Checks that the target position is within limits""" cfg = d["bs_z"].positions @@ -50,24 +53,25 @@ def make_bs_z_policy(d): def make_diag_y_policy(d): - '''Create the policy for diag_y''' + """Create the policy for diag_y""" + def diag_y_policy(target): cfg = d["diag_y"].positions - # Don't move in if the goniometer is >= 'in' - if d["gon_x"].actual >= d["gon_x"].positions["in"] and target > cfg['out']: + # Don't move in if the goniometer is in + if d["aerotech_x"].actual >= d['aerotech_x'].positions['in'] and target > cfg["out"]: raise GuardViolation( f"Diagnostic device cannot move beyond {cfg['out']} mm when goniometer is not OUT" ) - if d['cryo_pos'].pos == "in" and target > cfg["out"]: + # Don't move if cryocooler is in + if d['cryo_pos'].pos == 'in' and target > cfg['out']: raise GuardViolation( - f"Diagnostic device cannot move beyond {cfg['out']} mm when cryo is IN" + f"Diagnostic device cannot move beyond {cfg['out']} mm when cryocooler is IN" ) - return diag_y_policy def attach_policies(d): - '''Attach the policies to the devices''' + """Attach the policies to the devices""" d["bs_z"].policy = make_bs_z_policy(d) - d["gon_x"].policy = make_gon_x_policy(d) + d["aerotech_x"].policy = make_aerotech_x_policy(d) d["diag_y"].policy = make_diag_y_policy(d) diff --git a/pxii_bec/macros/position_device.py b/pxii_bec/macros/position_device.py new file mode 100755 index 0000000..f6f7589 --- /dev/null +++ b/pxii_bec/macros/position_device.py @@ -0,0 +1,254 @@ +"""Set up the positioned devices for mock or real motors""" + +from dataclasses import dataclass, field +from typing import Callable, List, Dict, Optional, Union + +import time + + +class SimpleStatus: + """Makes a mock motor return a status""" + + def __init__(self, motor, target, delay=0.0, success=True, name=""): + self.motor = motor + self.target = target + self.delay = delay + self._success = success + self.name = name + self._done = False + + def wait(self, timeout=None): + start = time.time() + + while True: + # simulate motion completion + if not self._done: + if time.time() - start >= self.delay: + if self._success: + self.motor.position = self.target + self._done = True + + if self._done: + if not self._success: + raise RuntimeError(f"Motor {self.name} failed") + return True + + if timeout is not None and (time.time() - start) > timeout: + raise TimeoutError(f"Timeout waiting for {self.name}") + + time.sleep(0.01) + + +class MotorAdapter: + """Motor adapter for setting up mock/real motors""" + + def move(self, pos: float): + """Move the motor to the given position""" + raise NotImplementedError + + def move_with_status(self, pos: float): + """Move the motor to the given position with a status""" + raise NotImplementedError + + def set_fail(self, value: bool): + """Put the motor into a failure state""" + raise NotImplementedError + + @property + def actual(self) -> float: + """The actual position of the motor""" + raise NotImplementedError + + +class MockMotorAdapter(MotorAdapter): + """Motor adapter for mock motors""" + + def __init__(self, name: str): + self._motor = PositionDevice.MockMotor(name) + + def move(self, pos: float): + """Move the motor to the given position""" + self._motor.move(pos) + + def move_with_status(self, pos: float): + """Move the motor to the given position with a status""" + if self._motor.fail: + return SimpleStatus( + motor=self._motor, + target=pos, + delay=self._motor.delay, + success=False, + name=self._motor.name, + ) + + # don't update position immediately + return SimpleStatus( + motor=self._motor, + target=pos, + delay=self._motor.delay, + success=True, + name=self._motor.name, + ) + + def set_fail(self, value: bool): + """Put the motor into a failure state""" + self._motor.fail = value + + def set_delay(self, value: float): + self._motor.delay = value + + @property + def actual(self) -> float: + """The actual position of the motor""" + return self._motor.position + + +class RealMotorAdapter(MotorAdapter): + """Motor adapter for real motors""" + + def __init__(self, mot, name): + self._motor = mot + self._name = name + + def move(self, pos: float): + """Move the motor to the given position""" + scans.umv(self._motor, pos, relative=False) + + def move_with_status(self, pos: float): + """Move the motor to the given position with a status""" + return scans.mv(self._motor, pos, relative=False) + # scans.mv(self._motor, pos, relative=False) + + def set_fail(self, value: bool): + """Put the motor into a failure state""" + raise NotImplementedError + + @property + def actual(self) -> float: + """The actual position of the motor""" + return self._motor.read()[self._name]["value"] + + +@dataclass +class PositionDevice: + """Generic device that moves between named or numeric positions""" + + bec_name: str + mot_device: any = None + positions: Dict[str, float] = field(default_factory=dict) + tol: float = 0.1 + # device_timeout = 3 + guards: List[Callable[[], None]] = field(default_factory=list) + policy: Optional[Callable[[float], None]] = None + allow_arbitrary: bool = False + use_mock: bool = True + + def __post_init__(self): + if self.use_mock: + self.mot = MockMotorAdapter(self.bec_name) + else: + self.mot = RealMotorAdapter(self.mot_device, self.bec_name) + # self.mot = getattr(dev, self.bec_name) + + # Normalize position names + self.positions = {k.lower(): v for k, v in self.positions.items()} + + def _check_guards(self): + """Check if guards exist""" + for g in self.guards: + g() + + def _resolve_target(self, target: Union[str, float]) -> float: + """Convert target into a motor position""" + + if isinstance(target, str): + name = target.lower() + + if name not in self.positions: + raise ValueError(f"Unknown position '{target}'") + + return self.positions[name] + + if isinstance(target, (float, int)): + if not self.allow_arbitrary: + raise ValueError(f"{self.bec_name} only accepts named positions") + return float(target) + + raise TypeError("Target must be str or float") + + def move(self, target: Union[str, float]): + """Move devices""" + pos = self._resolve_target(target) + + self._check_guards() + + if self.policy: + self.policy(pos) + + self.mot.move(pos) + + def mv(self, target: Union[str, float]): + """move devices with a timeout""" + + pos = self._resolve_target(target) + + self._check_guards() + + if self.policy: + self.policy(pos) + + # status.wait(self.device_timeout) + return self.mot.move_with_status(pos) + # self.mot.move_with_status(pos) + + def set_position(self, target: Union[str, float]): + """Only to be used for testing purposes, bypasses guards""" + pos = self._resolve_target(target) + self.mot.move(pos) + + @property + def actual(self) -> float: + """Return the actual position of the device.""" + # return self.mot.read()[self.bec_name]["value"] + return self.mot.actual + + @property + def pos(self) -> str: + """Return the closest matching position""" + + for name, pos in self.positions.items(): + if abs(self.actual - pos) <= self.tol: + return name + + return "unknown" + + # + + def is_at(self, target: Union[str, float]) -> bool: + """Return True if the device is at the given position.""" + + pos = self._resolve_target(target) + return abs(self.actual - pos) <= self.tol + + # ------------------------- + # Mock Motor Implementation + # ------------------------- + + class MockMotor: + """Mock motor implementation""" + + def __init__(self, name: str): + self.name = name + self.position = 0.0 + self._target = self.position + self.fail = False + self.delay = 0 + + # + def move(self, pos: float): + """Move the motor to the given position.""" + if self.fail: + return + # raise RuntimeError(f"Motor {self.name} failed") + time.sleep(self.delay) + self.position = pos diff --git a/pxii_bec/macros/pxii_parameters.py b/pxii_bec/macros/pxii_parameters.py index e5f651d..856b685 100755 --- a/pxii_bec/macros/pxii_parameters.py +++ b/pxii_bec/macros/pxii_parameters.py @@ -168,23 +168,23 @@ class BPMScans: } -@dataclass(frozen=True) -class MirrorConfig: - """Define the names of the mirror channels""" +# @dataclass(frozen=True) +# class MirrorConfig: +# """Define the names of the mirror channels""" - hfm = { - "bu_name": dev.hfm_bu.name, - "bd_name": dev.hfm_bd.name, - "z_name": dev.samcam_xsig.name, - "x_device": dev.hfm_bu, - "y_device": dev.hfm_bd, - } - vfm = { - "bu_name": dev.vfm_bu.name, - "bd_name": dev.vfm_bd.name, - "z_name": dev.samcam_ysig.name, - "x_device": dev.vfm_bu, - "y_device": dev.vfm_bd, - } +# hfm = { +# "bu_name": dev.hfm_bu.name, +# "bd_name": dev.hfm_bd.name, +# "z_name": dev.samcam_xsig.name, +# "x_device": dev.hfm_bu, +# "y_device": dev.hfm_bd, +# } +# vfm = { +# "bu_name": dev.vfm_bu.name, +# "bd_name": dev.vfm_bd.name, +# "z_name": dev.samcam_ysig.name, +# "x_device": dev.vfm_bu, +# "y_device": dev.vfm_bd, +# } diff --git a/pxii_bec/macros/test.py b/pxii_bec/macros/test.py old mode 100644 new mode 100755 index 4f61257..6461395 --- a/pxii_bec/macros/test.py +++ b/pxii_bec/macros/test.py @@ -1,38 +1,31 @@ +"""Test state changes""" + import random import time -def test_mv(): - tol = 0.1 - if abs(dev.coll_y.position) < tol: - value = 40 - else: - value = 0 - print(f"Moving coll_y to {value}") - s = scans.mv(dev.coll_y, value, relative=False) - s.wait(timeout = 3) - -def test_states(): - d = init_se_devices() - states, allow_modifiers = get_states() - deps = planner_deps() - planner = StateManager(d, states, allow_modifiers, deps) - states_to_test = [ - BeamlineState.ROBOT_SAMPLE_EXCHANGE, - BeamlineState.DATA_COLLECTION, - BeamlineState.MANUAL_SAMPLE_EXCHANGE, - BeamlineState.XTAL_SNAPSHOT, - - ] - previous = None +def state_test(): + d, planner = init_beamline_environment() tested_states = [] - for i in range(10): - choices = [ s for s in states_to_test if s != previous] + states_to_test = [BeamlineState.BEAMSTOP_ALIGNMENT, + BeamlineState.DATA_COLLECTION, + BeamlineState.MAINTENANCE, + BeamlineState.ROBOT_SAMPLE_EXCHANGE, + BeamlineState.SAMPLE_ALIGNMENT, + # BeamlineState.DC_XRF, + BeamlineState.FLUX_MEASUREMENT, + BeamlineState.XTAL_SNAPSHOT, + BeamlineState.MANUAL_SAMPLE_EXCHANGE, + BeamlineState.BEAM_VISUALISATION] + previous = None + for i in range(20): + choices = [s for s in states_to_test if s != previous] current = random.choice(choices) - print(f"Moving to state {current}") + print(f"Testing {current}") planner.move_to(current) - tested_states.append(current) time.sleep(5) + tested_states.append(current.name) previous = current - print(f"Tested states: {tested_states}") + planner.move_to(BeamlineState.MANUAL_SAMPLE_EXCHANGE) + + print("\n".join(tested_states)) - -- 2.54.0 From c9b6f8402010f2d42aeafb7f295dbb41a100d662 Mon Sep 17 00:00:00 2001 From: x10sa Date: Mon, 15 Jun 2026 14:38:58 +0200 Subject: [PATCH 3/3] updates to yamls --- pxii_bec/device_configs/device_config.yaml | 792 -------- .../device_configs/pxii-beamline-states.yaml | 16 +- pxii_bec/device_configs/pxii-devices.yaml | 1772 +++++++++++++++++ .../device_configs/pxii-rest-devices.yaml | 18 - .../device_configs/pxii-standard-devices.yaml | 1657 --------------- .../device_configs/pxii-state-devices.yaml | 130 -- .../device_configs/smargopolo_smargon.yaml | 12 - .../device_configs/x10sa_device_config.yaml | 74 +- pxii_bec/macros/APscripts.py | 44 +- pxii_bec/macros/KB_Class.py | 83 + pxii_bec/macros/Undu_Helpers.py | 14 +- pxii_bec/macros/beamline_planner.py | 16 +- pxii_bec/macros/build_devices.py | 124 +- pxii_bec/macros/check.py | 142 +- pxii_bec/macros/dependencies.py | 30 +- pxii_bec/macros/devices_manager.py | 9 +- pxii_bec/macros/guards.py | 4 +- pxii_bec/macros/init_beamline.py | 56 +- pxii_bec/macros/katscripts.py | 1547 ++++++++++++++ pxii_bec/macros/policies.py | 5 +- pxii_bec/macros/pxii_energy.py | 12 +- pxii_bec/macros/pxii_parameters.py | 45 +- .../macros/pxii_parameters_version_120526.txt | 338 ---- pxii_bec/macros/test.py | 2 +- 24 files changed, 3704 insertions(+), 3238 deletions(-) delete mode 100644 pxii_bec/device_configs/device_config.yaml create mode 100644 pxii_bec/device_configs/pxii-devices.yaml delete mode 100644 pxii_bec/device_configs/pxii-rest-devices.yaml delete mode 100644 pxii_bec/device_configs/pxii-standard-devices.yaml delete mode 100644 pxii_bec/device_configs/pxii-state-devices.yaml delete mode 100644 pxii_bec/device_configs/smargopolo_smargon.yaml mode change 100755 => 100644 pxii_bec/macros/APscripts.py create mode 100644 pxii_bec/macros/KB_Class.py create mode 100755 pxii_bec/macros/katscripts.py delete mode 100755 pxii_bec/macros/pxii_parameters_version_120526.txt diff --git a/pxii_bec/device_configs/device_config.yaml b/pxii_bec/device_configs/device_config.yaml deleted file mode 100644 index 7926fec..0000000 --- a/pxii_bec/device_configs/device_config.yaml +++ /dev/null @@ -1,792 +0,0 @@ -sls_current: - description: SLS current - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'ARS07-DPCT-0100:CURR', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - SLS - readOnly: true - softwareTrigger: false -ps1_press: - description: Photon shutter 1 pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-PSH1-VMCC-1010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -abs_press: - description: Absorber pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-VMCC-0000:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -lu_bpmsum: - description: LU BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: true - softwareTrigger: false -ss_bpmsum: - description: SS BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM1:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: true - softwareTrigger: false -ps3_press: - description: Pumpstand 3 pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-PUM3-VMCC-2010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -bsf_press: - description: BSF pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-BSF-VMFR-0010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -bb1_press: - description: BB1 pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-BBU-VMFR-1010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -dcm_press: - description: DCM pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-DCM-VMFR-3010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -bb2_press: - description: BB2 pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-BBD-VMFR-4010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -lu_press: - description: LU pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LU-VMFR-5010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -ps2_press: - description: Photon shutter 2 pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-PSH1-VMFR-7010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -ss_press: - description: SS pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SS1-VMFR-0010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -kb_press: - description: KBV pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-KBV-VMFR-0010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -bcu_press: - description: BCU pressure - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCU-VMFR-0010:PRESSURE', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - press - readOnly: true - softwareTrigger: false -fe_sxr: - description: 'FE Slit X Ring' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -fe_syt: - description: 'FE Slit Y top' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -fe_sxw: - description: 'FE Slit X Wall' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -fe_syb: - description: 'FE SlitY Bottom' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -fe_sxcen: - description: 'FE Slit X Centre' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:CENTERX'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -fe_sxsize: - description: 'FE Slit X Size' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:SIZEX'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -fe_sycen: - description: 'FE Slit Y Centre' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:CENTERY'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -fe_sysize: - description: 'FE Slit Y Size' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-SLDI:SIZEY'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - fe - readOnly: false - softwareTrigger: false -s1_xw: - description: 'BSF slit outboard' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-SLH:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -s1_xr: - description: 'BSF slit inboard' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-SLH:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -s1_yt: - description: 'BSF slit top' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-SLV:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -s1_yb: - description: 'BSF slit bottom' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-SLV:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -s1_xcen: - description: 'BSF X centre' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-SLH:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -s1_xsize: - description: 'BSF X size' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-SLH:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -s1_ycen: - description: 'BSF Y centre' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-SLV:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -opf1_y: - description: 'BSF Filter 1 Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-FI1:TRY'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -opf2_y: - description: 'BSF Filter 2 Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-FI2:TRY'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bsf - readOnly: false - softwareTrigger: false -dcm_bragg: - description: 'DCM Bragg angle' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - dcm - readOnly: false - softwareTrigger: false -dcm_x: - description: 'DCM lateral' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - dcm - readOnly: false - softwareTrigger: false -dcm_perp: - description: 'DCM Perp' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:TRX-C2'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - dcm - readOnly: false - softwareTrigger: false -dcm_pitch: - description: 'DCM 2nd crystal pitch' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY-C2'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - dcm - readOnly: false - softwareTrigger: false -ssbpm_x: - description: 'SS BPM X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSBPM1:TRX1'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -ssbpm_y: - description: 'SS BPM Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSBPM1:TRY1'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_xw: - description: 'SS slit wall' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSH1:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_xr: - description: 'SS slit ring' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSH1:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_xcen: - description: 'SS slit X centre' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSH1:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_xsize: - description: 'SS slit X size' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSH1:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_yt: - description: 'SS slit top' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSV1:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_yb: - description: 'SS slit bottom' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSV1:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_ycen: - description: 'SS slit Y centre' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSV1:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -s2_ysize: - description: 'SS slit Y size' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSV1:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -xeye_x: - description: 'SS X-ray eye X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSXI1:TRX1'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -xeye_y: - description: 'SS X-ray eye Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSXI1:TRY1'} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - ss - readOnly: false - softwareTrigger: false -vfm_xu: - description: 'VFM Upstream X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRXU'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_xd: - description: 'VFM Downstream X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRXD'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_yur: - description: 'VFM Upstream Ring Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYUR'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_yw: - description: 'VFM Wall Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYW'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_ydr: - description: 'VFM Downstream Ring Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYDR'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_bu: - description: 'VFM Upstream Bender' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:BNDU'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_bd: - description: 'VFM Downstream Bender' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:BNDD'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_yaw: - description: 'VFM Virtual Yaw' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:YAW'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_roll: - description: 'VFM Virtual Roll' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:ROLL'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_pitch: - description: 'VFM Virtual Pitch' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:PITCH'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_lat: - description: 'VFM Virtual X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRX'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -vfm_vert: - description: 'VFM Virtual Y ' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-VFM:TRY'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - vfm - readOnly: false - softwareTrigger: false -hfm_xu: - description: 'HFM Upstream X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRXU'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_xd: - description: 'HFM Downstream X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRXD'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_yuw: - description: 'HFM Upstream Wall Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYUW'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_yr: - description: 'HFM Ring Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYR'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_ydw: - description: 'HFM Downstream Wall Y' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYDW'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_bu: - description: 'HFM Upstream Bender' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:BNDU'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_bd: - description: 'HFM Downstream Bender' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:BNDD'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_yaw: - description: 'HFM Virtual Yaw' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:YAW'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_roll: - description: 'HFM Virtual Roll' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:ROLL'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_pitch: - description: 'HFM Virtual Pitch' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:PITCH'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_lat: - description: 'HFM Virtual X' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRX'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false -hfm_vert: - description: 'HFM Virtual Y ' - deviceClass: ophyd.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-HFM:TRY'} - onFailure: buffer - enabled: False - readoutPriority: monitored - deviceTags: - - hfm - readOnly: false - softwareTrigger: false diff --git a/pxii_bec/device_configs/pxii-beamline-states.yaml b/pxii_bec/device_configs/pxii-beamline-states.yaml index ee4e938..2011edf 100644 --- a/pxii_bec/device_configs/pxii-beamline-states.yaml +++ b/pxii_bec/device_configs/pxii-beamline-states.yaml @@ -196,14 +196,14 @@ states: det_cov: 'close' diag_y: out fl_bright: 'on' - aerotech_x: in - aerotech_y: work - aerotech_z: work - aerotech_u: mount - smargon_x: mount - smargon_y: mount - smargon_chi: mount - smargon_phi: mount + # aerotech_x: in + # aerotech_y: work + # aerotech_z: work + # aerotech_u: mount + # smargon_x: mount + # smargon_y: mount + # smargon_chi: mount + # smargon_phi: mount xrf_pos: out diff --git a/pxii_bec/device_configs/pxii-devices.yaml b/pxii_bec/device_configs/pxii-devices.yaml new file mode 100644 index 0000000..6159d25 --- /dev/null +++ b/pxii_bec/device_configs/pxii-devices.yaml @@ -0,0 +1,1772 @@ +# BEC Device Configuration File +# +# The device config consists of a mapping of device names to their configurations. +# +# The following fields are required for each device: +# - deviceClass: The class of the device (e.g., ophyd_devices.SimPositioner). +# - enabled: A boolean indicating if the device is enabled. +# - readoutPriority: Determines how the device is read out during a scan. Possible values are ["monitored", "baseline", "async", "on_request", "continuous"]. +# +# Optional fields (defaults shown): +# - connectionTimeout: Connection timeout in seconds. Default is 5. +# - description: A string description of the device. Default is "" (empty string). +# - deviceConfig: A dictionary of configuration parameters specific to the device class. Default is None. +# - deviceTags: A list/set of tags associated with the device. Default is an empty list/set. +# - needs: A list of other device names that this device depends on. Default is []. +# - onFailure: The action to take on failure. Possible values are ["buffer", "retry", "raise"]. Default is "retry". +# - readOnly: A boolean indicating if the device is read-only. Default is false. +# - softwareTrigger: A boolean indicating if the device uses software triggering. Default is false. +# - userParameter: A dictionary of user-defined parameters. Default is {}. +# +# Default values may be omitted for brevity. +########################################################################################################################## + + +# An example device configuration with all fields: + +# device1: +# deviceClass: ophyd_devices.SimPositioner +# description: Sample positioner device +# deviceConfig: +# delay: 1 +# update_frequency: 10 +# deviceTags: +# - frontend +# - motor +# enabled: true +# connectionTimeout: 20 +# readoutPriority: baseline +# needs: +# - device2 +# - device3 +# onFailure: retry +# readOnly: false +# softwareTrigger: false +# userParameter: +# in: 23.1 +# out: -50 + +########################################################################################################################## + + +aerotech: + description: REST-based device which connects to AareScan and Aerotech + deviceClass: pxii_bec.devices.aerotech.Aerotech + deviceConfig: + prefix: http://mx-x10sa-queue-01:5234 + deviceTags: + - aerotech + - motors + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + u: + mount: 0 + work: 0 + work: null + x: + in: 0 + out: -10 + safe: -50 + y: + mount: 0 + work: 0 + z: + mount: 0 + work: 0 +bcu_bpm1: + description: BCU BPM Channel 1 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BCBPM:Current1:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +bcu_bpm2: + description: BCU BPM Channel 2 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BCBPM:Current2:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +bcu_bpm3: + description: BCU BPM Channel 3 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BCBPM:Current3:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +bcu_bpm4: + description: BCU BPM Channel 4 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BCBPM:Current4:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +bcu_bpm_x: + description: BCU BPM X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCBPM:TRX + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_bpm_y: + description: BCU BPM Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCBPM:TRY + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_bpmsum: + description: BCU BPM Summed + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BCBPM:SumAll:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +bcu_sl_xcen: + description: BCU Slit X Centre + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLH:CENTER + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_sl_xr: + description: BCU Slit Ring + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLH:TRXR + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_sl_xsize: + description: BCU Slit X Size + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLH:SIZE + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_sl_xw: + description: BCU Slit Wall + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLH:TRXW + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_sl_yb: + description: BCU Slit Bottom + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLV:TRYB + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_sl_ycen: + description: BCU Slit Y Centre + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLV:CENTER + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_sl_ysize: + description: BCU Slit Y Size + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLV:SIZE + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bcu_sl_yt: + description: BCU Slit Top + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BCSLV:TRYT + deviceTags: + - bcu + enabled: true + onFailure: buffer + readoutPriority: baseline +bl_bright: + description: Backlight Brightness + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BL:SET + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + 'off': 0.0 + 'on': 1.3 + tol: 0.01 + type: continuous +bl_pos: + description: Backlight Positioner + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BL:POS-SET + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: 1 + out: 0 + type: discrete +bs_pos: + description: Beamstop Positioner + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-BS:POS-SET + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: 1 + out: 0 + type: discrete +bs_x: + description: Beamstop X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BS:TRX + deviceTags: + - se + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: 1.64 +bs_y: + description: Beamstop Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BS:TRY + deviceTags: + - se + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: -0.6 +bs_z: + description: Beamstop Z + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-BS:TRZ + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + max_blin: 45.4 + max_blout: 70 + min: 13 + safe: 45.1 + samp: 15.3 + type: continuous + work_min: 20 +bsf_f1_y: + description: BSF Filter 1 Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFFI1:TRY + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_f2_y: + description: BSF Filter 2 Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFFI2:TRY + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_xcen: + description: BSF X Centre + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLH:CENTER + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_xr: + description: BSF Slit Ring + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLH:TRXR + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_xsize: + description: BSF X Size + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLH:SIZE + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_xw: + description: BSF Slit Wall + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLH:TRXW + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_yb: + description: BSF Slit Bottom + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLV:TRYB + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_ycen: + description: BSF Y Centre + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLV:CENTER + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_ysize: + description: BSF Y Size + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLV:SIZE + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +bsf_sl_yt: + description: BSF Slit Top + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-BSFSLV:TRYT + deviceTags: + - bsf + enabled: true + onFailure: buffer + readoutPriority: baseline +coll_x: + description: Collimator X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-COL:TRX + deviceTags: + - se + enabled: true + onFailure: buffer + readoutPriority: baseline +coll_y: + description: Collimator Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-COL:TRY + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: 40.9 + intermediate: 32 + out: 20.0 + park: 1 + tol: 0.05 + type: continuous +cryo_pos: + description: Cryo positioner + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-CS:POS-SET + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: 1 + out: 0 + type: discrete +cryo_temp: + description: Cryo Temperature + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-CS:TEMP_RBV + deviceTags: + - se + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +cryo_x: + description: Cryo X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-CS:TRX + deviceTags: + - se + enabled: true + onFailure: buffer + readoutPriority: baseline +dcm_bragg: + description: DCM Bragg Angle + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-DCM:ROTY + deviceTags: + - dcm + enabled: true + onFailure: buffer + readoutPriority: baseline +dcm_fpitch: + description: DCM 2nd Crystal Fine Pitch + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-DCM:ROTY-CR2-FINEPITCH + deviceTags: + - dcm + enabled: true + onFailure: buffer + readoutPriority: baseline +dcm_froll: + description: DCM 2nd Crystal Fine roll + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-DCM:ROTZ-CR2-FINEROLL + deviceTags: + - dcm + enabled: true + onFailure: buffer + readoutPriority: baseline +dcm_perp: + description: DCM Perpendicular + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-DCM:TRX-CR2 + deviceTags: + - dcm + enabled: true + onFailure: buffer + readoutPriority: baseline +dcm_pitch: + description: DCM 2nd Crystal Pitch + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-DCM:ROTY-CR2-PITCH + deviceTags: + - dcm + enabled: true + onFailure: buffer + readoutPriority: baseline +dcm_x: + description: DCM Lateral + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-OP-DCM:TRX + deviceTags: + - dcm + enabled: true + onFailure: buffer + readoutPriority: baseline +det_cov: + description: Detector cover + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-DETCOV:SET + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + close: 1 + open: 2 + type: discrete +det_xi_focus: + description: X-ray Eye 2 Focus + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-XEYE:FOCUS + deviceTags: + - det + enabled: true + onFailure: buffer + readoutPriority: baseline +det_xi_x: + description: X-ray Eye X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-XEYE:TRX + deviceTags: + - det + enabled: true + onFailure: buffer + readoutPriority: baseline +det_xi_zoom: + description: X-ray Eye 2 Zoom + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-XEYE:ZOOM + deviceTags: + - det + enabled: true + onFailure: buffer + readoutPriority: baseline +det_y: + description: Detector Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-DET:TRY + deviceTags: + - det + enabled: true + onFailure: buffer + readoutPriority: baseline +det_z: + description: Detector Z + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-DET:TRZ + deviceTags: + - det + enabled: true + onFailure: buffer + readoutPriority: baseline +diag_y: + description: Scintillator/diode Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SCL:TRY + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + i1: 43.4 + out: 20.0 + park: 1 + scint: 38.0 + tol: 0.3 + type: continuous +diag_z: + description: Scintillator/diode Z + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SCL:TRZ + deviceTags: + - se + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_bpm1: + description: FE XBPM Channel 1 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-FE-XBPM1:Current1:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +fe_bpm2: + description: FE XBPM Channel 2 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-FE-XBPM1:Current2:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +fe_bpm3: + description: FE XBPM Channel 3 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-FE-XBPM1:Current3:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +fe_bpm4: + description: FE XBPM Channel 4 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-FE-XBPM1:Current4:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +fe_bpm_x: + description: FE BPM X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-FE-XBPM1:TRX + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_bpm_y: + description: FE BPM Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-FE-XBPM1:TRY + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_bpmsum: + description: FE XBPM Summed + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-FE-XBPM1:SumAll:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +fe_sl_xcen: + description: FE Slit X Centre + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:CENTERX + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_sl_xr: + description: FE Slit X Ring + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:TRXR + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_sl_xsize: + description: FE Slit X Size + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:SIZEX + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_sl_xw: + description: FE Slit X Wall + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:TRXW + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_sl_yb: + description: FE Slit Y Bottom + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:TRYB + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_sl_ycen: + description: FE Slit Y Centre + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:CENTERY + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_sl_ysize: + description: FE Slit Y Size + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:SIZEY + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fe_sl_yt: + description: FE Slit Y Top + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-FE-SL1:TRYT + deviceTags: + - fe + enabled: true + onFailure: buffer + readoutPriority: baseline +fl_bright: + description: Frontlight Brightness + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-FL:SET + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + 'off': 0.0 + 'on': 3.0 + tol: 0.01 + type: continuous +hfm_bd: + description: HFM Downstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:BNDD + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_bu: + description: HFM Upstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:BNDU + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_pitch: + description: HFM Virtual Pitch + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:PITCH + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_roll: + description: HFM Virtual Roll + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:ROLL + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_x: + description: HFM Virtual X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:TRX + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_xd: + description: HFM Downstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:TRXD + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_xu: + description: HFM Upstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:TRXU + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_y: + description: HFM Virtual Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:TRY + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_yaw: + description: HFM Virtual Yaw + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:YAW + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_ydw: + description: HFM Downstream Wall Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:TRYDW + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_yr: + description: HFM Ring Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:TRYR + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +hfm_yuw: + description: HFM Upstream Wall Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-HFM:TRYUW + deviceTags: + - hfm + enabled: true + onFailure: buffer + readoutPriority: baseline +i1: + description: I1 Diode + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SCLDI:READOUT + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +i2: + description: I2 Diode + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-XEYEDI:READOUT + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +id_gap: + description: undulator gap + deviceClass: pxii_bec.devices.undulator.UndulatorGap + deviceConfig: + prefix: 'X10SA-UIND:' + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_bpm1: + description: LU BPM Channel 1 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-OP-LUBPM:Current1:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +lu_bpm2: + description: LU BPM Channel 2 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-OP-LUBPM:Current2:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +lu_bpm3: + description: LU BPM Channel 3 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-OP-LUBPM:Current3:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +lu_bpm4: + description: LU BPM Channel 4 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-OP-LUBPM:Current4:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +lu_bpm_x: + description: BPM2 X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUBPM:TRX + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_bpm_y: + description: BPM2 Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUBPM:TRY + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_bpmsum: + description: LU BPM Summed + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-OP-LUBPM:SumAll:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +lu_pod1_rotx: + description: SmarPod1 RX + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD1:ROTX + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod1_roty: + description: SmarPod1 RY + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD1:ROTY + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod1_rotz: + description: SmarPod1 RZ + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD1:ROTZ + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod1_y: + description: SmarPod1 Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD1:TRY + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod1_z: + description: SmarPod1 Z + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD1:TRZ + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod2_rotx: + description: SmarPod2 RX + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD2:ROTX + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod2_roty: + description: SmarPod2 RY + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD2:ROTY + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod2_rotz: + description: SmarPod2 RZ + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD2:ROTZ + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod2_y: + description: SmarPod2 Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD2:TRY + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_pod2_z: + description: SmarPod2 Z + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUPOD2:TRZ + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_z1: + description: Lens Z1 + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUTRZ1:TRZ + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +lu_z2: + description: Lens Z2 + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-OP-LUTRZ2:TRZ + deviceTags: + - lu + enabled: true + onFailure: buffer + readoutPriority: baseline +mag_ok: + description: Sample Sensor Check + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-DFS:CBOX-CMP1 + deviceTags: + - se + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +mag_rbv: + description: Sample Sensor RBV + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-DFS:CBOX-USER1 + deviceTags: + - se + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +mag_ref: + description: Sample Sensor Reference + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-DFS:CBOX-REFVAL1 + deviceTags: + - se + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +samcam_exp: + description: Sample Camera Exposure + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-MS:cam1:AcquireTime + deviceTags: + - scam + enabled: true + onFailure: buffer + readoutPriority: baseline +samcam_gain: + description: Sample Camera Gain + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-MS:cam1:Gain + deviceTags: + - scam + enabled: true + onFailure: buffer + readoutPriority: baseline +samcam_max: + description: Sample Camera Max + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-MS:Stats5:MaxValue_RBV + deviceTags: + - scam + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +samcam_x: + description: Sample Camera X + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-MS:Stats5:CentroidX_RBV + deviceTags: + - scam + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +samcam_xsig: + description: Sample Camera X Sigma + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-MS:Stats5:SigmaX_RBV + deviceTags: + - scam + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +samcam_y: + description: Sample Camera Y + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-MS:Stats5:CentroidY_RBV + deviceTags: + - scam + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +samcam_ysig: + description: Sample Camera Y Sigma + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-MS:Stats5:SigmaY_RBV + deviceTags: + - scam + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +scam_zoom: + description: Sample Camera Zoom + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-MS:ZOOM + deviceTags: + - scam + enabled: true + onFailure: buffer + readoutPriority: baseline +sls_current: + description: SLS Current + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: ARS07-DPCT-0100:CURR + deviceTags: + - SLS + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +smargon: + description: REST-based device which connects to Smargopolo + deviceClass: pxii_bec.devices.smargopolo_smargon.Smargon + deviceConfig: + prefix: http://x10sa-smargopolo.psi.ch:3000 + deviceTags: + - smargon + - motors + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + chi: + mount: 0 + phi: + mount: 0 + x: + mount: 0 + y: + mount: 0 + z: + mount: 18 +ss_bpm1: + description: SS BPM Channel 1 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSBPM:Current1:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +ss_bpm2: + description: SS BPM Channel 2 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSBPM:Current2:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +ss_bpm3: + description: SS BPM Channel 3 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSBPM:Current3:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +ss_bpm4: + description: SS BPM Channel 4 + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSBPM:Current4:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +ss_bpm_x: + description: SS BPM X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSBPM:TRX + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_bpm_y: + description: SS BPM Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSBPM:TRY + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_bpmsum: + description: SS BPM Summed + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSBPM:SumAll:MeanValue_RBV + deviceTags: + - bpm + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +ss_f1_x: + description: SS Filter 1 X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSFI1:TRX + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_f2_x: + description: SS Filter 2 X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSFI2:TRX + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_f3_x: + description: SS Filter 2 X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSFI3:TRX + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_f4_x: + description: SS Filter 4 X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSFI4:TRX + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_xcen: + description: SS Slit X Centre + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLH:CENTER + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_xr: + description: SS Slit Ring + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLH:TRXR + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_xsize: + description: SS Slit X Size + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLH:SIZE + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_xw: + description: SS Slit Wall + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLH:TRXW + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_yb: + description: SS Slit Bottom + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLV:TRYB + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_ycen: + description: SS Slit Y Centre + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLV:CENTER + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_ysize: + description: SS Slit Y Size + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLV:SIZE + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_sl_yt: + description: SS Slit Top + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSSLV:TRYT + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_xi_x: + description: SS X-ray Eye X + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSXI:TRX + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: 7 + out: -2.1 + type: multi-position +ss_xi_y: + description: SS X-ray Eye Y + deviceClass: ophyd_devices.EpicsMotor + deviceConfig: + prefix: X10SA-ES-SSXI:TRY + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_xicam_exp: + description: SS Camera Exposure + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSCAM:cam1:AcquireTime + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_xicam_gain: + description: SS Camera Gain + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSCAM:cam1:Gain + deviceTags: + - ss + enabled: true + onFailure: buffer + readoutPriority: baseline +ss_xicam_max: + description: SS Cam Max + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSCAM:Stats5:MaxValue_RBV + deviceTags: + - ss + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: monitored +ss_xicam_x: + description: SS Camera X + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSCAM:Stats5:CentroidX_RBV + deviceTags: + - ss + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +ss_xicam_xsig: + description: SS Camera X Sigma + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSCAM:Stats5:SigmaX_RBV + deviceTags: + - ss + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +ss_xicam_y: + description: SS Camera Y + deviceClass: ophyd.EpicsSignalRO + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSCAM:Stats5:CentroidY_RBV + deviceTags: + - ss + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +ss_xicam_ysig: + description: SS Camera Y Sigma + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-SSCAM:Stats5:SigmaY_RBV + deviceTags: + - ss + enabled: true + onFailure: buffer + readOnly: true + readoutPriority: baseline +vfm_bd: + description: VFM Downstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:BNDD + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_bu: + description: VFM Upstream Bender + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:BNDU + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_pitch: + description: VFM Virtual Pitch + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:PITCH + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_roll: + description: VFM Virtual Roll + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:ROLL + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_x: + description: VFM Virtual X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:TRX + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_xd: + description: VFM Downstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:TRXD + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_xu: + description: VFM Upstream X + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:TRXU + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_y: + description: VFM Virtual Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:TRY + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_yaw: + description: VFM Virtual Yaw + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:YAW + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_ydr: + description: VFM Downstream Ring Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:TRYDR + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_yur: + description: VFM Upstream Ring Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:TRYUR + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +vfm_yw: + description: VFM Wall Y + deviceClass: ophyd_devices.EpicsMotorEC + deviceConfig: + prefix: X10SA-ES-VFM:TRYW + deviceTags: + - vfm + enabled: true + onFailure: buffer + readoutPriority: baseline +xrf_pos: + description: XRF Positioner + deviceClass: ophyd.EpicsSignal + deviceConfig: + auto_monitor: true + read_pv: X10SA-ES-XRF:POS-SET + deviceTags: + - state + enabled: true + onFailure: buffer + readoutPriority: baseline + userParameter: + in: 1 + out: 0 + type: discrete diff --git a/pxii_bec/device_configs/pxii-rest-devices.yaml b/pxii_bec/device_configs/pxii-rest-devices.yaml deleted file mode 100644 index abf79ff..0000000 --- a/pxii_bec/device_configs/pxii-rest-devices.yaml +++ /dev/null @@ -1,18 +0,0 @@ -aerotech_x: - userParameter: {"type": continuous, "in": 0.0, "out": -10.0, "safe": -50, "tol": 0.5} -aerotech_y: - userParameter: {"type": continuous, "mount": 0.0, "work": 0.01, "tol": 0.002} -aerotech_z: - userParameter: {"type": continuous, "mount": 0.0, "work": 0.02, "tol": 0.01} -aerotech_u: - userParameter: {"type": continuous, "mount": 0.0} -smargon_x: - userParameter: {"type": continuous, "mount": 0.0} -smargon_y: - userParameter: {"type": continuous, "mount": 0.0} -smargon_z: - userParameter: {"type": continuous, "mount": 18.0} -smargon_chi: - userParameter: {"type": continuous, "mount": 0.0} -smargon_phi: - userParameter: {"type": continuous, "mount": 0.0} diff --git a/pxii_bec/device_configs/pxii-standard-devices.yaml b/pxii_bec/device_configs/pxii-standard-devices.yaml deleted file mode 100644 index 6c2000f..0000000 --- a/pxii_bec/device_configs/pxii-standard-devices.yaml +++ /dev/null @@ -1,1657 +0,0 @@ -sls_current: - description: SLS Current - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'ARS07-DPCT-0100:CURR', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - SLS - readOnly: True - softwareTrigger: false - -fe_bpm1: - description: FE XBPM Channel 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm2: - description: FE XBPM Channel 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm3: - description: FE XBPM Channel 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm4: - description: FE XBPM Channel 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpmsum: - description: FE XBPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-FE-XBPM1:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -fe_bpm_x: - description: FE BPM X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-XBPM1:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_bpm_y: - description: FE BPM Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-FE-XBPM1:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xr: - description: FE Slit X Ring - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_yt: - description: FE Slit Y Top - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xw: - description: FE Slit X Wall - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_yb: - description: FE Slit Y Bottom - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xcen: - description: FE Slit X Centre - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:CENTERX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_xsize: - description: FE Slit X Size - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:SIZEX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_ycen: - description: FE Slit Y Centre - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:CENTERY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -fe_sl_ysize: - description: FE Slit Y Size - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-FE-SL1:SIZEY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - fe - readOnly: False - softwareTrigger: false - -bsf_sl_xw: - description: BSF Slit Wall - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_xr: - description: BSF Slit Ring - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_yt: - description: BSF Slit Top - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_yb: - description: BSF Slit Bottom - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_xcen: - description: BSF X Centre - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_xsize: - description: BSF X Size - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLH:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_ycen: - description: BSF Y Centre - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_sl_ysize: - description: BSF Y Size - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFSLV:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_f1_y: - description: BSF Filter 1 Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFFI1:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -bsf_f2_y: - description: BSF Filter 2 Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-BSFFI2:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bsf - readOnly: False - softwareTrigger: false - -dcm_bragg: - description: DCM Bragg Angle - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_x: - description: DCM Lateral - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-DCM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_perp: - description: DCM Perpendicular - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-DCM:TRX-CR2'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_pitch: - description: DCM 2nd Crystal Pitch - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY-CR2-PITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_fpitch: - description: DCM 2nd Crystal Fine Pitch - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTY-CR2-FINEPITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -dcm_froll: - description: DCM 2nd Crystal Fine roll - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-OP-DCM:ROTZ-CR2-FINEROLL'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - dcm - readOnly: False - softwareTrigger: false - -lu_bpm1: - description: LU BPM Channel 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm2: - description: LU BPM Channel 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm3: - description: LU BPM Channel 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm4: - description: LU BPM Channel 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpmsum: - description: LU BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-OP-LUBPM:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -lu_bpm_x: - description: BPM2 X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUBPM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_bpm_y: - description: BPM2 Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUBPM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_z1: - description: Lens Z1 - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUTRZ1:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_z2: - description: Lens Z2 - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUTRZ2:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_y: - description: SmarPod1 Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_z: - description: SmarPod1 Z - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_rotx: - description: SmarPod1 RX - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:ROTX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_roty: - description: SmarPod1 RY - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:ROTY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod1_rotz: - description: SmarPod1 RZ - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD1:ROTZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_y: - description: SmarPod2 Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_z: - description: SmarPod2 Z - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_rotx: - description: SmarPod2 RX - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:ROTX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_roty: - description: SmarPod2 RY - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:ROTY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -lu_pod2_rotz: - description: SmarPod2 RZ - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-OP-LUPOD2:ROTZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - lu - readOnly: False - softwareTrigger: false - -ss_bpm1: - description: SS BPM Channel 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm2: - description: SS BPM Channel 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm3: - description: SS BPM Channel 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm4: - description: SS BPM Channel 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpmsum: - description: SS BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SSBPM:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -ss_bpm_x: - description: SS BPM X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSBPM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_bpm_y: - description: SS BPM Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSBPM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f1_x: - description: SS Filter 1 X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI1:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f2_x: - description: SS Filter 2 X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI2:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f3_x: - description: SS Filter 2 X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI3:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_f4_x: - description: SS Filter 4 X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSFI4:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_xw: - description: SS Slit Wall - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_xr: - description: SS Slit Ring - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_xcen: - description: SS Slit X Centre - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_xsize: - description: SS Slit X Size - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLH:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_yt: - description: SS Slit Top - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_yb: - description: SS Slit Bottom - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_ycen: - description: SS Slit Y Centre - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_sl_ysize: - description: SS Slit Y Size - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSSLV:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -ss_xi_x: - description: SS X-ray Eye X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSXI:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - userParameter: {"type": multi-position,"in": 7.5, "out": -2.1} - -ss_xi_y: - description: SS X-ray Eye Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SSXI:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - ss - readOnly: False - softwareTrigger: false - -vfm_xu: - description: VFM Upstream X - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:TRXU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_xd: - description: VFM Downstream X - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:TRXD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_yur: - description: VFM Upstream Ring Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYUR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_yw: - description: VFM Wall Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_ydr: - description: VFM Downstream Ring Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:TRYDR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_bu: - description: VFM Upstream Bender - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:BNDU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_bd: - description: VFM Downstream Bender - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:BNDD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_yaw: - description: VFM Virtual Yaw - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:YAW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_roll: - description: VFM Virtual Roll - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:ROLL'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_pitch: - description: VFM Virtual Pitch - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:PITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_x: - description: VFM Virtual X - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -vfm_y: - description: VFM Virtual Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-VFM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - vfm - readOnly: False - softwareTrigger: false - -hfm_xu: - description: HFM Upstream X - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:TRXU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_xd: - description: HFM Downstream X - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:TRXD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_yuw: - description: HFM Upstream Wall Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYUW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_yr: - description: HFM Ring Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_ydw: - description: HFM Downstream Wall Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:TRYDW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_bu: - description: HFM Upstream Bender - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:BNDU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_bd: - description: HFM Downstream Bender - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:BNDD'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_yaw: - description: HFM Virtual Yaw - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:YAW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_roll: - description: HFM Virtual Roll - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:ROLL'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_pitch: - description: HFM Virtual Pitch - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:PITCH'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_x: - description: HFM Virtual X - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -hfm_y: - description: HFM Virtual Y - deviceClass: ophyd_devices.EpicsMotorEC - deviceConfig: {prefix: 'X10SA-ES-HFM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - hfm - readOnly: False - softwareTrigger: false - -bcu_bpm1: - description: BCU BPM Channel 1 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current1:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm2: - description: BCU BPM Channel 2 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current2:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm3: - description: BCU BPM Channel 3 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current3:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm4: - description: BCU BPM Channel 4 - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:Current4:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpmsum: - description: BCU BPM Summed - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-BCBPM:SumAll:MeanValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bcu_bpm_x: - description: BCU BPM X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCBPM:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_bpm_y: - description: BCU BPM Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCBPM:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xw: - description: BCU Slit Wall - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:TRXW'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xr: - description: BCU Slit Ring - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:TRXR'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xcen: - description: BCU Slit X Centre - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_xsize: - description: BCU Slit X Size - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLH:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_yt: - description: BCU Slit Top - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:TRYT'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_yb: - description: BCU Slit Bottom - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:TRYB'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_ycen: - description: BCU Slit Y Centre - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:CENTER'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -bcu_sl_ysize: - description: BCU Slit Y Size - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BCSLV:SIZE'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - bcu - readOnly: False - softwareTrigger: false - -samcam_x: - description: Sample Camera X - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:CentroidX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_xsig: - description: Sample Camera X Sigma - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:SigmaX_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_y: - description: Sample Camera Y - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:CentroidY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_ysig: - description: Sample Camera Y Sigma - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:SigmaY_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_max: - description: Sample Camera Max - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-MS:Stats5:MaxValue_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - scam - readOnly: True - softwareTrigger: false - -samcam_exp: - description: Sample Camera Exposure - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-MS:cam1:AcquireTime', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: False - softwareTrigger: false - -samcam_gain: - description: Sample Camera Gain - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-MS:cam1:Gain', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: False - softwareTrigger: false - -scam_zoom: - description: Sample Camera Zoom - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-MS:ZOOM'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - scam - readOnly: False - softwareTrigger: false - -coll_x: - description: Collimator X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-COL:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -diag_z: - description: Scintillator/diode Z - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SCL:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -i1: - description: I1 Diode - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-SCLDI:READOUT', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -bs_x: - description: Beamstop X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BS:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -bs_y: - description: Beamstop Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BS:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -gon_y: - description: Goniometer Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DF1:TRY1'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -gon_z: - description: Goniometer X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DF1:TRZ1'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -omega: - description: Omega - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DF1:ROTU'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -mag_ok: - description: Sample Sensor Check - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-CMP1', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: True - softwareTrigger: false - -mag_rbv: - description: Sample Sensor RBV - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-USER1', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: True - softwareTrigger: false - -mag_ref: - description: Sample Sensor Reference - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-REFVAL1', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: True - softwareTrigger: false - -cryo_x: - description: Cryo X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-CS:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: False - softwareTrigger: false - -cryo_temp: - description: Cryo Temperature - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-CS:TEMP_RBV', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - se - readOnly: True - softwareTrigger: false - -det_xi_focus: - description: X-ray Eye 2 Focus - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-XEYE:FOCUS'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -det_xi_zoom: - description: X-ray Eye 2 Zoom - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-XEYE:ZOOM'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -det_xi_x: - description: X-ray Eye X - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-XEYE:TRX'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -i2: - description: I2 Diode - deviceClass: ophyd.EpicsSignalRO - deviceConfig: {read_pv: 'X10SA-ES-XEYEDI:READOUT', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: monitored - deviceTags: - - bpm - readOnly: True - softwareTrigger: false - -det_y: - description: Detector Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DET:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - -det_z: - description: Detector Z - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-DET:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - det - readOnly: False - softwareTrigger: false - diff --git a/pxii_bec/device_configs/pxii-state-devices.yaml b/pxii_bec/device_configs/pxii-state-devices.yaml deleted file mode 100644 index 9888dc2..0000000 --- a/pxii_bec/device_configs/pxii-state-devices.yaml +++ /dev/null @@ -1,130 +0,0 @@ -bl_bright: - description: Backlight Brightness - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-BL:SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type": continuous, "on": 1.3, "off": 0.0, "tol": 0.01} - -bl_pos: - description: Backlight Positioner - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-BL:POS-SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type":discrete, "in": 1, "out": 0} - -bs_pos: - description: Beamstop Positioner - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-BS:POS-SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type":discrete, "in": 1, "out": 0} - -bs_z: - description: Beamstop Z - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-BS:TRZ'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type": continuous, "min": 13, "samp": 15, "work_min": 20, "safe": 41, "max_blin": 42, "max_blout": 70} - -coll_y: - description: Collimator Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-COL:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type": continuous, "in": 41.5, "out": 20.0, "intermediate": 32, "park": 1,"tol":0.05} - -cryo_pos: - description: Cryo positioner - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-CS:POS-SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type":discrete, "in": 1, "out": 0} - -det_cov: - description: Detector cover - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-DETCOV:SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type":discrete, "open": 2, "close": 1} - -diag_y: - description: Scintillator/diode Y - deviceClass: ophyd_devices.EpicsMotor - deviceConfig: {prefix: 'X10SA-ES-SCL:TRY'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type": continuous, "scint": 38.62, "i1": 44.0, "out": 20.0,"park": 1,"tol":0.3} - -fl_bright: - description: Frontlight Brightness - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-FL:SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type": continuous, "on": 3.0, "off": 0.0, "tol": 0.01} - -xrf_pos: - description: XRF Positioner - deviceClass: ophyd.EpicsSignal - deviceConfig: {read_pv: 'X10SA-ES-XRF:POS-SET', auto_monitor: true} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - state - readOnly: False - softwareTrigger: false - userParameter: {"type":discrete, "in": 1, "out": 0} - diff --git a/pxii_bec/device_configs/smargopolo_smargon.yaml b/pxii_bec/device_configs/smargopolo_smargon.yaml deleted file mode 100644 index 0b6d982..0000000 --- a/pxii_bec/device_configs/smargopolo_smargon.yaml +++ /dev/null @@ -1,12 +0,0 @@ -smargon: - description: REST-based device which connects to Smargopolo - deviceClass: pxii_bec.devices.smargopolo_smargon.Smargon - deviceConfig: {prefix: 'http://localhost:8000'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - smargon - - motors - readOnly: false - softwareTrigger: false \ No newline at end of file diff --git a/pxii_bec/device_configs/x10sa_device_config.yaml b/pxii_bec/device_configs/x10sa_device_config.yaml index 630ed00..8e54df4 100644 --- a/pxii_bec/device_configs/x10sa_device_config.yaml +++ b/pxii_bec/device_configs/x10sa_device_config.yaml @@ -1,40 +1,40 @@ base_config: - - !include ./pxii-standard-devices.yaml -sample_env: - - !include ./se_devices.yaml -id_gap: - readoutPriority: baseline - description: undulator gap - deviceClass: pxii_bec.devices.undulator.UndulatorGap - deviceConfig: - prefix: 'X10SA-UIND:' - onFailure: buffer - enabled: true - readOnly: false - softwareTrigger: false + - !include ./pxii-devices.yaml +# sample_env: +# - !include ./pxii-state-devices.yaml +# id_gap: +# readoutPriority: baseline +# description: undulator gap +# deviceClass: pxii_bec.devices.undulator.UndulatorGap +# deviceConfig: +# prefix: 'X10SA-UIND:' +# onFailure: buffer +# enabled: true +# readOnly: false +# softwareTrigger: false -smargon: - description: REST-based device which connects to Smargopolo - deviceClass: pxii_bec.devices.smargopolo_smargon.Smargon - deviceConfig: {prefix: 'http://x10sa-smargopolo.psi.ch:3000'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - smargon - - motors - readOnly: false - softwareTrigger: false +# smargon: +# description: REST-based device which connects to Smargopolo +# deviceClass: pxii_bec.devices.smargopolo_smargon.Smargon +# deviceConfig: {prefix: 'http://x10sa-smargopolo.psi.ch:3000'} +# onFailure: buffer +# enabled: True +# readoutPriority: baseline +# deviceTags: +# - smargon +# - motors +# readOnly: false +# softwareTrigger: false -aerotech: - description: REST-based device which connects to AareScan and Aerotech - deviceClass: pxii_bec.devices.aerotech.Aerotech - deviceConfig: {prefix: 'http://mx-x10sa-queue-01:5234'} - onFailure: buffer - enabled: True - readoutPriority: baseline - deviceTags: - - aerotech - - motors - readOnly: false - softwareTrigger: false +# aerotech: +# description: REST-based device which connects to AareScan and Aerotech +# deviceClass: pxii_bec.devices.aerotech.Aerotech +# deviceConfig: {prefix: 'http://mx-x10sa-queue-01:5234'} +# onFailure: buffer +# enabled: True +# readoutPriority: baseline +# deviceTags: +# - aerotech +# - motors +# readOnly: false +# softwareTrigger: false diff --git a/pxii_bec/macros/APscripts.py b/pxii_bec/macros/APscripts.py old mode 100755 new mode 100644 index f8d9597..53378c8 --- a/pxii_bec/macros/APscripts.py +++ b/pxii_bec/macros/APscripts.py @@ -139,8 +139,8 @@ def rock(**kwargs): import matplotlib.pyplot as plt ## create a dock area: - dock_area = bec.gui.new() - wr = dock_area.new(gui.available_widgets.Waveform) + dock_area = bec.gui.new(name="Rock", geometry = [4000, 900, 700, 700]) + wr = dock_area.new(bec.gui.available_widgets.Waveform) # width of rocking curve of perfect xtal: at 20 keV: 14 urad == 0.0008 deg @@ -194,12 +194,14 @@ def rock(**kwargs): mot = motb pos0 = motb_rb - s = scans.line_scan(mot, -dx, dx, steps=50, exp_time=time, relative=True) # md = scan.metadata["bec"] wr.title = f"RockingScan at Energy of {e}" - wr.plot(x_name=mot.name, y_name=det.name) ##set names/axes first ! wr.x_label = mot.name wr.y_label = det.name + wr.plot(device_x=mot, device_y=det) ##set names/axes first ! + + s = scans.line_scan(mot, -dx, dx, steps=50, exp_time=time, relative=True) + if ax == 0: data_x = s.scan.live_data.dcm_pitch.dcm_pitch.val else: @@ -237,6 +239,23 @@ def rock(**kwargs): return + + + + +################################ +### Help PROGRAMS + +############################# +### just reconfigure beaml +############################# +def loadmac(): + + bec.macros.load_all_user_macros() + # d, planner = init_beamline_environment() + + + ################################ ### FITTING PROGRAMS @@ -859,8 +878,8 @@ def colliscan(direction: str, range=0.3, nsteps=30, stime=0.5, centre=1): """ import sys - dock_area = bec.gui.new() - wr = dock_area.new().new(bec.gui.available_widgets.Waveform) + dock_area = bec.gui.new(name="ColliScan", geometry = [4000, 900, 700, 700]) + wr = dock_area.new(bec.gui.available_widgets.Waveform) # check if i1 DIODE is IN # if not, aks to be moved @@ -1033,18 +1052,19 @@ def slitscan(device_location: str, direction: str, range: 1, nsteps=50, centre=0 print("Ok, cancelled") return - dock_area = bec.gui.new() - wr = dock_area.new(gui.available_widgets.Waveform) + dock_area = bec.gui.new(name="SlitScan", geometry = [4000, 900, 700, 700]) + wr = dock_area.new(bec.gui.available_widgets.Waveform) pos0 = mot.user_readback.get() siz0 = size.user_readback.get() umv(size, s_closed) - s = scans.line_scan(mot, -dx, dx, steps=nsteps, exp_time=time, relative=True) - wr.plot(x_name=mot.name, y_name=det.name) + wr.plot(device_x=mot, device_y=det) + wr.x_label = mot.name wr.y_label = det.name + s = scans.line_scan(mot, -dx, dx, steps=nsteps, exp_time=time, relative=True) # this gives funny errors: ARRAYS differently read? # data_x = s.scan.data.devices[mot.name][mot.name].read()["value"] # data_x = s.scan.live_data["fe_sxcen"]["fe_sxcen"].val @@ -1494,8 +1514,8 @@ def scan_window(wname="Scan", fit=True): nam = "waveform_dock_"+wname dock_area = bec.gui.new(name=wname, geometry = [4000, 900, 700, 700]) - w1 = dock_area.new(gui.available_widgets.Waveform) # CALL gui.available_widgets to see what is available - w2 = dock_area.new(gui.available_widgets.ScanControl) + w1 = dock_area.new(bec.gui.available_widgets.Waveform) # CALL gui.available_widgets to see what is available + w2 = dock_area.new(bec.gui.available_widgets.ScanControl) # Add signals to the WaveformWidget w1.plot(device_x = dev.id_gap, device_y = dev.lu_bpmsum) diff --git a/pxii_bec/macros/KB_Class.py b/pxii_bec/macros/KB_Class.py new file mode 100644 index 0000000..5e3bbda --- /dev/null +++ b/pxii_bec/macros/KB_Class.py @@ -0,0 +1,83 @@ +import numpy as np + + +class KBMirror: + def __init__(self, mirror_type="PXII_HFM"): + self.mirror_type = mirror_type + self._load_parameters() + + def _load_parameters(self): + if self.mirror_type == "PXII_VFM": + self.C0 = 0.284078 + self.C1 = -0.471525 + self.P2 = 0.583490 + self.P3 = -0.372950 + self.L1 = -0.955798 + self.curv_approx_fact = 1.0121 + self.s1 = 24.15 #24.35 + self.s2 = 1.45 + self.asym0 = 0.08 + + elif self.mirror_type == "PXII_HFM": + self.C0 = 0.060453 + self.C1 = -0.457812 + self.P2 = 0.586057 + self.P3 = -0.088093 + self.L1 = -0.999445 + self.curv_approx_fact = 0.995 + self.s1 = 24.90 #25.10 + self.s2 = 0.7 + self.asym0 = -0.0107 + + else: + raise ValueError(f"Unknown mirror type: {self.mirror_type}") + + def bend_to_curvature(self, BU, BD): + BU0 = (BD - self.L1 * BU - self.P3) / (self.P2 - self.L1) + curv = self.C0 + self.C1 * BU0 + a = BU - BU0 + asym = a * np.sqrt(1 - self.L1**2) + return curv, asym + + def curvature_to_bend(self, curv, asym): + BU0 = (curv - self.C0) / self.C1 + BD0 = self.P2 * BU0 + self.P3 + a = asym / np.sqrt(1 - self.L1**2) + BU = a + BU0 + BD = BD0 + self.L1 * a + return BU, BD + + def ellipse_to_curvature(self, s2, th_mrad): + R = 2 * self.s1 * s2 / (self.s1 + s2) / np.sin(th_mrad / 1000) + curv = (1 / R) * 1000 * self.curv_approx_fact + return curv + + def curvature_to_ellipse(self, curv, th_mrad): + curv0 = curv / self.curv_approx_fact / 1000 + R = 1 / curv0 + s2 = self.s1 / (2 * self.s1 / (R * np.sin(th_mrad / 1000)) - 1) + return s2 + + def get_benders(self, th=2.0, defocus_mm=0.0, user_asymmetry=0.0): + asym = self.asym0 + user_asymmetry + s2_target = self.s2 + defocus_mm / 1000 + curv = self.ellipse_to_curvature(s2_target, th) + BU, BD = self.curvature_to_bend(curv, asym) + return BU, BD + + def readback(self, BU, BD, th=2.0): + curv, asym = self.bend_to_curvature(BU, BD) + s2_rb = self.curvature_to_ellipse(curv, th) + defocus_mm = (s2_rb - self.s2) * 1000 + bend_rad_m = 1/curv *1000 + return { + "curvature": curv, + "bend_rad_m": bend_rad_m, + "asymmetry": asym, + "s2": s2_rb, + "defocus_mm": defocus_mm + } + + + + diff --git a/pxii_bec/macros/Undu_Helpers.py b/pxii_bec/macros/Undu_Helpers.py index 12c5ead..eaf056c 100755 --- a/pxii_bec/macros/Undu_Helpers.py +++ b/pxii_bec/macros/Undu_Helpers.py @@ -227,11 +227,11 @@ def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500): ) resol = (g_high - g_low) / nsteps print(f"nsteps = {nsteps}; resolution is {resol} mm") - dock_area = bec.gui.new("LongGapScan") - wr = dock_area.new(gui.available_widgets.Waveform) + dock_area = bec.gui.new("LongGapScan", geometry = [4000, 900, 1200, 700]) + wr = dock_area.new(bec.gui.available_widgets.Waveform) mot = dev.id_gap det = dev.lu_bpmsum - wr.plot(x_name=mot.name, y_name=det.name) ## names first ! + wr.plot(device_x=mot, device_y=det) ## names first ! wr.x_label = mot.name wr.y_label = det.name g0 = dev.id_gap.readback.get() @@ -304,11 +304,11 @@ def gscan(centre=0, gomax=0, detune=0): """ import time - dock_area = bec.gui.new() - wr = dock_area.new(gui.available_widgets.Waveform) + dock_area = bec.gui.new(name="GapScan", geometry = [4000, 900, 700, 700]) + wr = dock_area.new(bec.gui.available_widgets.Waveform) mot = dev.id_gap det = dev.lu_bpmsum - wr.plot(x_name=mot.name, y_name=det.name) ## names first ! + wr.plot(device_x=mot, device_y=det) ## names first ! # wr.plot(x=mot.name,y=det.name) ### this comes later wr.x_label = mot.name wr.y_label = det.name @@ -323,7 +323,7 @@ def gscan(centre=0, gomax=0, detune=0): # indmax = np.argmax(bpm_data) # gm = gap_data[indmax] - gcen, xm = fit_plot(gap_data, bpm_data, model="gauss") + gcen, xm = fit_plot(gap_data, bpm_data, model="voigt") if gomax: gm = xm diff --git a/pxii_bec/macros/beamline_planner.py b/pxii_bec/macros/beamline_planner.py index 217d589..aa99268 100755 --- a/pxii_bec/macros/beamline_planner.py +++ b/pxii_bec/macros/beamline_planner.py @@ -1,13 +1,15 @@ -"""Planner to move between beamline statesΩ""" +"""Planner to move between beamline states""" -import time from collections import defaultdict, deque from enum import Enum + # from enums import BeamlineState, TemperatureMode # from matcher import DeviceMatcher, nonzero_is_on + class BeamlineState(str, Enum): """List of beamline states""" + ROBOT_SAMPLE_EXCHANGE = "robot_sample_exchange" SAMPLE_ALIGNMENT = "sample_alignment" DATA_COLLECTION = "data_collection" @@ -22,6 +24,7 @@ class BeamlineState(str, Enum): class TemperatureMode(str, Enum): """List of temperature modes""" + CRYO = "cryo" ROOM_TEMP = "room_temp" @@ -59,7 +62,6 @@ class StateChangePlanner: target.update(self.modifiers[modifier]) return target - def move_to(self, state_name, modifier=None): """Move devices to the correct positions to achieve a given state""" if isinstance(state_name, str): @@ -124,12 +126,8 @@ class StateChangePlanner: config = self._merged_state(state, modifier) # Check if all devices match their expected positions - if all(self.devices[d].is_at(p) - for d, p in config.items() - if d not in ignore_keys - ): - # print(f"Current state: {state.name}, Modifier: {modifier.name if modifier else 'None'}") - matches.append((state.name, modifier.name if modifier else 'None')) + if all(self.devices[d].is_at(p) for d, p in config.items() if d not in ignore_keys): + matches.append((state.name, modifier.name if modifier else "None")) return matches if matches else None diff --git a/pxii_bec/macros/build_devices.py b/pxii_bec/macros/build_devices.py index 3c8dd2e..12bb5fd 100755 --- a/pxii_bec/macros/build_devices.py +++ b/pxii_bec/macros/build_devices.py @@ -1,14 +1,15 @@ -""" Build the sample environment devices""" +"""Build the sample environment devices""" + +import os import yaml # from position_device import PositionDevice -def motor_resolver(bec_name): - candidates = [ - bec_name, - bec_name.replace("_", "."), - ] +def motor_resolver(bec_name): + """Used to handle aerotech and smargon motors""" + + candidates = [bec_name, bec_name.replace("_", ".")] for path in candidates: try: @@ -24,9 +25,9 @@ def motor_resolver(bec_name): raise ValueError(f"Cannot resolve motor for '{bec_name}'") -def build_devices(yaml_file, mock_devices): - """ Build devices from the beamline states yaml""" +def build_devices(yaml_file, mock_devices): + """Build devices from the beamline states yaml""" state_devices = {} @@ -41,30 +42,103 @@ def build_devices(yaml_file, mock_devices): if not user: continue + if bec_name in ("aerotech", "smargon"): - tol = user.get("tol", 0.1) + tol = user.get("tol", 0.01) - positions = { - k: v for k, v in user.items() - if k not in ("type", "tol") - } + for axis in ["x", "y", "z", "u", "chi", "phi"]: - allow_arbitrary = (user["type"] == "continuous") - - + positions = user.get(axis) - pos_dev = PositionDevice( - bec_name=bec_name, - mot_device = motor_resolver(bec_name), - positions=positions, - tol=tol, - allow_arbitrary=allow_arbitrary, - use_mock=bec_name in mock_devices, - ) + if positions is None: + continue + + component_name = f"{bec_name}_{axis}" + + pos_dev = PositionDevice( + bec_name=component_name, + mot_device=motor_resolver(component_name), + positions=positions, + tol=tol, + allow_arbitrary=True, + use_mock=component_name in mock_devices, + ) + + state_devices[component_name] = pos_dev + + else: + + tol = user.get("tol", 0.1) + allow_arbitrary = user.get("type") == "continuous" + + positions = {k: v for k, v in user.items() if k not in ("type", "tol")} + + pos_dev = PositionDevice( + bec_name=bec_name, + mot_device=motor_resolver(bec_name), + positions=positions, + tol=tol, + allow_arbitrary=allow_arbitrary, + use_mock=bec_name in mock_devices, + ) + + state_devices[bec_name] = pos_dev - state_devices[bec_name] = pos_dev return state_devices +# def update_position(device, position, value, axis=None): +# """Update the user parameter saved positions for a device""" +# params = device.user_parameter + +# if axis is None: +# # Is this a nested structure? +# nested_keys = [k for k, v in params.items() if isinstance(v, dict)] + +# if nested_keys: +# raise ValueError( +# f"{device.name} has nested parameters " +# f"({nested_keys}); specify axis=..." +# ) + +# device.update_user_parameter({position: value}) +# return + +# axis_params = params[axis].copy() +# axis_params[position] = value +# device.update_user_parameter({axis: axis_params}) +# # Save the updated values to the device yaml file +# # and re-initialise +# beamline = os.environ["BEAMLINE"] +# env = Environment(beamline = beamline) +# bec.config.save_current_session(env.devices_file) +# return init_beamline_environment() + + +def update_position(device, position, value, axis=None): + """Update the user parameter saved positions for a device""" + params = device.user_parameter + + if axis is None: + nested_keys = [k for k, v in params.items() if isinstance(v, dict)] + + if nested_keys: + raise ValueError( + f"{device.name} has nested parameters " f"({nested_keys}); specify axis=..." + ) + + device.update_user_parameter({position: value}) + + else: + axis_params = params[axis].copy() + axis_params[position] = value + device.update_user_parameter({axis: axis_params}) + + # Save the updated values to the device yaml file + beamline = os.environ["BEAMLINE"] + env = Environment(beamline=beamline) + bec.config.save_current_session(env.devices_file) + + return init_beamline_environment() diff --git a/pxii_bec/macros/check.py b/pxii_bec/macros/check.py index b5975f3..b37f88d 100755 --- a/pxii_bec/macros/check.py +++ b/pxii_bec/macros/check.py @@ -25,15 +25,12 @@ class Status(Enum): Status.ERROR: "red", Status.UNKNOWN: "blue", }[self] - + @property def color_scilog(self): - return { - Status.OK: "green", - Status.WARNING: "", - Status.ERROR: "red", - Status.UNKNOWN: "", - }[self] + return {Status.OK: "green", Status.WARNING: "", Status.ERROR: "red", Status.UNKNOWN: ""}[ + self + ] # ------------------------------------------------------------------- @@ -45,7 +42,7 @@ class Status(Enum): class HealthCheckResult: name: str - description: str + description: str status: Status value: Any = None @@ -59,50 +56,34 @@ class HealthCheckResult: if self.status == Status.OK: return f"[{self.status.name}] {self.description}" - return ( - f"[{self.status.name}] " - f"{self.description}: {self.message}" - ) - + return f"[{self.status.name}] " f"{self.description}: {self.message}" + def formatted_message(self): if self.status == Status.OK: return f"[{self.status.name} {self.name}]" - - return ( - f"[{self.status.name}] " - f"{self.description}: {self.message}" - ) + + return f"[{self.status.name}] " f"{self.description}: {self.message}" + # ------------------------------------------------------------------- # Send to SciLog # ------------------------------------------------------------------- + def send_to_scilog(results): - counts = { - Status.OK: 0, - Status.WARNING: 0, - Status.ERROR: 0, - Status.UNKNOWN: 0, - } + counts = {Status.OK: 0, Status.WARNING: 0, Status.ERROR: 0, Status.UNKNOWN: 0} for result in results: counts[result.status] += 1 - msg = bec.messaging.scilog.new() - msg.add_text( - "Beamline Health Summary", - bold = True - ) + msg.add_text("Beamline Health Summary", bold=True) msg.add_text("\n") for status, count in counts.items(): - msg.add_text( - f"{status.name:<10}: {count}", - bold=True, - ) + msg.add_text(f"{status.name:<10}: {count}", bold=True) msg.add_text("\n") @@ -110,7 +91,7 @@ def send_to_scilog(results): msg.add_text( result.formatted_message(), # bold=result.status != Status.OK, - color = result.status.color_scilog + color=result.status.color_scilog, ) msg.add_text("\n") msg.add_tags(["beamline health check"]) @@ -121,14 +102,12 @@ def send_to_scilog(results): # Configuration # ------------------------------------------------------------------- + @dataclass class BeamlineHealthConfig: signal_rules: dict[str, Callable] = field( - default_factory=lambda: { - "cam": lambda x: x != 0, - "bpm": lambda x: x != 0, - } + default_factory=lambda: {"cam": lambda x: x != 0, "bpm": lambda x: x != 0} ) motor_tolerances: dict[str, float] = field( @@ -160,11 +139,7 @@ def check_signals(devices, config: BeamlineHealthConfig): results = [] - signal_devices = [ - (name, obj) - for name, obj in devices - if isinstance(obj, Signal) - ] + signal_devices = [(name, obj) for name, obj in devices if isinstance(obj, Signal)] for name, obj in signal_devices: @@ -255,11 +230,7 @@ def check_motors(devices, config: BeamlineHealthConfig): results = [] ignore = ["id_gap", "smargon"] - motor_devices = [ - (name, obj) - for name, obj in devices - if isinstance(obj, Positioner) - ] + motor_devices = [(name, obj) for name, obj in devices if isinstance(obj, Positioner)] for name, obj in motor_devices: @@ -342,10 +313,7 @@ def check_motors(devices, config: BeamlineHealthConfig): diff = abs(actual - setpoint) - tolerance = config.motor_tolerances.get( - name, - config.default_motor_tolerance, - ) + tolerance = config.motor_tolerances.get(name, config.default_motor_tolerance) if diff > tolerance: @@ -389,6 +357,8 @@ def check_motors(devices, config: BeamlineHealthConfig): ) return results + + # ------------------------------------------------------------------- # General Info # ------------------------------------------------------------------- @@ -397,12 +367,14 @@ def info(): gap = dev.id_gap.position energy = get_current_energy() # state = get_state() - print(f"[INFO] Machine: {current:.4g} mA\n" - f"[INFO] Undulator gap: {gap:.4g}\n" - f"[INFO] Beamline energy: {energy:.6g} eV\n") - # f"[INFO] Beamline state: {state}") - - + print( + f"[INFO] Machine: {current:.4g} mA\n" + f"[INFO] Undulator gap: {gap:.4g}\n" + f"[INFO] Beamline energy: {energy:.6g} eV\n" + ) + # f"[INFO] Beamline state: {state}") + + # def get_state(): # states = [] # res = planner.current_state() @@ -431,9 +403,7 @@ def check2(config: BeamlineHealthConfig | None = None): # Sort by severity # --------------------------------------------------------------- - results.sort( - key=lambda r: r.status.value, - ) + results.sort(key=lambda r: r.status.value) return results @@ -447,7 +417,6 @@ def summary_text(results): timestamp = datetime.now().strftime("%Y-%m-%d %H:%M") - n_ok = sum(r.status == Status.OK for r in results) n_warn = sum(r.status == Status.WARNING for r in results) @@ -472,22 +441,19 @@ def summary_text(results): # ------------------------------------------------------------------- # Filter results # ------------------------------------------------------------------- -def filter_results(results, statuses = None): +def filter_results(results, statuses=None): if statuses is None: return results - - return [ - r for r in results - if r.status in statuses - ] + + return [r for r in results if r.status in statuses] + # ------------------------------------------------------------------- # CLI Entry Point # ------------------------------------------------------------------- -def run_check(show_all= False, scilog=False): - +def run_check(show_all=False, scilog=False): results = check2() @@ -496,36 +462,22 @@ def run_check(show_all= False, scilog=False): info() problem_results = filter_results( - results, - statuses={ - Status.WARNING, - Status.ERROR, - Status.UNKNOWN, - } + results, statuses={Status.WARNING, Status.ERROR, Status.UNKNOWN} ) if scilog: send_to_scilog(problem_results) - + if not show_all: - results = filter_results( - results, - statuses={ - Status.WARNING, - Status.ERROR, - Status.UNKNOWN - } - ) + results = filter_results(results, statuses={Status.WARNING, Status.ERROR, Status.UNKNOWN}) for result in results: print(result) - - disclaimer = "\n======================================================\n" \ - "This reports: \n 1. If motors are in error state, if moving, or if readback != setpoint" \ - "\n 2. If camera or BPMs are reading 0 (may or may not be an error)" \ - "\nN.B. The motor checks are only done if they exist as standard ophyd motors in BEC." \ - "\nTo see which devices were checked use run_check(show_all=True)." + + disclaimer = ( + "\n======================================================\n" + "This reports: \n 1. If motors are in error state, if moving, or if readback != setpoint" + "\n 2. If camera or BPMs are reading 0 (may or may not be an error)" + "\nN.B. The motor checks are only done if they exist as standard ophyd motors in BEC." + "\nTo see which devices were checked use run_check(show_all=True)." + ) print(disclaimer) - - - - diff --git a/pxii_bec/macros/dependencies.py b/pxii_bec/macros/dependencies.py index f83296c..6e9e522 100755 --- a/pxii_bec/macros/dependencies.py +++ b/pxii_bec/macros/dependencies.py @@ -1,30 +1,14 @@ """Planner dependencies""" + + def planner_deps(): """Define the dependencies between beamline positions""" return { - ("bs_z", "samp"): [ - ("aerotech_x", "out"), - ("diag_y", "out"), - ("coll_y", "out"), - ], - ("aerotech_x", "in"): [ - ("diag_y", "out"), - ("bs_z", "safe"), - ], - ("aerotech_x", "out"): [ - ("diag_y", "out"), - ("bs_z", "safe"), - ], - ("diag_y", "scint"): [ - ("aerotech_x", "out"), - ("bs_z", "safe"), - ("cryo_pos", "out"), - ], - ("diag_y", "i1"): [ - ("aerotech_x", "out"), - ("bs_z", "safe"), - ("cryo_pos", "out"), - ], + ("bs_z", "samp"): [("aerotech_x", "out"), ("diag_y", "out"), ("coll_y", "out")], + ("aerotech_x", "in"): [("diag_y", "out"), ("bs_z", "safe")], + ("aerotech_x", "out"): [("diag_y", "out"), ("bs_z", "safe")], + ("diag_y", "scint"): [("aerotech_x", "out"), ("bs_z", "safe"), ("cryo_pos", "out")], + ("diag_y", "i1"): [("aerotech_x", "out"), ("bs_z", "safe"), ("cryo_pos", "out")], ("bs_pos", "out"): [("bs_z", "safe")], ("bs_pos", "in"): [("bs_z", "safe")], ("diag_y", "out"): [("bs_z", "safe")], diff --git a/pxii_bec/macros/devices_manager.py b/pxii_bec/macros/devices_manager.py index 64b5ab3..47dddaf 100755 --- a/pxii_bec/macros/devices_manager.py +++ b/pxii_bec/macros/devices_manager.py @@ -10,13 +10,14 @@ class DeviceManager: """Class for building devices and attaching safety guards and policies.""" @staticmethod - def initialize_devices(state_devices_file, rest_devices_file, mock_devices): + # def initialize_devices(state_devices_file, rest_devices_file, mock_devices): + def initialize_devices(devices_file, mock_devices): """ Initializes sample environment devices from the specified file. """ - devices = build_devices(state_devices_file, mock_devices) - rest_devices = build_devices(rest_devices_file, mock_devices) - devices.update(rest_devices) + devices = build_devices(devices_file, mock_devices) + # rest_devices = build_devices(rest_devices_file, mock_devices) + # devices.update(rest_devices) attach_guards(devices) attach_policies(devices) return devices diff --git a/pxii_bec/macros/guards.py b/pxii_bec/macros/guards.py index 0446e61..1306af9 100755 --- a/pxii_bec/macros/guards.py +++ b/pxii_bec/macros/guards.py @@ -15,9 +15,7 @@ class AtPositionGuard: def check(self): """Check if the device is in the specified position.""" if self.device.pos != self.pos: - raise GuardViolation( - f"{self.device.bec_name} must be in the '{self.pos}' position" - ) + raise GuardViolation(f"{self.device.bec_name} must be in the '{self.pos}' position") # print("move allowed") return True diff --git a/pxii_bec/macros/init_beamline.py b/pxii_bec/macros/init_beamline.py index 6c3eb80..cae0630 100755 --- a/pxii_bec/macros/init_beamline.py +++ b/pxii_bec/macros/init_beamline.py @@ -8,8 +8,10 @@ from dataclasses import dataclass # from dependencies import planner_deps # from beamline_planner import StateChangePlanner + @dataclass class Environment: + """Define the device and state yaml files for each beamline""" device_mocks: dict[str, bool] = None beamline: str = None @@ -21,18 +23,17 @@ class Environment: # "rest": "pxi-rest-devices.yaml", # "states": "pxi-beamline-states.yaml", # }, - "x10sa" : { + "x10sa": { "devdir": "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/", - "state": "pxii-state-devices.yaml", - "rest": "pxii-rest-devices.yaml", + "devices": "pxii-devices.yaml", "states": "pxii-beamline-states.yaml", }, - "x06da" : { + "x06da": { "devdir": "/sls/x06da/config/bec/production/pxiii_bec/pxiii_bec/device_configs/", "state": "pxiii-state-devices.yaml", "rest": "pxiii-rest-devices.yaml", "states": "pxiii-beamline-states.yaml", - } + }, } def __post_init__(self): @@ -60,34 +61,23 @@ class Environment: "xrf_pos": "mock", } - mocks = sorted( - name - for name, backend in self.device_mocks.items() - if backend == "mock" - ) + mocks = sorted(name for name, backend in self.device_mocks.items() if backend == "mock") - reals = sorted( - name - for name, backend in self.device_mocks.items() - if backend == "real" - ) + reals = sorted(name for name, backend in self.device_mocks.items() if backend == "real") - print(f"Mock devices ({len(mocks)}): {mocks}") - print(f"Real devices ({len(reals)}): {reals}") + # print(f"Mock devices ({len(mocks)}): {mocks}") + # print(f"Real devices ({len(reals)}): {reals}") try: cfg = self.beamline_configs[self.beamline] except KeyError: - raise ValueError( - f"Unknown beamline '{self.beamline}'" - ) + raise ValueError(f"Unknown beamline '{self.beamline}'") devdir = cfg["devdir"] - self.state_devices_file = devdir + cfg["state"] - self.rest_devices_file = devdir + cfg["rest"] + self.devices_file = devdir + cfg["devices"] self.states_file = devdir + cfg["states"] - + mock_start_positions = { "aerotech_x": "in", "aerotech_y": "mount", @@ -107,7 +97,7 @@ class Environment: "smargon_z": "mount", "smargon_chi": "mount", "smargon_phi": "mount", - "xrf_pos": "out", + "xrf_pos": "out", } @property @@ -116,7 +106,8 @@ class Environment: for name, device in self.device_mocks.items(): if device == "mock": mock_names.add(name) - return mock_names + return mock_names + def init_beamline_environment(): """ @@ -125,15 +116,11 @@ def init_beamline_environment(): beamline = os.environ["BEAMLINE"] - env = Environment(beamline = beamline) + env = Environment(beamline=beamline) # Initialize devices device_manager = DeviceManager() - devices = device_manager.initialize_devices( - env.state_devices_file, - env.rest_devices_file, - env.mock_devices - ) + devices = device_manager.initialize_devices(env.devices_file, env.mock_devices) # Initialize states state_manager = DefineStatesManager() @@ -144,7 +131,7 @@ def init_beamline_environment(): # Setup planner planner = StateChangePlanner(devices, states, allow_modifiers, deps) - print("Initializing beamline state planner") + print("Initializing beamline state planner and devices") # Set mock motor starting positions @@ -155,9 +142,4 @@ def init_beamline_environment(): except Exception as e: print(f"{e} error when setting {mock_dev}") - return devices, planner - - - - diff --git a/pxii_bec/macros/katscripts.py b/pxii_bec/macros/katscripts.py new file mode 100755 index 0000000..3d36c69 --- /dev/null +++ b/pxii_bec/macros/katscripts.py @@ -0,0 +1,1547 @@ +"""Some simple scripts for commissioning""" + +import time, os +from datetime import datetime +from dataclasses import dataclass +import numpy as np +import matplotlib.pyplot as plt +from scipy.signal import find_peaks as fp +import pandas as pd +from scipy.optimize import linear_sum_assignment + + +def goto1a(): + """Set beamline to 1A position""" + bragg_angle = 160.117 + perp_dist = 0.0389 + gap = 5.319 + umv(dev.dcm_bragg, bragg_angle) + umv(dev.dcm_perp, perp_dist) + umv(dev.id_gap, gap) + + +def bragg_scan(): + """Energy scans from 6 to 18 keV at various gap positions""" + + start_bragg = 110.05 # 18 keV + end_bragg = 335.77 # 6 keV + steps = 1200 + exp = 0.05 + gap = 7.5 + umv(dev.id_gap, gap) + time.sleep(10) + while gap < 9.6: + print(f"Scanning the dcm_bragg from {start_bragg} to {end_bragg} at a gap of {gap: .2f} mm") + umv(dev.id_gap, gap) + scans.line_scan( + dev.dcm_bragg, start_bragg, end_bragg, steps=steps, exp_time=exp, relative=False + ) + gap += 0.5 + + +def move_xeye(direction): + """Move the xeye in or out""" + if direction == "in": + umv(dev.ss_xicam_x, 7.0) + else: + umv(dev.ss_xicam_x, -7) + + +def close_fe_slits(close=True): + """Close FE slits to (0.3,0.3) or open the FE slits to (2.0,1.0)""" + if close: + umv(dev.fe_sl_xsize, 0.3, dev.fe_sl_ysize, 0.3) + else: + umv(dev.fe_sl_xsize, 1.5, dev.fe_sl_ysize, 1.0) + + +def energy_checks(start_energy=8000, end_energy=20000): + """Check gap, pitch and intensities at different energies""" + f = open("luts/test.csv", "a", encoding="utf-8") + + gaps = { + 8000: 8.04, + 9000: 9.55, + 10000: 7.45, + 11000: 8.46, + 12000: 7.09, + 13000: 7.77, + 14000: 8.61, + 15000: 9.57, + 16000: 8.09, + 17000: 7.18, + 18000: 7.67, + 19000: 8.24, + 20000: 7.52, + } + for energy in range(start_energy, end_energy, 1000): + f = open("luts/test.csv", "a", encoding="utf-8") + print(f"Moving to {energy} eV") + umv(dev.id_gap, gaps[energy]) + move_and_set_dcm(energy) + if energy < 16000: + close_fe_slits(True) + go_to_peak( + dev.id_gap, dev.lu_bpmsum, -0.3, 0.3, 40, relative=True, confirm=False, gomax=True + ) + scan_fe() + close_fe_slits(True) + go_to_peak( + dev.id_gap, dev.lu_bpmsum, -0.1, 0.1, 15, relative=True, confirm=False, gomax=True + ) + go_to_peak( + dev.id_gap, + dev.lu_bpmsum, + -0.025, + 0.025, + 15, + relative=True, + confirm=False, + gomax=True, + ) + close_fe_slits(False) + + else: + umv(dev.s1_xsize, 0.5) + go_to_peak( + dev.id_gap, dev.bcu_bpmsum, -0.3, 0.3, 40, relative=True, confirm=False, gomax=True + ) + scan_fe() + go_to_peak( + dev.id_gap, dev.bcu_bpmsum, -0.1, 0.1, 15, relative=True, confirm=False, gomax=True + ) + umv(dev.s1_xsize, 2.5) + mono_pitch_scan() + gap = dev.id_gap.read()["id_gap"]["value"] + pitch = dev.dcm_pitch.read()["dcm_pitch"]["value"] + fe_x = dev.fe_sxcen.read()["fe_sxcen"]["value"] + fe_y = dev.fe_sycen.read()["fe_sycen"]["value"] + lu_read = dev.lu_bpmsum.read()["lu_bpmsum"]["value"] + bsc_read = dev.bsc_bpmsum.read()["bsc_bpmsum"]["value"] + bcu_read = dev.bcu_bpmsum.read()["bcu_bpmsum"]["value"] + f.write( + f"{energy}, {gap: .5g}, {pitch: .5g}, {lu_read: .5g}, " + f"{bsc_read: .5g}, {bcu_read: .5g}, " + f"{fe_x: .5g}, {fe_y: .5g}\n" + ) + + f.close() + + +def scan_fe(): + """Scan the FE slits in X and Y""" + print("Scanning FE slits in X") + umv(dev.fe_sxsize, 0.05, dev.fe_sysize, 2) + go_to_peak(dev.fe_sxcen, dev.lu_bpmsum, -1.5, 1.5, 20, confirm=False, relative=True) + print("Scanning FE slits in Y") + umv(dev.fe_sxsize, 0.3, dev.fe_sysize, 0.05) + go_to_peak(dev.fe_sycen, dev.lu_bpmsum, -1.2, 1.2, 15, confirm=False, relative=True) + close_fe_slits(False) + + +def scan_gap(): + """Scan the gap and monitor on lu_bpmsum or bcu_bpmsum""" + # close_fe_slits(True) + current_gap = dev.id_gap.read()["id_gap"]["value"] + if current_gap > 4.6: + go_to_peak( + dev.id_gap, dev.lu_bpmsum, -0.1, 0.1, 25, relative=True, confirm=False, gomax=False + ) + else: + go_to_peak( + dev.id_gap, dev.lu_bpmsum, 4.5, 4.75, 25, relative=False, confirm=False, gomax=False + ) + # close_fe_slits(False) + + +def record_pitch(): + """Record the pitch and perp distance to file""" + with open("luts/pitch_record.csv", "a", encoding="utf-8") as f: + current_energy = get_current_energy() + pitch = dev.dcm_pitch.read()["dcm_pitch"]["value"] + gap = dev.id_gap.read()["id_gap"]["value"] + f.write(f"{current_energy: .0f}, {pitch: .5g}, {gap: .4g}\n") + f.close() + + +def record_roll(): + """Record the roll and perp distance to file""" + with open("luts/roll_record.csv", "a", encoding="utf-8") as f: + current_energy = get_current_energy() + roll = dev.dcm_froll.read()["dcm_froll"]["value"] + f.write(f"{current_energy:.0f}, {roll:.5g}\n") + f.close() + + +def record_perp(): + """Check perp calibrations at various energies""" + with open("luts/perp_record.csv", "a", encoding="utf-8") as f: + current_energy = get_current_energy() + perp = dev.dcm_perp.read()["dcm_perp"]["value"] + ss_xicam_x = dev.ss_xicam_x.read()["ss_xicam_x"]["value"] + ss_xicam_y = dev.ss_xicam_y.read()["ss_xicam_y"]["value"] + f.write(f"{current_energy:.0f},{perp:.5g},{ss_xicam_x:.5g},{ss_xicam_y:.5g}\n") + f.close() + + +def beam_centre_from_bsc(): + """Compute the beam centre from the bsc_cam""" + y = dev.ss_xicam_x.read()["ss_xicam_x"]["value"] + x = dev.ss_xicam_y.read()["ss_xicam_y"]["value"] + beampos = {"xpos": x, "ypos": y} + print(f"X is {x: .4g}, Y is {y: .4g}") + return beampos + + +def generate_dcm_lut(start_energy=26500, end_energy=30500, step=500): + """Generate a lookup table for the dcm from start_energy to end_energy in steps of step""" + now = datetime.now() + fnow = now.strftime("%d%m%H%M") + filename = f"luts/{fnow}_lut.csv" + with open(filename, "w", encoding="utf-8") as f: + f.write("energy,harmonic,gap,pitch,roll,perp,ss_xicam_x,ss_xicam_y\n") + + for energy in range(start_energy, end_energy, step): + print(f"Moving to {energy: .0f}eV") + bl_energy(energy, mono_scan=False) + scan_gap() + mono_pitch_scan() + gap = dev.id_gap.read()["id_gap"]["value"] + harm = Gap() + h = harm.get_harmonic_by_energy(energy) + pitch = dev.dcm_pitch.read()["dcm_pitch"]["value"] + roll = dev.dcm_froll.read()["dcm_froll"]["value"] + perp = dev.dcm_perp.read()["dcm_perp"]["value"] + auto_exposure(cam="ss_xicam", max_iter=25) + x = dev.ss_xicam_x.read()["ss_xicam_x"]["value"] + y = dev.ss_xicam_y.read()["ss_xicam_y"]["value"] + with open(filename, "a", encoding="utf-8") as f: + f.write( + f"{energy:.0f},{h},{gap:.5g},{pitch:.5g},{roll:.4g},{perp:.5g},{x:.4g},{y:.4g}\n" + ) + umv(dev.id_gap, 20.0) + + +def write_lut(): + """Write DCM parameters to file""" + filename = "luts/manual_big.csv" + energy = get_current_energy() + mono_pitch_scan() + roll_scan_to_target() + gap = dev.id_gap.read()["id_gap"]["value"] + pitch = dev.dcm_pitch.read()["dcm_pitch"]["value"] + roll = dev.dcm_froll.read()["dcm_froll"]["value"] + perp = dev.dcm_perp.read()["dcm_perp"]["value"] + x = dev.ss_xicam_x.read()["ss_xicam_x"]["value"] + y = dev.ss_xicam_y.read()["ss_xicam_y"]["value"] + with open(filename, "a", encoding="utf-8") as f: + f.write(f"{energy:.0f},{gap:.5g},{pitch:.5g},{roll:.4g},{perp:.5g},{x:.4g},{y:.4g}\n") + + +def measure_beamsize(cam="samcam"): + auto_exposure("samcam", max_iter=20) + a = dev.samcam_xsig.read()["samcam_xsig"]["value"] + b = dev.samcam_ysig.read()["samcam_ysig"]["value"] + zoom = dev.scam_zoom.read()["scam_zoom"]["value"] + sx = calc_scam_microns(a, zoom=zoom) * 2.35 + sy = calc_scam_microns(b, zoom=zoom) * 2.35 + print(f"FWHM in um : {sx, sy}") + return sx, sy + + +def write_beamsize(): + """Write beam size and flux to file""" + filename = "luts/beamsizes.csv" + with open(filename, "a", encoding="utf-8") as f: + f.write("lens_config,size_x,size_y,i1\n") + lens_config = input("Which lenses are in?") + if SE.scin.checkpos: + filters("out") + sx, sy = measure_beamsize() + else: + scin("in") + filters("out") + sx, sy = measure_beamsize() + i1_reading = i1() + with open(filename, "a", encoding="utf-8") as f: + f.write(f"{lens_config},{sx:.4g},{sy:.4g},{i1_reading:.4g}\n") + + +def beamsize(size): + """WIP to dial up different beam sizes""" + # Set mirror trans and pitch to default settings for 12.4 keV + # vlaues from a 2025 + # umv(dev.vfm_vert,2.136) + # umv(dev.vfm_pitch, 2.695) + # umv(dev.hfm_lat, 1.64) + # umv(dev.hfm_pitch, 2.9844) + umv(dev.vfm_vert, 2.5301) + umv(dev.vfm_pitch, 2.60) + umv(dev.hfm_lat, 1.6586) + umv(dev.hfm_pitch, 2.9964) + print(f"changing beam size to {size}") + + # values = {"xs": {"vbu": -0.9095, "vbd": -1.246, "hbu": -2.9375, "hbd": -5.698}, + # "s": {"vbu": -0.8365, "vbd": -1.22, "hbu": -2.804, "hbd": -5.473}, + # "m": {"vbu": -0.7865, "vbd": -1.17, "hbu": -2.604, "hbd": -5.273}, + # "l": {"vbu": -0.7459, "vbd": -1.13, "hbu": -2.504, "hbd": -5.173}} + # values = {"xs": {"vbu": -0.9095, "vbd": -1.246, "hbu": -2.8075, "hbd": -5.668}, + # "s": {"vbu": -0.8606, "vbd": -1.195, "hbu": -2.6975, "hbd": -5.5585}, + # "m": {"vbu": -0.8410, "vbd": -1.465, "hbu": -2.5575, "hbd": -5.418}, + # "l": {"vbu": -0.762, "vbd": -1.094, "hbu": -2.4582, "hbd": -5.3187}} + values = { + "xs": {"vbu": -0.741, "vbd": -1.206, "hbu": -2.869, "hbd": -5.819}, + "s": {"vbu": -0.7101, "vbd": -1.176, "hbu": -2.7133, "hbd": -5.5535}, + "m": {"vbu": -0.6601, "vbd": -1.126, "hbu": -2.5133, "hbd": -5.3535}, + "l": {"vbu": -0.6196, "vbd": -1.086, "hbu": -2.4133, "hbd": -5.2535}, + } + umv( + dev.vfm_bu, + values[size]["vbu"], + dev.vfm_bd, + values[size]["vbd"], + dev.hfm_bu, + values[size]["hbu"], + dev.hfm_bd, + values[size]["hbd"], + ) + print("Setting camera exposure time") + auto_exposure() + xsig = dev.samcam_xsig.read()["samcam_xsig"]["value"] + ysig = dev.samcam_ysig.read()["samcam_ysig"]["value"] + print(f"Beam has Xsigma = {xsig:.3g}, Ysigma = {ysig:.3g}") + + # if size == 'm': + # move_to_x() + # print(f"Beam has Xsigma = {xsig:.3g}, Ysigma = {ysig:.3g}") + # return + # if size == 'l': + # move_to_x() + # move_to_y() + # umv(dev.hfm_pitch, 2.9684) + # print(f"Beam has Xsigma = {xsig:.3g}, Ysigma = {ysig:.3g}") + # return + # else: + # move_to_x() + # move_to_y() + # print(f"Beam has Xsigma = {xsig:.3g}, Ysigma = {ysig:.3g}") + + +def scan_Ge(): + scanbefore = 30 # eV + scanafter = 30 # eV + stepsize = 0.5 # eV + edge_Ge = 11103.1 # eV + + scanstart = edge_Ge + scanafter + scanend = edge_Ge - scanbefore + bragg_start = convert_from_energy(scanstart)["bragg_angle_mrad"] + bragg_end = convert_from_energy(scanend)["bragg_angle_mrad"] + stepnumber = abs(int((scanend - scanstart) / stepsize)) + + print(f"Changing energy to {scanstart}") + # bl_energy(scanstart) + # scan_gap() + umv(dev.bsc_f4_x, 6) # Put Ge filter in place + print(f"scanning from {bragg_start} to {bragg_end} with {stepnumber} steps") + s = scans.line_scan(dev.dcm_bragg, bragg_start, bragg_end, steps=stepnumber, relative=False) + print(s) + umv(dev.bsc_f4_x, 2) + + +def cal_samcam_fixed_x(): + lat = dev.hfm_lat.read()["hfm_lat"]["value"] + pitch = dev.hfm_pitch.read()["hfm_pitch"]["value"] + scanpoints = np.linspace(lat - 0.1, lat + 0.1, 7) + zoom_high = 800 + zoom_low = 200 + highs, lows = [], [] + high_lat, low_lat = [], [] + + # high zoom + umv(dev.scam_zoom, zoom_high) + auto_exposure("samcam") + for i in scanpoints: + umv(dev.hfm_lat, i) + umv(dev.hfm_pitch, pitch) + time.sleep(0.2) + high_y = dev.samcam_x.read()["samcam_x"]["value"] + high_x = dev.hfm_lat.read()["hfm_lat"]["value"] + print(f"Xpos at zoom {zoom_high} is {high_y}") + highs.append(high_y) + high_lat.append(high_x) + + umv(dev.scam_zoom, zoom_low) + auto_exposure("samcam") + for i in scanpoints: + umv(dev.hfm_lat, i) + umv(dev.hfm_pitch, pitch) + time.sleep(0.2) + low_y = dev.samcam_x.read()["samcam_x"]["value"] + low_x = dev.hfm_lat.read()["hfm_lat"]["value"] + print(f"Xpos at zoom {zoom_low} is {low_y}") + lows.append(low_y) + low_lat.append(low_x) + + umv(dev.hfm_lat, lat) + umv(dev.hfm_pitch, 2.9844) + + # Convert to numpy arrays + x_high = np.array(high_lat) + x_low = np.array(low_lat) + y_high = np.array(highs) + y_low = np.array(lows) + + # Fit linear models: y = m*x + b + m_high, b_high = np.polyfit(x_high, y_high, 1) + m_low, b_low = np.polyfit(x_low, y_low, 1) + + # Intersection point + x_intersect = (b_low - b_high) / (m_high - m_low) + y_intersect = m_high * x_intersect + b_high + + print(f"\nIntersection at:") + print(f" HFM_lat = {x_intersect:.5f}") + print(f" SamCam_x = {y_intersect:.2f}") + + # --- Plot --- + plt.figure(figsize=(7, 5)) + plt.scatter(x_high, y_high, color="red", label=f"Zoom = {zoom_high} data") + plt.scatter(x_low, y_low, color="blue", label=f"Zoom = {zoom_low} data") + + x_fit = np.linspace(min(x_high), max(x_high), 100) + plt.plot(x_fit, m_high * x_fit + b_high, "r--", label=f"Fit: Zoom {zoom_high}") + plt.plot(x_fit, m_low * x_fit + b_low, "b--", label=f"Fit: Zoom {zoom_low}") + + plt.scatter(x_intersect, y_intersect, color="green", s=80, zorder=5, label="Intersection") + + plt.xlabel("HFM Lat Position") + plt.ylabel("SamCam X") + plt.title("Zoom Calibration") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() + + +def cal_samcam_fixed_y(): + vert = dev.vfm_vert.read()["vfm_vert"]["value"] + pitch = dev.vfm_pitch.read()["vfm_pitch"]["value"] + scanpoints = np.linspace(vert - 0.1, vert + 0.1, 7) + zoom_high = 800 + zoom_low = 200 + highs, lows = [], [] + high_vert, low_vert = [], [] + + # high zoom + umv(dev.scam_zoom, zoom_high) + auto_exposure("samcam") + for i in scanpoints: + umv(dev.vfm_vert, i) + umv(dev.vfm_pitch, pitch) + time.sleep(0.2) + high_y = dev.samcam_y.read()["samcam_y"]["value"] + high_x = dev.vfm_vert.read()["vfm_vert"]["value"] + print(f"Ypos at zoom {zoom_high} is {high_y}") + highs.append(high_y) + high_vert.append(high_x) + + umv(dev.scam_zoom, zoom_low) + auto_exposure("samcam") + for i in scanpoints: + umv(dev.vfm_vert, i) + umv(dev.vfm_pitch, pitch) + time.sleep(0.2) + low_y = dev.samcam_y.read()["samcam_y"]["value"] + low_x = dev.vfm_vert.read()["vfm_vert"]["value"] + print(f"Ypos at zoom {zoom_low} is {low_y}") + lows.append(low_y) + low_vert.append(low_x) + + umv(dev.vfm_vert, vert) + umv(dev.vfm_pitch, pitch) + + # Convert to numpy arrays + x_high = np.array(high_vert) + x_low = np.array(low_vert) + y_high = np.array(highs) + y_low = np.array(lows) + + # Fit linear models: y = m*x + b + m_high, b_high = np.polyfit(x_high, y_high, 1) + m_low, b_low = np.polyfit(x_low, y_low, 1) + + # Intersection point + x_intersect = (b_low - b_high) / (m_high - m_low) + y_intersect = m_high * x_intersect + b_high + + print(f"\nIntersection at:") + print(f" VFM_vert = {x_intersect:.5f}") + print(f" SamCam_y = {y_intersect:.2f}") + + # --- Plot --- + plt.figure(figsize=(7, 5)) + plt.scatter(x_high, y_high, color="red", label=f"Zoom = {zoom_high} data") + plt.scatter(x_low, y_low, color="blue", label=f"Zoom = {zoom_low} data") + + x_fit = np.linspace(min(x_high), max(x_high), 100) + plt.plot(x_fit, m_high * x_fit + b_high, "r--", label=f"Fit: Zoom {zoom_high}") + plt.plot(x_fit, m_low * x_fit + b_low, "b--", label=f"Fit: Zoom {zoom_low}") + + plt.scatter(x_intersect, y_intersect, color="green", s=80, zorder=5, label="Intersection") + + plt.xlabel("VFM Vert Position") + plt.ylabel("SamCam Y") + plt.title("Zoom Calibration") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() + + +def correlate_froll(): + x_correlation = [] + y_correlation = [] + scanpoints = np.linspace(0, 0.2, 10) + for pos in scanpoints: + umv(dev.dcm_froll, pos) + xpos, ypos = compute_pos() + x_correlation.append(xpos) + y_correlation.append(ypos) + + x = np.array(scanpoints) + y1 = np.array(x_correlation) + y2 = np.array(y_correlation) + + xslope, xint = np.polyfit(x, y1, 1) + yslope, yint = np.polyfit(x, y2, 1) + + print(f"Fit for xpos is: y = {xslope}.x + {xint}") + print(f"Fit for ypos is: y = {yslope}.x + {yint}") + + plt.figure(figsize=(7, 5)) + # plt.scatter(x, y1, label='xpos') + plt.scatter(x, y2, label="beam y position", color="rebeccapurple") + + x_fit = np.linspace(min(x), max(x), 100) + # plt.plot(x_fit, xslope*x_fit + xint, 'r--', label=f'y = {xslope}*x + {xint}') + plt.plot( + x_fit, + yslope * x_fit + yint, + "r--", + label=f"y = {yslope:.3g}*x + ({yint:.3g})", + color="lightcoral", + ) + plt.xlabel("dcm fine roll (V)") + plt.ylabel("beam Y (from BCU BPM)") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() + + +def correlate_fpitch(): + x_correlation = [] + y_correlation = [] + scanpoints = np.linspace(0, 0.2, 10) + for pos in scanpoints: + umv(dev.dcm_fpitch, pos) + xpos, ypos = compute_pos() + x_correlation.append(xpos) + y_correlation.append(ypos) + + x = np.array(scanpoints) + y1 = np.array(x_correlation) + y2 = np.array(y_correlation) + + xslope, xint = np.polyfit(x, y1, 1) + yslope, yint = np.polyfit(x, y2, 1) + + print(f"Fit for xpos is: y = {xslope}.x + {xint}") + print(f"Fit for ypos is: y = {yslope}.x + {yint}") + + plt.figure(figsize=(7, 5)) + # plt.scatter(x, y1, label='xpos') + plt.scatter(x, y1, label="beam x position", color="rebeccapurple") + + x_fit = np.linspace(min(x), max(x), 100) + # plt.plot(x_fit, xslope*x_fit + xint, 'r--', label=f'y = {xslope}*x + {xint}') + plt.plot( + x_fit, xslope * x_fit + xint, label=f"y = {xslope:.3g}*x + ({xint:.3g})", color="lightcoral" + ) + plt.xlabel("dcm fine pitch (V)") + plt.ylabel("beam X (from BCU BPM)") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() + + +def correlate_hfm_lat(): + x_correlation = [] + lat = dev.hfm_lat.read()["hfm_lat"]["value"] + scanpoints = np.linspace(lat - 0.1, lat + 0.1, 10) + for pos in scanpoints: + umv(dev.hfm_lat, pos) + xpos, ypos = compute_pos() + x_correlation.append(xpos) + umv(dev.hfm_lat, lat) + + x = np.array(scanpoints) + y1 = np.array(x_correlation) + + xslope, xint = np.polyfit(x, y1, 1) + + print(f"Fit for xpos is: y = {xslope}.x + {xint}") + plt.figure(figsize=(7, 5)) + # plt.scatter(x, y1, label='xpos') + plt.scatter(x, y1, label="beam x position", color="rebeccapurple") + + x_fit = np.linspace(min(x), max(x), 100) + # plt.plot(x_fit, xslope*x_fit + xint, 'r--', label=f'y = {xslope}*x + {xint}') + plt.plot( + x_fit, xslope * x_fit + xint, label=f"y = {xslope:.5g}*x + ({xint:.5g})", color="lightcoral" + ) + plt.xlabel("HFM lateral (mm)") + plt.ylabel("beam X (from BCU BPM)") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() + + +def correlate_vfm_vert(): + y_correlation = [] + vert = dev.vfm_vert.read()["vfm_vert"]["value"] + scanpoints = np.linspace(vert - 0.06, vert + 0.06, 10) + for pos in scanpoints: + umv(dev.vfm_vert, pos) + xpos, ypos = compute_pos() + y_correlation.append(ypos) + umv(dev.vfm_vert, vert) + + x = np.array(scanpoints) + y1 = np.array(y_correlation) + + yslope, yint = np.polyfit(x, y1, 1) + + print(f"Fit for xpos is: y = {yslope}.x + {yint}") + plt.figure(figsize=(7, 5)) + # plt.scatter(x, y1, label='xpos') + plt.scatter(x, y1, label="beam y position", color="rebeccapurple") + + x_fit = np.linspace(min(x), max(x), 100) + # plt.plot(x_fit, xslope*x_fit + xint, 'r--', label=f'y = {xslope}*x + {xint}') + plt.plot( + x_fit, yslope * x_fit + yint, label=f"y = {yslope:.5g}*x + ({yint:.5g})", color="lightcoral" + ) + plt.xlabel("VFM vertical (mm)") + plt.ylabel("beam Y(from BCU BPM)") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() + + +def correlate_hfm_pitch(): + x_correlation = [] + pitch = dev.hfm_pitch.read()["hfm_pitch"]["value"] + scanpoints = np.linspace(pitch - 0.05, pitch + 0.05, 10) + for pos in scanpoints: + umv(dev.hfm_pitch, pos) + xpos, ypos = compute_pos() + x_correlation.append(xpos) + umv(dev.hfm_pitch, pitch) + + x = np.array(scanpoints) + y1 = np.array(x_correlation) + + xslope, xint = np.polyfit(x, y1, 1) + + print(f"Fit for xpos is: y = {xslope}.x + {xint}") + plt.figure(figsize=(7, 5)) + # plt.scatter(x, y1, label='xpos') + plt.scatter(x, y1, label="beam x position", color="rebeccapurple") + + x_fit = np.linspace(min(x), max(x), 100) + # plt.plot(x_fit, xslope*x_fit + xint, 'r--', label=f'y = {xslope}*x + {xint}') + plt.plot( + x_fit, xslope * x_fit + xint, label=f"y = {xslope:.5g}*x + ({xint:.5g})", color="lightcoral" + ) + plt.xlabel("HFM Pitch (mm)") + plt.ylabel("beam X (from BCU BPM)") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() + + +def move_to_x(targetx=0.13): + # Calibration and drift compensation + # target from previous run was 0.1465 + slope = -1.004 + intercept = 1.793 + + xpos, ypos = compute_pos() + + beam_drift = xpos - targetx # beam moved +0.1 mm (100 µm) + mot_current = dev.hfm_lat.read()["hfm_lat"]["value"] # current motor position (example) + + # Compute correction + delta = -beam_drift / slope + mot_new = mot_current + delta + umv(dev.hfm_lat, mot_new) + + +def move_to_y(targety=-0.033): + # Calibration and drift compensation + # target from previous run = -0.283 + slope = -1.2779 + intercept = 2.4374 + + xpos, ypos = compute_pos() + + beam_drift = ypos - targety # beam moved +0.1 mm (100 µm) + mot_current = dev.vfm_vert.read()["vfm_vert"]["value"] # current motor position (example) + + # Compute correction + delta = -beam_drift / slope + mot_new = mot_current + delta + umv(dev.vfm_vert, mot_new) + + +from epics import caget, caput +import time + + +def auto_exposure( + cam="samcam", target=200, tol=5, gain=0.9, min_exp=0.00001, max_exp=0.2, max_iter=10 +): + """ + Adjust camera exposure time to reach a target max pixel value. + + Parameters + ---------- + target : float + Desired MaxValue (counts) + tol : float + Acceptable deviation from target + min_exp, max_exp : float + Exposure time limits (s) + max_iter : int + Maximum number of adjustment iterations + """ + if cam == "samcam": + exposure = dev.samcam_exp.read()["samcam_exp"]["value"] + else: + exposure = dev.ss_xicam_exp.read()["ss_xicam_exp"]["value"] + + print(f"Starting exposure = {exposure:.4f} s") + + for i in range(max_iter): + time.sleep(0.1) # allow a frame or two to update + if cam == "samcam": + maxval = dev.samcam_max.read()["samcam_max"]["value"] + if maxval is None: + print("No reading — check camera.") + break + if cam == "ss_xicam": + maxval = dev.ss_xicam_max.read()["ss_xicam_max"]["value"] + if maxval is None: + print("No reading — check camera.") + break + + error = target - maxval + # print(f"Iter {i+1}: MaxValue = {maxval:.1f}, error = {error:.1f}") + + # stop if within tolerance + if abs(error) <= tol: + # print(f"Target reached (MaxValue={maxval:.1f}) after {i+1} iterations.") + break + + # proportional correction (simple gain control) + gain_setting = gain # moderate response + new_exp = exposure * (1 + gain_setting * error / target) + + # limit exposure bounds + new_exp = max(min_exp, min(max_exp, new_exp)) + + # update camera perp = dev.dcm_perp.read()["dcm_perp"]["value"] + y = dev.ss_xicam_x.read()["ss_xicam_x"]["value"] + x = dev.ss_xicam_y.read()["ss_xicam_y"]["value"] + if cam == "samcam": + dev.samcam_exp.put(new_exp) + print(f" → Adjusting exposure to {new_exp:.4f} s") + else: + dev.ss_xicam_exp.put(new_exp) + print(f" → Adjusting exposure to {new_exp:.4f} s") + + exposure = new_exp + + print(f"New exposure time is {exposure:.3g}") + return exposure + + +def get_new_beamsizes(mirror): + filename = f"luts/{mirror}_size.csv" + if mirror == "hfm": + bu = dev.hfm_bu + bd = dev.hfm_bd + step = 0.2 + else: + bu = dev.vfm_bu + bd = dev.vfm_bd + step = 0.05 + beamsize("xs") + move_targetx_with_hfm_lat() + move_targety_with_vfm_vert() + with open(filename, "w") as f: + for _ in range(4): + curr_bu = bu.user_readback.get() + curr_bd = bd.user_readback.get() + auto_exposure() + umv(bu, curr_bu + step) + umv(bd, curr_bd + step) + move_targetx_with_hfm_lat() + move_targety_with_vfm_vert() + xpos = dev.samcam_x.read()["samcam_x"]["value"] + ypos = dev.samcam_y.read()["samcam_y"]["value"] + xsig = dev.samcam_xsig.read()["samcam_xsig"]["value"] + ysig = dev.samcam_ysig.read()["samcam_ysig"]["value"] + f.write(f"{curr_bu}, {curr_bd}, {xpos}, {ypos}, {xsig}, {ysig}\n") + print(f"{curr_bu}, {curr_bd}, {xpos}, {ypos}, {xsig}, {ysig}") + + +def filters(pos="out"): + if pos == "out": + umv(dev.bsc_f1_x, 2.0, dev.bsc_f2_x, 2.0, dev.bsc_f3_x, 12.0, dev.bsc_f4_x, 8.0) + if SE.scin.checkpos(): + auto_exposure(cam="samcam", max_iter=20) + else: + umv(dev.bsc_f1_x, 2.0, dev.bsc_f2_x, 2.0, dev.bsc_f3_x, 8.0, dev.bsc_f4_x, 8.0) + if SE.scin.checkpos(): + auto_exposure(cam="samcam", max_iter=20) + + +def energy_vs_height(start_energy=11000, end_energy=25000, step=1000): + """Correlate beam height with energy from start_energy to end_energy in steps of step""" + now = datetime.now() + # fnow = now.strftime("%d%m%H%M_") + fnow = now.strftime("%Y-%m-%d-%H%M") + filename = f"luts/{fnow}_energy-height-ss.csv" + with open(filename, "w", encoding="utf-8") as f: + # f.write("energy,bcu_norm_y,bcu_y,samcam_ypix,samcam_y\n") + f.write("energy,y_px,diffy_mic\n") + + for energy in range(start_energy, end_energy, step): + print(f"Moving to {energy: .0f}eV") + bl_energy(energy) + # scan_gap() + # mono_pitch_scan() + # scan_slits("s3",x=False,y=True) + # height = dev.s3_ycen.read()["s3_ycen"]["value"] + # bcu_norm_y = compute_norm()[1] + # bcu_y = compute_pos()[1] + # auto_exposure(cam="samcam", target=200) + # samcam_ypix, samcam_y = calc_from_centre() + # with open(filename, "a", encoding="utf-8") as f: + # f.write(f"{energy:.0f},{bcu_norm_y:.4g},{bcu_y:.4g},{samcam_ypix:.5g},{samcam_y:.4g}\n") + + auto_exposure(cam="ss_xicam", target=200, max_iter=25) + time.sleep(0.5) + ypx, diffm = calc_from_centre("ss_xicam") + # pitch = dev.dcm_pitch.read()['dcm_pitch']['value'] + + with open(filename, "a", encoding="utf-8") as f: + f.write(f"{energy:.0f},{ypx:.4g},{diffm:.4g}\n") + # umv(dev.id_gap, 20.0) + + +@dataclass +class SlitParameters: + small: float + large: float + scanwidth: float + steps: any + x_size: any + x_cen: any + y_size: any + y_cen: any + mon: any + + +# Generic scan function +def scan_slits(name="s1", x=True, y=True): + # Define parameters for all slits + s1_params = SlitParameters( + small=0.075, + large=2.5, + scanwidth=2.5, + steps=40, + x_size=dev.s1_xsize, + y_size=dev.s1_ysize, + x_cen=dev.s1_xcen, + y_cen=dev.s1_ycen, + mon=dev.lu_bpmsum, + ) + s2_params = SlitParameters( + small=0.075, + large=3.0, + scanwidth=2.5, + steps=50, + x_size=dev.s2_xsize, + y_size=dev.s2_ysize, + x_cen=dev.s2_xcen, + y_cen=dev.s2_ycen, + mon=dev.bcu_bpmsum, + ) + s3_params = SlitParameters( + small=0.05, + large=0.5, + scanwidth=0.7, + steps=50, + x_size=dev.s3_xsize, + y_size=dev.s3_ysize, + x_cen=dev.s3_xcen, + y_cen=dev.s3_ycen, + mon=dev.i1, + ) + + # Map slit names to their parameters + slit_parameters = {"s1": s1_params, "s2": s2_params, "s3": s3_params} + + if name not in slit_parameters: + raise ValueError(f"Unknown slit name: {name}") + + params = slit_parameters[name] + print("Moving filters out") + filters("out") + + print("Moving i1 diode into position") + SE.i1.mvin() + + if x and y: + scan_in_x( + xsize=params.x_size, + xcen=params.x_cen, + mon=params.mon, + small=params.small, + large=params.large, + width=params.scanwidth, + steps=params.steps, + ) + scan_in_y( + ysize=params.y_size, + ycen=params.y_cen, + mon=params.mon, + small=params.small, + large=params.large, + width=params.scanwidth, + steps=params.steps, + ) + if x and not y: + scan_in_x( + xsize=params.x_size, + xcen=params.x_cen, + mon=params.mon, + small=params.small, + large=params.large, + width=params.scanwidth, + steps=params.steps, + ) + else: + scan_in_y( + ysize=params.y_size, + ycen=params.y_cen, + mon=params.mon, + small=params.small, + large=params.large, + width=params.scanwidth, + steps=params.steps, + ) + + filters("in") + + +def scan_in_x(xsize, xcen, mon, small, large, width, steps): + umv(xsize, small) + go_to_peak(xcen, mon, -(width * 0.5), (width * 0.5), steps=steps, relative=False) + umv(xsize, large) + + +def scan_in_y(ysize, ycen, mon, small, large, width, steps): + umv(ysize, small) + go_to_peak(ycen, mon, -(width * 0.5), (width * 0.5), steps=steps, relative=True, confirm=False) + umv(ysize, large) + + +def trans_fils(inc): + x1 = dev.bsc_f1_x.read()["bsc_f1_x"]["value"] + x2 = dev.bsc_f2_x.read()["bsc_f2_x"]["value"] + x3 = dev.bsc_f3_x.read()["bsc_f3_x"]["value"] + x4 = dev.bsc_f4_x.read()["bsc_f4_x"]["value"] + umv( + dev.bsc_f1_x, + x1 + inc, + dev.bsc_f2_x, + x2 + inc, + dev.bsc_f3_x, + x3 + inc, + dev.bsc_f4_x, + x4 + inc, + ) + + +def calc_from_centre(cam="samcam"): + if cam == "samcam": + read = dev.samcam_y.read()["samcam_y"]["value"] + diff = 1092 - read + diff_px = calc_scam_microns(diff, zoom=1000) + return read, float(diff_px) + else: + read = dev.ss_xicam_y.read()["ss_xicam_y"]["value"] + diff = 140 - read + diff_px = calc_ss_xicam_microns(diff) + return read, diff_px + + +def get_cam(): + umv(dev.scam_zoom, 100) + x = dev.samcam_x.read()["samcam_x"]["value"] + y = dev.samcam_y.read()["samcam_y"]["value"] + print(f"Low zoom: x = {x}, y = {y}") + umv(dev.scam_zoom, 500) + x = dev.samcam_x.read()["samcam_x"]["value"] + y = dev.samcam_y.read()["samcam_y"]["value"] + print(f"High zoom: x = {x}, y = {y}") + + +def read_currents(): + """Read the individual bpm channels""" + bpm1 = dev.bcu_bpm1.read()["bcu_bpm1"]["value"] + bpm2 = dev.bcu_bpm2.read()["bcu_bpm2"]["value"] + bpm3 = dev.bcu_bpm3.read()["bcu_bpm3"]["value"] + bpm4 = dev.bcu_bpm4.read()["bcu_bpm4"]["value"] + # print(f"bpm1 = {bpm1:.3f}, bpm2 = {bpm2:.3f}, bpm3 = {bpm3:.3f}, bpm4 = {bpm4:.3f}") + return {"bpm1": bpm1, "bpm2": bpm2, "bpm3": bpm3, "bpm4": bpm4} + + +def compute_norm(): + """Compute normalised x and y positions""" + readings = read_currents() + total = readings["bpm1"] + readings["bpm2"] + readings["bpm3"] + readings["bpm4"] + # print(f"Sum is {total:.2f}") + xn = ((readings["bpm1"] + readings["bpm2"]) - (readings["bpm3"] + readings["bpm4"])) / total + yn = ((readings["bpm1"] + readings["bpm3"]) - (readings["bpm2"] + readings["bpm4"])) / total + return xn, yn + + +# def vfm_pscan(): +# start_pitch = 3.0 +# scan_width = 0.03 +# start_vfm_y = -0.7 +# vfm_y = dev.vfm_y.read()['vfm_y']['value'] +# name = f"VFM-{vfm_y:.3g}" +# bpmsum, y = [], [] + +# scanpoints = np.linspace((start_pitch-scan_width), (start_pitch+scan_width), 20) +# umv(dev.vfm_y, start_vfm_y) +# for repeat in range(0,8): +# filename = f"./luts/pitch{name}.csv" +# with open(filename, "w") as f: +# f.write("BCUsum, BCU-Y\n") +# for i in scanpoints: +# umv(dev.vfm_pitch,i) +# time.sleep(0.2) +# bcu = dev.bcu_bpmsum.read()['bcu_bpmsum']['value'] +# xn, yn = compute_norm() +# bpmsum.append(bcu) +# ypos = y.append(yn) +# with open(filename, "a") as f: +# f.write(f"{i:.4g},{bcu:.4g},{yn:.4g}\n") +# umv(dev.vfm_pitch,start_pitch) +# sum_array = np.array(bpmsum) +# y_array = np.array(y) +# # --- Plot --- +# plt.figure(figsize=(7,5)) +# plt.plot(scanpoints, sum_array, color='red', label=f'BCU bpmsum') +# plt.xlabel('VFM pitch') +# plt.ylabel('BCU') +# plt.title(f"{name}") +# plt.legend() +# plt.grid(True) +# plt.tight_layout() +# plt.savefig(f"luts/{name}_sum.png") +# # plt.show() +# plt.figure(figsize=(7,5)) +# plt.plot(scanpoints, y_array, color='blue', label=f'BCU Y') +# plt.xlabel('VFM pitch') +# plt.ylabel('BCU') +# plt.title(f"{name}") +# plt.legend() +# plt.grid(True) +# plt.tight_layout() +# plt.savefig(f"luts/{name}_y.png") +# # plt.show() + + +def hfm_pscan2(): + + # ----------------------- + # Settings + # ----------------------- + start_pitch = 3.0 + pitch_width = 0.03 + n_pitch = 15 + + start_hfm_x = 1.5 + hfm_x_width = 0.2 + n_hfm_x = 7 + + settle = 0.2 + + output_dir = "./luts" + os.makedirs(output_dir, exist_ok=True) + + # ----------------------- + # Save initial positions + # ----------------------- + initial_pitch = dev.hfm_pitch.read()["hfm_pitch"]["value"] + initial_hfmx = dev.hfm_x.read()["hfm_x"]["value"] + + # ----------------------- + # Scan points + # ----------------------- + pitch_points = np.linspace(start_pitch - pitch_width, start_pitch + pitch_width, n_pitch) + + hfmx_points = np.linspace(start_hfm_x - hfm_x_width, start_hfm_x + hfm_x_width, n_hfm_x) + + summary = [] + + # ----------------------- + # Loop over hFM X + # ----------------------- + for hfmx in hfmx_points: + + print(f"\nScanning HFM X = {hfmx:.4f}") + + umv(dev.hfm_x, hfmx) + time.sleep(settle) + + bpmsum = [] + + name = f"HFMX_{hfmx:.4f}" + + csvfile = os.path.join(output_dir, f"{name}.csv") + + with open(csvfile, "w") as f: + + f.write("pitch,bpmsum,bpmsum_std\n") + + for pitch in pitch_points: + + umv(dev.hfm_pitch, pitch) + time.sleep(settle) + + # Average several BPM readings + vals = [] + for _ in range(5): + vals.append(dev.bcu_bpmsum.read()["bcu_bpmsum"]["value"]) + time.sleep(0.1) + + bcu = np.mean(vals) + bcu_std = np.std(vals) + + bpmsum.append(bcu) + + f.write(f"{pitch:.6f},{bcu:.6f}, {bcu_std:.6f}\n") + + # Return pitch to nominal + umv(dev.hfm_pitch, start_pitch) + + bpmsum = np.array(bpmsum) + + # Find maximum transmission + imax = np.argmax(bpmsum) + + pitch_peak = pitch_points[imax] + sum_peak = bpmsum[imax] + + summary.append([hfmx, pitch_peak, sum_peak]) + + print(f"Peak pitch = {pitch_peak:.5f}, " f"Max BPM sum = {sum_peak:.1f}") + + # Plot this pitch scan + plt.figure(figsize=(7, 5)) + + plt.plot(pitch_points, bpmsum, marker="o") + + plt.axvline(pitch_peak, linestyle="--", label=f"Peak = {pitch_peak:.5f}") + + plt.xlabel("HFM pitch") + plt.ylabel("BPM sum") + plt.title(name) + + plt.grid(True) + plt.legend() + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, f"{name}.png")) + + plt.close() + + # ----------------------- + # Summary analysis + # ----------------------- + summary = np.array(summary) + + hfmx = summary[:, 0] + pitch_peak = summary[:, 1] + sum_peak = summary[:, 2] + + # Save summary CSV + summary_file = os.path.join(output_dir, "hfm_summary.csv") + + with open(summary_file, "w") as f: + + f.write("hfmx,pitch_peak,sum_peak\n") + + for row in summary: + f.write(",".join(f"{x:.6f}" for x in row) + "\n") + + # ----------------------- + # Summary plots + # ----------------------- + + plt.figure(figsize=(7, 5)) + + plt.plot(hfmx, sum_peak, marker="o") + + plt.xlabel("HFM X") + plt.ylabel("Maximum BPM sum") + plt.title("Transmission vs HFM X") + + plt.grid(True) + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, "summary_sum_vs_hfmx.png")) + + plt.close() + + plt.figure(figsize=(7, 5)) + + plt.plot(hfmx, pitch_peak, marker="o") + + plt.xlabel("HFM X") + plt.ylabel("Pitch at maximum transmission") + plt.title("Optimum pitch vs HFM X") + + plt.grid(True) + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, "summary_pitch_vs_hfmx.png")) + + plt.close() + + # ----------------------- + # Find best HFM X + # ----------------------- + ibest = np.argmax(sum_peak) + + best_vfmy = hfmx[ibest] + best_pitch = pitch_peak[ibest] + + print("\nBest alignment:") + print(f"HFM X = {best_hfmx:.5f}") + print(f"HFM pitch = {best_pitch:.5f}") + + # Move to optimum + umv(dev.hfm_x, best_hfmx) + umv(dev.hfm_pitch, best_pitch) + + print("\nMoved mirrors to optimum values.") + + return summary + + +def vfm_pscan(): + + # ------------------------------- + # User settings + # ------------------------------- + start_pitch = 3.0 # nominal pitch + pitch_width = 0.03 # +/- pitch scan range + n_pitch = 20 + + start_vfm_y = -0.900 # nominal VFM Y + vfm_y_width = 0.05 # +/- VFM Y scan range + n_vfm_y = 8 + + settle_time = 0.2 + + output_dir = "./luts" + os.makedirs(output_dir, exist_ok=True) + + # ------------------------------- + # Save initial positions + # ------------------------------- + initial_pitch = dev.vfm_pitch.read()["vfm_pitch"]["value"] + initial_vfm_y = dev.vfm_y.read()["vfm_y"]["value"] + + # ------------------------------- + # Generate scan points + # ------------------------------- + pitch_points = np.linspace(start_pitch - pitch_width, start_pitch + pitch_width, n_pitch) + + vfm_y_points = np.linspace(start_vfm_y - vfm_y_width, start_vfm_y + vfm_y_width, n_vfm_y) + + summary = [] + + # ------------------------------- + # Loop over VFM Y + # ------------------------------- + for vfm_y in vfm_y_points: + + print(f"\nScanning VFM Y = {vfm_y:.4f}") + + umv(dev.vfm_y, vfm_y) + time.sleep(settle_time) + + bpmsum = [] + bpm_y = [] + + name = f"VFMY_{vfm_y:.4f}" + + csvfile = os.path.join(output_dir, f"{name}.csv") + + with open(csvfile, "w") as f: + + f.write("pitch,bpmsum,bpm_y\n") + + # ------------------------------- + # Pitch scan + # ------------------------------- + for pitch in pitch_points: + + umv(dev.vfm_pitch, pitch) + time.sleep(settle_time) + + bcu = dev.bcu_bpmsum.read()["bcu_bpmsum"]["value"] + + xn, yn = compute_norm() + + bpmsum.append(bcu) + bpm_y.append(yn) + + f.write(f"{pitch:.6f},{bcu:.6f},{yn:.6f}\n") + + # Return pitch to nominal + umv(dev.vfm_pitch, start_pitch) + + # Convert to arrays + bpmsum = np.array(bpmsum) + bpm_y = np.array(bpm_y) + + # ------------------------------- + # Find optimum pitch + # ------------------------------- + imax = np.argmax(bpmsum) + + pitch_peak = pitch_points[imax] + sum_peak = bpmsum[imax] + y_peak = bpm_y[imax] + + summary.append([vfm_y, pitch_peak, sum_peak, y_peak]) + + print(f"Peak at pitch={pitch_peak:.5f}, " f"BPM sum={sum_peak:.1f}, " f"BPM Y={y_peak:.4f}") + + # ------------------------------- + # Plot BPM sum + # ------------------------------- + plt.figure(figsize=(7, 5)) + + plt.plot(pitch_points, bpmsum, marker="o") + + plt.axvline(pitch_peak, linestyle="--") + + plt.xlabel("VFM pitch") + plt.ylabel("BCU BPM sum") + plt.title(name) + + plt.grid(True) + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, f"{name}_sum.png")) + + plt.close() + + # ------------------------------- + # Plot BPM Y + # ------------------------------- + plt.figure(figsize=(7, 5)) + + plt.plot(pitch_points, bpm_y, marker="o") + + plt.axvline(pitch_peak, linestyle="--") + + plt.xlabel("VFM pitch") + plt.ylabel("BCU BPM Y") + plt.title(name) + + plt.grid(True) + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, f"{name}_y.png")) + + plt.close() + + # ------------------------------- + # Summary arrays + # ------------------------------- + summary = np.array(summary) + + vfm_y_vals = summary[:, 0] + pitch_peaks = summary[:, 1] + sum_peaks = summary[:, 2] + y_peaks = summary[:, 3] + + # Save summary CSV + summary_file = os.path.join(output_dir, "vfm_summary.csv") + + with open(summary_file, "w") as f: + + f.write("vfm_y,pitch_peak,sum_peak,bpm_y_peak\n") + + for row in summary: + f.write(",".join(f"{x:.6f}" for x in row) + "\n") + + # ------------------------------- + # Summary plots + # ------------------------------- + + plt.figure(figsize=(7, 5)) + plt.plot(vfm_y_vals, pitch_peaks, marker="o") + + plt.xlabel("VFM Y") + plt.ylabel("Pitch at max BPM sum") + plt.title("Optimum pitch vs VFM Y") + + plt.grid(True) + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, "summary_pitch_vs_vfmy.png")) + + plt.close() + + plt.figure(figsize=(7, 5)) + plt.plot(vfm_y_vals, sum_peaks, marker="o") + + plt.xlabel("VFM Y") + plt.ylabel("Maximum BPM sum") + plt.title("Maximum transmission vs VFM Y") + + plt.grid(True) + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, "summary_sum_vs_vfmy.png")) + + plt.close() + + plt.figure(figsize=(7, 5)) + plt.plot(vfm_y_vals, y_peaks, marker="o") + + plt.xlabel("VFM Y") + plt.ylabel("BPM Y at optimum pitch") + plt.title("Beam position vs VFM Y") + + plt.grid(True) + plt.tight_layout() + + plt.savefig(os.path.join(output_dir, "summary_bpmy_vs_vfmy.png")) + + plt.close() + + # ------------------------------- + # Restore original positions + # ------------------------------- + umv(dev.vfm_pitch, initial_pitch) + umv(dev.vfm_y, initial_vfm_y) + + print("\nScan complete.") + print(f"Summary written to {summary_file}") + + return summary + + +def find_best_roll(low=6000, high=20000): + low_scanpoints = np.linspace(0.5, 5.5, 11) + high_scanpoints = np.linspace(1.0, 9.0, 9) + highs_y, lows_y = [], [] + + # low energy + bl_energy(low) + energy = get_current_energy() + filename = f"./luts/roll_{energy:.0f}.csv" + with open(filename, "w", encoding="utf-8") as f: + f.write("Roll, Y pos\n") + auto_exposure("bsccam", max_iter=25) + for i in low_scanpoints: + umv(dev.dcm_froll, i) + time.sleep(0.2) + low_y = dev.bsccam_y.read()["bsccam_y"]["value"] + print(f"Ypos at BSC cam is {low_y}") + lows_y.append(low_y) + with open(filename, "a", encoding="utf-8") as f: + f.write(f"{i:.4g},{low_y:.4g} \n") + + # high energy + bl_energy(high) + energy = get_current_energy() + if 19999 < energy < 200001: + umv(dev.id_gap, 4.718) + filename = f"./luts/roll_{energy:.0f}.csv" + with open(filename, "w", encoding="utf-8") as f: + f.write("Roll, Y pos\n") + auto_exposure("bsccam", max_iter=25) + for i in high_scanpoints: + umv(dev.dcm_froll, i) + time.sleep(0.2) + high_y = dev.bsccam_y.read()["bsccam_y"]["value"] + print(f"Ypos at BSC cam is {high_y}") + highs_y.append(high_y) + with open(filename, "a", encoding="utf-8") as f: + f.write(f"{i:.4g},{low_y:4g.} \n") + + y_high = np.array(highs_y) + y_low = np.array(lows_y) + + # # Fit linear models: y = m*x + b + m_high, b_high = np.polyfit(high_scanpoints, y_high, 1) + m_low, b_low = np.polyfit(low_scanpoints, y_low, 1) + + # # Intersection point + x_intersect = (b_low - b_high) / (m_high - m_low) + y_intersect = m_high * x_intersect + b_high + + print(f"\nIntersection at:") + print(f" DCM Roll = {x_intersect:.5f}") + print(f" BSCcam Y = {y_intersect:.2f}") + + # # --- Plot --- + plt.figure(figsize=(7, 5)) + plt.scatter(high_scanpoints, y_high, color="red", label=f"High energy") + plt.scatter(low_scanpoints, y_low, color="blue", label=f"Low energy") + + x_fit = np.linspace(min(high_scanpoints), max(high_scanpoints), 100) + plt.plot(x_fit, m_high * x_fit + b_high, "r--", label=f"High energy") + plt.plot(x_fit, m_low * x_fit + b_low, "b--", label=f"Low energy") + + plt.scatter(x_intersect, y_intersect, color="green", s=80, zorder=5, label="Intersection") + + plt.xlabel("DCM fine roll") + plt.ylabel("BSCcam Y pos") + plt.title("Roll Calibration") + plt.legend() + plt.grid(True) + plt.tight_layout() + plt.show() diff --git a/pxii_bec/macros/policies.py b/pxii_bec/macros/policies.py index 576edae..cea388c 100755 --- a/pxii_bec/macros/policies.py +++ b/pxii_bec/macros/policies.py @@ -58,15 +58,16 @@ def make_diag_y_policy(d): def diag_y_policy(target): cfg = d["diag_y"].positions # Don't move in if the goniometer is in - if d["aerotech_x"].actual >= d['aerotech_x'].positions['in'] and target > cfg["out"]: + if d["aerotech_x"].actual >= d["aerotech_x"].positions["in"] and target > cfg["out"]: raise GuardViolation( f"Diagnostic device cannot move beyond {cfg['out']} mm when goniometer is not OUT" ) # Don't move if cryocooler is in - if d['cryo_pos'].pos == 'in' and target > cfg['out']: + if d["cryo_pos"].pos == "in" and target > cfg["out"]: raise GuardViolation( f"Diagnostic device cannot move beyond {cfg['out']} mm when cryocooler is IN" ) + return diag_y_policy diff --git a/pxii_bec/macros/pxii_energy.py b/pxii_bec/macros/pxii_energy.py index f72d25c..3b40325 100755 --- a/pxii_bec/macros/pxii_energy.py +++ b/pxii_bec/macros/pxii_energy.py @@ -85,7 +85,7 @@ def mono_pitch_scan(plot=True): energy = get_current_energy() pos = get_dcm_motors_positions(energy) print(f"Setting DCM Pitch to default value of {pos['dcm_pitch']}") - scans.umv(EnergyDefaults.mono_pitch, pos["dcm_pitch"], relative=False) + # scans.umv(EnergyDefaults.mono_pitch, pos["dcm_pitch"], relative=False) # Go to peak using default parameters from EnergyDefaults if plot: print("Scanning monochromator pitch and moving to peak, with plotting.") @@ -118,7 +118,7 @@ def mono_pitch_scan(plot=True): # Specific functions - need to be edited for each beamline -def move_gap_if_needed(energy_ev, move_gap=False): +def move_gap_if_needed(energy_ev, move_gap=True): """ Move the gap position based on energy if the move_gap flag is set. @@ -163,7 +163,7 @@ def get_dcm_motors_positions(energy_ev): # dcm_motor_values = get_value_from_lut(energy_ev) dcm_motor_values = {} # pitch = float(np.poly1d(Calibration.pitch)(energy_ev)) - pitch = -5.304 + pitch = -5.5 roll = EnergyDefaults.mono_roll_value perp = calc_perp_position(energy_ev, print_result=False) bragg_angle = convert_from_energy(energy_ev, print_result=False)["bragg_angle_mrad"] @@ -183,8 +183,8 @@ def move_dcm_motors(energy_ev): print( f"Moving DCM bragg: {dcm_pos['bragg_angle']: .5g} mrad, " f"DCM perp: {dcm_pos['perp']: .3g} mm, " - f"DCM pitch fixed at -5.304 mrad, " - # f"DCM pitch: {dcm_pos['dcm_pitch']: .5g} mrad, " + # f"DCM pitch fixed at -5.304 mrad, " + f"DCM pitch: {dcm_pos['dcm_pitch']: .5g} mrad, " f"DCM Roll: {dcm_pos['dcm_roll']:.5g} V" ) # umv(EnergyDefaults.energy, dcm_pos["bragg_angle"]) @@ -205,7 +205,7 @@ def move_dcm_motors(energy_ev): ) -def bl_energy(energy_ev, move_gap=False, mono_scan=True, plot=True): +def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): """ Adjusts the beamline's energy to the specified energy in electron volts (eV). The function validates the target energy, checks the current energy, and makes diff --git a/pxii_bec/macros/pxii_parameters.py b/pxii_bec/macros/pxii_parameters.py index 856b685..5a1f2d7 100755 --- a/pxii_bec/macros/pxii_parameters.py +++ b/pxii_bec/macros/pxii_parameters.py @@ -4,7 +4,6 @@ from dataclasses import dataclass import numpy as np - @dataclass(frozen=True) class EnergyDefaults: """Parameters for PXII energy changes""" @@ -37,13 +36,15 @@ class Gap: """Fit parameters to calculate gap from harmonics""" harmonics = { - "H3": np.array([9.15e-04, 4.49e-01]), - "H5": np.array([5.19e-04, 7.149e-01]), - "H7": np.array([3.57694643e-04, 8.73775476e-01]), - "H9": np.array([2.76335714e-04, 8.98471905e-01]), - "H11": np.array([2.2225e-04, 9.582e-01]), - "H13": np.array([1.9e-4, 9.262e-01]), - "H15": np.array([1.67e-4, 8.83e-01]), + "H3": np.array([9.409e-04, 2.797e-01]), + "H5": np.array([5.097e-04, 8.065e-01]), + "H7": np.array([3.623e-04, 8.252e-01]), + "H9": np.array([2.795e-04, 8.595e-01]), + "H11": np.array([2.309e-04, 8.167e-01]), + "H13": np.array([1.928e-04, 8.748e-01]), + "H15": np.array([1.67e-04, 8.743e-01]), + "H17": np.array([1.484e-04, 8.546e-01]), + "H19": np.array([1.275e-04, 1.0085]), } # Define harmonic ranges as a constant harmonic_ranges = { @@ -53,7 +54,9 @@ class Gap: "H9": (13000, 16000), "H11": (16000, 19000), "H13": (19000, 22000), - "H15": (22000, float("inf")), + "H15": (22000, 25000), + "H17": (25000, 27500), + "H19": (27500, float("inf")), } @staticmethod @@ -122,17 +125,17 @@ class CamConversion: class BPMScans: """Define the names of the motors and bpm channels""" - fe = { - "x_name": dev.fe_bpm_x.name, - "y_name": dev.fe_bpm_y.name, - "z1_name": dev.fe_bpm1.name, - "z2_name": dev.fe_bpm2.name, - "z3_name": dev.fe_bpm3.name, - "z4_name": dev.fe_bpm3.name, - "z5_name": dev.fe_bpmsum.name, - "x_device": dev.fe_bpm_x, - "y_device": dev.fe_bpm_y, - } + # fe = { + # "x_name": dev.fe_bpm_x.name, + # "y_name": dev.fe_bpm_y.name, + # "z1_name": dev.fe_bpm1.name, + # "z2_name": dev.fe_bpm2.name, + # "z3_name": dev.fe_bpm3.name, + # "z4_name": dev.fe_bpm3.name, + # "z5_name": dev.fe_bpmsum.name, + # "x_device": dev.fe_bpm_x, + # "y_device": dev.fe_bpm_y, + # } lu = { "x_name": dev.lu_bpm_x.name, "y_name": dev.lu_bpm_y.name, @@ -186,5 +189,3 @@ class BPMScans: # "x_device": dev.vfm_bu, # "y_device": dev.vfm_bd, # } - - diff --git a/pxii_bec/macros/pxii_parameters_version_120526.txt b/pxii_bec/macros/pxii_parameters_version_120526.txt deleted file mode 100755 index 7f3f761..0000000 --- a/pxii_bec/macros/pxii_parameters_version_120526.txt +++ /dev/null @@ -1,338 +0,0 @@ -"""File to store beamline parameters and defaults""" - -from dataclasses import dataclass -from typing import Callable -import numpy as np -import yaml - - - - -@dataclass(frozen=True) -class EnergyDefaults: - """Parameters for PXII energy changes""" - - min_energy_change = 1 - min_energy_ev = 4800 - max_energy_ev = 30002 - beam_offset = 6 - signals = {"sig1": dev.lu_bpmsum, "sig2": dev.bsc_bpmsum, "sig3": dev.bcu_bpmsum} - energy = dev.dcm_bragg - mono_pitch = dev.dcm_pitch - mono_perp = dev.dcm_perp - mono_roll = dev.dcm_froll - mono_roll_value = 4.65 - LUT_table = "luts/energy_lut.csv" - stripe_thresholds = {"silicon": 9000, "rhodium": 20000, "platinum": 40000} - pitch_scan = {"halfwidth": 0.075, "steps": 20} - - -@dataclass(frozen=True) -class Calibration: - """Calibration parameters for PXII optics""" - - pitch = np.array([4.61823701e-14, -1.97330772e-09, 2.89694543e-05, -5.34468669e00]) - roll = np.array([2.28291039e-03, -2.41928101e01]) - - -@dataclass(frozen=True) -class Gap: - """Fit parameters to calculate gap from harmonics""" - - harmonics = { - "H3": np.array([9.15e-04, 4.49e-01]), - "H5": np.array([5.19e-04, 7.149e-01]), - "H7": np.array([3.57694643e-04, 8.73775476e-01]), - "H9": np.array([2.76335714e-04, 8.98471905e-01]), - "H11": np.array([2.2225e-04, 9.582e-01]), - "H13": np.array([1.9e-4, 9.262e-01]), - "H15": np.array([1.67e-4, 8.83e-01]), - } - # Define harmonic ranges as a constant - harmonic_ranges = { - "H3": (4900, 7000), - "H5": (7000, 10000), - "H7": (10000, 13000), - "H9": (13000, 16000), - "H11": (16000, 19000), - "H13": (19000, 22000), - "H15": (22000, float("inf")), - } - - @staticmethod - def get_harmonic_by_energy(energy_ev: float): - """ - Determines the harmonic key based on the provided energy. - - Args: - energy_ev (float): The energy value (eV). - - Returns: - Optional[str]: The harmonic name (e.g., 'H3', 'H7') - if the range matches, None otherwise. - """ - for harmonic, (low, high) in Gap.harmonic_ranges.items(): - if low < energy_ev <= high: - return harmonic - return None - - def get_harmonic_values(self, energy_ev: float): - """ - Retrieves the harmonic array based on the energy value. - - Args: - energy_ev (float): The energy value (eV). - - Returns: - Optional[np.array]: The corresponding array of harmonic values - if the range matches, None otherwise. - """ - harmonic = self.get_harmonic_by_energy(energy_ev) - return self.harmonics.get(harmonic) if harmonic else None - - -@dataclass(frozen=True) -class Harmonics: - """Anuschka's harmonics data for PXII U19 Undulator""" - - min_gap_value = 4.5 - map = { - 3: np.array([1.07141725, -0.52834258]), - 4: np.array([0.007111, -0.13678409, 1.52295567, -1.06882785]), - 5: np.array([0.00315051, -0.0766359, 1.13107469, -0.86442062]), - 6: np.array([0.00162862, -0.04452336, 0.82948259, -0.37329674]), - 7: np.array([0.00080764, -0.02418882, 0.59212947, 0.15702886]), - 8: np.array([1.16699242e-03, -4.68207543e-02, 9.43972396e-01, -1.94201019e00]), - 9: np.array([0.00048419, -0.02010648, 0.55514114, -0.38180067]), - 10: np.array([2.11583333e-04, -8.03503571e-03, 3.43141595e-01, 6.02318000e-01]), - 11: np.array([0.00334392, -0.18405336, 3.58338994, -19.3640241]), - 12: np.array([3.20520798e-05, 2.39253145e-03, 8.09198503e-02, 2.22897377e00]), - 13: np.array([0.00278744, 0.07979874, 2.05143916]), - } - energy_ranges = {3: (0, 7), 5: (7, 10), 7: (10, 13), 9: (13, 16), 11: (16, 19), 13: (19, 22)} - high_energy = [(15, (23, 25)), (17, (25, 29)), (19, (29, float("inf")))] - - -@dataclass(frozen=True) -class CamConversion: - """Convert pixels to microns for sam cam""" - - a = 0.5208 - b = 0.002586 - - -@dataclass(frozen=True) -class BPMScans: - """Define the names of the motors and bpm channels""" - - fe = { - "x_name": dev.fe_bpm_x.name, - "y_name": dev.fe_bpm_y.name, - "z1_name": dev.fe_bpm1.name, - "z2_name": dev.fe_bpm2.name, - "z3_name": dev.fe_bpm3.name, - "z4_name": dev.fe_bpm3.name, - "z5_name": dev.fe_bpmsum.name, - "x_device": dev.fe_bpm_x, - "y_device": dev.fe_bpm_y, - } - lu = { - "x_name": dev.lu_bpm_x.name, - "y_name": dev.lu_bpm_y.name, - "z1_name": dev.lu_bpm1.name, - "z2_name": dev.lu_bpm2.name, - "z3_name": dev.lu_bpm3.name, - "z4_name": dev.lu_bpm4.name, - "z5_name": dev.lu_bpmsum.name, - "x_device": dev.lu_bpm_x, - "y_device": dev.lu_bpm_y, - } - bsc = { - "x_name": dev.bsc_bpm_x.name, - "y_name": dev.bsc_bpm_y.name, - "z1_name": dev.bsc_bpm1.name, - "z2_name": dev.bsc_bpm2.name, - "z3_name": dev.bsc_bpm3.name, - "z4_name": dev.bsc_bpm4.name, - "z5_name": dev.bsc_bpmsum.name, - "x_device": dev.bsc_bpm_x, - "y_device": dev.bsc_bpm_y, - } - bcu = { - "x_name": dev.bcu_bpm_x.name, - "y_name": dev.bcu_bpm_y.name, - "z1_name": dev.bcu_bpm1.name, - "z2_name": dev.bcu_bpm2.name, - "z3_name": dev.bcu_bpm3.name, - "z4_name": dev.bcu_bpm4.name, - "z5_name": dev.bcu_bpmsum.name, - "x_device": dev.bcu_bpm_x, - "y_device": dev.bcu_bpm_y, - } - - -@dataclass(frozen=True) -class MirrorConfig: - """Define the names of the mirror channels""" - - hfm = { - "bu_name": dev.hfm_bu.name, - "bd_name": dev.hfm_bd.name, - "z_name": dev.samcam_xsig.name, - "x_device": dev.hfm_bu, - "y_device": dev.hfm_bd, - } - vfm = { - "bu_name": dev.vfm_bu.name, - "bd_name": dev.vfm_bd.name, - "z_name": dev.samcam_ysig.name, - "x_device": dev.vfm_bu, - "y_device": dev.vfm_bd, - } - - -@dataclass -class PositionedDevice: - """Class for devices with defined in and out positions""" - - device_name: str - type: str - name: str - inpos: float - outpos: float - tol: float - mot: str - reader: Callable[[], float] - - @property - def actual(self): - """Returns current motor position""" - return self.reader() - - def checkin(self): - """Returns True if motor in in the 'in' position""" - return abs(self.actual - self.inpos) <= self.tol - - def mvin(self): - """Moves motor to the 'in' position""" - scans.umv(self.mot, self.inpos, relative=False) - - def mvout(self): - """Moves motor to the 'out' position""" - scans.umv(self.mot, self.outpos, relative=False) - - def status(self): - """ Check if device is in or out or moving""" - positions = ("in", "out", "moving", "undefined") - target_in = self.inpos - target_out = self.outpos - actual = self.actual - delta_in = actual - target_in - delta_out = actual - target_out - # Check if motor is moving - if "Signal" in self.type: - moving = 0 - elif "Motor" in self.type: - d = getattr(dev, self.device_name) - moving = d.motor_is_moving.get() - if moving: - pos = positions[2] - return {"position": pos.upper(), - "name": self.name, - "moving": moving} - - if abs(delta_in) > self.tol and abs(delta_out) > self.tol: - pos = positions[3] - return {"position": pos.upper(), - "name": self.name, - "actual": actual, - "moving": moving} - - elif abs(delta_in) <= self.tol: - target = self.inpos - pos = positions[0] - delta = delta_in - elif abs(delta_out) <= self.tol: - target = self.outpos - pos = positions[1] - delta = delta_out - - return { - "name": self.name, - "position": pos.upper(), - "target": target, - "actual": actual, - "delta": delta, - "tol": self.tol, - "moving": moving, - } - - def report(self): - """ Print status of motor """ - s = self.status() - - if s['position'] == "UNDEFINED": - return (f"{s['name']:15s}: " - f"{s['position']} " - f"position {s['actual']:.3f}") - elif s['position'] == "MOVING": - return (f"{s['name']:15s}: " - f"{s['position']} ") - else: - return ( - f"{s['name']:15s}: " - f"[{s['position']}] " - f"actual = {s['actual']:.3f} " - f"target = {s['target']:.3f} " - f"delta = {s['delta']:.3f}" - ) - - - -@dataclass(frozen=True) -class PD: - """Class for positioned device positions""" - - -def build_pd(yaml_file): - """Takes the in and out values from the yaml file - and adds them to the PD class - """ - with open(yaml_file, encoding="utf-8") as f: - data = yaml.safe_load(f) - for device_name, cfg in data.items(): - # Skip devices without userParameter - user = cfg.get("userParameter") - if not user: - continue - # Set tolerance - if "tol" not in user: - user["tol"] = 0.01 - - try: - dev_obj = getattr(dev, device_name) - except: - raise KeyError(f"Device {device_name} not found in device list") - desc = cfg.get("description") - type = cfg.get("deviceClass") - target = PositionedDevice( - device_name=device_name, - type = type, - name=desc, - inpos=user["in"], - outpos=user["out"], - tol=user["tol"], - mot=dev_obj, - reader=lambda d=dev_obj, n=device_name: d.read()[n]["value"], - ) - - setattr(PD, device_name, target) - - -def init_positioned_devices(): - """Initialises the positioned devices""" - file = ( - "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/pxii-autogenerated.yaml" - ) - build_pd(file) - print("Defined positions for devices have been updated from pxii-autogenerated.yaml") diff --git a/pxii_bec/macros/test.py b/pxii_bec/macros/test.py index 6461395..cc368dc 100755 --- a/pxii_bec/macros/test.py +++ b/pxii_bec/macros/test.py @@ -22,7 +22,7 @@ def state_test(): current = random.choice(choices) print(f"Testing {current}") planner.move_to(current) - time.sleep(5) + time.sleep(2) tested_states.append(current.name) previous = current planner.move_to(BeamlineState.MANUAL_SAMPLE_EXCHANGE) -- 2.54.0