Skip to content

Commit

Permalink
Cleaned up start_bs and fixed auto recovery device
Browse files Browse the repository at this point in the history
  • Loading branch information
vshekar committed Nov 13, 2024
1 parent 3a89884 commit 63134eb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mxbluesky/devices/auto_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
40 changes: 25 additions & 15 deletions start_bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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":
Expand Down

0 comments on commit 63134eb

Please sign in to comment.