From 63134eb687b949c50602974a36a0e215d689bb74 Mon Sep 17 00:00:00 2001 From: vshekar1 Date: Wed, 13 Nov 2024 09:54:12 -0500 Subject: [PATCH] Cleaned up start_bs and fixed auto recovery device --- mxbluesky/devices/auto_recovery.py | 2 +- start_bs.py | 40 +++++++++++++++++++----------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/mxbluesky/devices/auto_recovery.py b/mxbluesky/devices/auto_recovery.py index f136a8b8..468eca8d 100644 --- a/mxbluesky/devices/auto_recovery.py +++ b/mxbluesky/devices/auto_recovery.py @@ -9,7 +9,7 @@ class PYZHomer(Device): kill_home = Cpt(EpicsSignal, "XF:17IDB-ES:AMX{Sentinel}Homing_Kill") kill_py = Cpt(EpicsSignal, "XF:17IDB-ES:AMX{Gon:1-Ax:PY}Cmd:Kill-Cmd") - kill_pz = Cpt(EpicsSignal, "XF:17IDB-ES:AMX{Gon:1-Ax:PY}Cmd:Kill-Cmd") + kill_pz = Cpt(EpicsSignal, "XF:17IDB-ES:AMX{Gon:1-Ax:PZ}Cmd:Kill-Cmd") def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/start_bs.py b/start_bs.py index c8a95df5..7d7ce7c7 100755 --- a/start_bs.py +++ b/start_bs.py @@ -113,24 +113,26 @@ class SampleXYZ(Device): omega = Cpt(EpicsMotor, ':O}Mtr') if (beamline=="amx"): - from mxbluesky.devices import (WorkPositions, TwoClickLowMag, LoopDetector, MountPositions, - TopAlignerFast, TopAlignerSlow, GoniometerStack, Dewar, RobotArm) + from mxbluesky.devices import Dewar, RobotArm + from mxbluesky.devices.auto_recovery import PYZHomer + from mxbluesky.plans.auto_recovery import home_pins_plan + from mxtools.vector_program import VectorProgram + from mxtools.flyer import MXFlyer + from mxtools.raster_flyer import MXRasterFlyer + from embl_robot import EMBLRobot from mxbluesky.devices.generic import CryoStream + mercury = ABBIXMercury('XF:17IDB-ES:AMX{Det:Mer}', name='mercury') mercury.read_attrs = ['mca.spectrum', 'mca.preset_live_time', 'mca.rois.roi0.count', 'mca.rois.roi1.count', 'mca.rois.roi2.count', 'mca.rois.roi3.count'] vdcm = VerticalDCM('XF:17IDA-OP:AMX{Mono:DCM', name='vdcm') zebra = Zebra('XF:17IDB-ES:AMX{Zeb:2}:', name='zebra') eiger = EigerSingleTriggerV26('XF:17IDB-ES:AMX{Det:Eig9M}', name='eiger', beamline=beamline) - from mxtools.vector_program import VectorProgram vector_program = VectorProgram('XF:17IDB-ES:AMX{Gon:1-Vec}', name='vector_program') - from mxtools.flyer import MXFlyer flyer = MXFlyer(vector_program, zebra, eiger) - from mxtools.raster_flyer import MXRasterFlyer raster_flyer = MXRasterFlyer(vector_program, zebra, eiger) samplexyz = SampleXYZ("XF:17IDB-ES:AMX{Gon:1-Ax", name="samplexyz") - from embl_robot import EMBLRobot robot = EMBLRobot() govs = _make_governors("XF:17IDB-ES:AMX", name="govs") gov_robot = govs.gov.Robot @@ -149,31 +151,35 @@ class SampleXYZ(Device): top_aligner_slow = TopAlignerSlow(name="top_aligner_slow") gov_mon_signal = EpicsSignal("XF:17ID:AMX{Karen}govmon", name="govmon") gonio_mon_signal = EpicsSignal("XF:17ID:AMX{Karen}goniomon", name="goniomon") - from mxbluesky.devices.auto_recovery import PYZHomer - from mxbluesky.plans.auto_recovery import home_pins_plan pyz_homer = PYZHomer("", name="pyz_homer") dewar = Dewar("XF:17IDB-ES:AMX", name="dewar") home_pins = home_pins_plan(gov_mon_signal, gonio_mon_signal, pyz_homer, gonio) robot_arm = RobotArm("XF:17IDB-ES:AMX", name="robot_arm") cs700 = CryoStream("XF:17ID1:CS700:", name="cs700", atol=0.1) -elif beamline == "fmx": +elif beamline == "fmx": + from mxbluesky.devices import Dewar, RobotArm + from mxtools.vector_program import VectorProgram + from mxbluesky.devices.auto_recovery import PYZHomer + from mxbluesky.plans.auto_recovery import home_pins_plan + from mxtools.vector_program import VectorProgram + from mxtools.flyer import MXFlyer + from mxtools.raster_flyer import MXRasterFlyer + from embl_robot import EMBLRobot + import setenergy_lsdc from mxbluesky.devices.generic import CryoStream + mercury = ABBIXMercury('XF:17IDC-ES:FMX{Det:Mer}', name='mercury') mercury.read_attrs = ['mca.spectrum', 'mca.preset_live_time', 'mca.rois.roi0.count', 'mca.rois.roi1.count', 'mca.rois.roi2.count', 'mca.rois.roi3.count'] vdcm = VerticalDCM('XF:17IDA-OP:FMX{Mono:DCM', name='vdcm') zebra = Zebra('XF:17IDC-ES:FMX{Zeb:3}:', name='zebra') eiger = EigerSingleTriggerV26('XF:17IDC-ES:FMX{Det:Eig16M}', name='eiger', beamline=beamline) - from mxtools.vector_program import VectorProgram vector_program = VectorProgram('XF:17IDC-ES:FMX{Gon:1-Vec}', name='vector_program') - from mxtools.flyer import MXFlyer flyer = MXFlyer(vector_program, zebra, eiger) - from mxtools.raster_flyer import MXRasterFlyer raster_flyer = MXRasterFlyer(vector_program, zebra, eiger) samplexyz = SampleXYZ("XF:17IDC-ES:FMX{Gon:1-Ax", name="samplexyz") - from embl_robot import EMBLRobot robot = EMBLRobot() govs = _make_governors("XF:17IDC-ES:FMX", name="govs") gov_robot = govs.gov.Robot @@ -189,8 +195,12 @@ class SampleXYZ(Device): loop_detector = LoopDetector(name="loop_detector") top_aligner_fast = TopAlignerFast(name="top_aligner_fast", gov_robot=gov_robot) top_aligner_slow = TopAlignerSlow(name="top_aligner_slow") - gov_mon_signal = EpicsSignal("XF:17ID:AMX{Karen}govmon") - import setenergy_lsdc + gov_mon_signal = EpicsSignal("XF:17ID:FMX{Karen}govmon", name="govmon") + gonio_mon_signal = EpicsSignal("XF:17ID:FMX{Karen}goniomon", name="goniomon") + pyz_homer = PYZHomer("", name="pyz_homer") + dewar = Dewar("XF:17IDC-ES:FMX", name="dewar") + home_pins = home_pins_plan(gov_mon_signal, gonio_mon_signal, pyz_homer, gonio) + robot_arm = RobotArm("XF:17IDC-ES:FMX", name="robot_arm") cs700 = CryoStream("XF:17ID2:CS700:", name="cs700", atol=0.1) elif beamline=="nyx":