DiamondLightSource / mx_bluesky

Holds Bluesky code used in MX but outside the Hyperion project
Apache License 2.0
0 stars 1 forks source link

I24 ssx: Use dodal devices for beamline setup #97

Closed noemifrisina closed 1 week ago

noemifrisina commented 1 month ago

Use dodal devices and bluesky plans for beamline setup for collection code:


def beamline(action, args_list=None):
    logger.debug("***** Entering Beamline")
    logger.info("Setup beamline - %s" % action)
    if args_list:
        for arg in args_list:
            logger.debug("Argument: %s" % arg)

    if action == "collect":
        caput(pv.aptr1_mp_select, "In")
        caput(pv.bl_mp_select, "Out")
        sleep(3)
        caput(pv.bs_mp_select, "Data Collection")
        caput(pv.bs_roty, 0)
        sleep(4)

    elif action == "quickshot":
        det_dist = args_list[0]
        caput(pv.det_z, det_dist)
        logger.info("Waiting on detector")
        logger.debug("Detector distance: %s" % det_dist)
        logger.debug("det_z: %s" % caget(pv.det_z + ".RBV"))
        while str(int(float(caget(pv.det_z + ".RBV")))) != str(int(float(det_dist))):
            caput(pv.det_z, det_dist)
            sleep(0.2)