def define_XAFSEpicsMotor(prefix, name='unnamed'): '''Deal gracefully with a motor whose IOC is not running or whose controller is turned off. See discussion at the top of BMM/user_ns/instruments.py ''' this = XAFSEpicsMotor(prefix, name=name) count = 0 while this.connected is False: # try for no more than 3 seconds count += 1 time.sleep(0.5) if count > 6: break if this.connected is False: this = SynAxis(name=name) return (this)
## collimating mirror print(f'{TAB}FMBO motor group: m1') m1 = Mirrors('XF:06BM-OP{Mir:M1-Ax:', name='m1', mirror_length=556, mirror_width=240) m1.vertical._limits = (-5.0, 5.0) m1.lateral._limits = (-5.0, 5.0) m1.pitch._limits = (-5.0, 5.0) m1.roll._limits = (-5.0, 5.0) m1.yaw._limits = (-5.0, 5.0) wait_for_connection(m1) if m1.connected is True: m1_yu = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:YU}Mtr', name='m1_yu') m1_ydo = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:YDO}Mtr', name='m1_ydo') m1_ydi = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:YDI}Mtr', name='m1_ydi') m1_xu = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:XU}Mtr', name='m1_xu') m1_xd = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:XD}Mtr', name='m1_xd') else: m1_yu = SynAxis(name='m1_yu') m1_ydo = SynAxis(name='m1_ydo') m1_ydi = SynAxis(name='m1_ydi') m1_xu = SynAxis(name='m1_xu') m1_xd = SynAxis(name='m1_xd') m1list = [m1_yu, m1_ydo, m1_ydi, m1_xu, m1_xd] mcs8_motors.extend(m1list) ## focusing mirror
name='fe_slits_horizontal2') fe_slits_incline2 = EpicsMotor('FE:C06B-OP{Slt:2-Ax:Inc}Mtr', name='fe_slits_incline2') fe_slits_i = EpicsMotor('FE:C06B-OP{Slt:2-Ax:I}Mtr', name='fe_slits_i') fe_slits_b = EpicsMotor('FE:C06B-OP{Slt:2-Ax:B}Mtr', name='fe_slits_b') fe_slits_hsize = EpicsSignalRO('FE:C06B-OP{Slt:12-Ax:X}size', name='fe_slits_hsize') fe_slits_vsize = EpicsSignalRO('FE:C06B-OP{Slt:12-Ax:Y}size', name='fe_slits_vsize') fe_slits_hcenter = EpicsSignalRO('FE:C06B-OP{Slt:12-Ax:X}center', name='fe_slits_hcenter') fe_slits_vcenter = EpicsSignalRO('FE:C06B-OP{Slt:12-Ax:Y}center', name='fe_slits_vcenter') ## collimating mirror m1_yu = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:YU}Mtr', name='m1_yu') m1_ydo = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:YDO}Mtr', name='m1_ydo') m1_ydi = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:YDI}Mtr', name='m1_ydi') m1_xu = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:XU}Mtr', name='m1_xu') m1_xd = XAFSEpicsMotor('XF:06BM-OP{Mir:M1-Ax:XD}Mtr', name='m1_xd') mcs8_motors.extend([m1_yu, m1_ydo, m1_ydi, m1_xu, m1_xd]) ## DM1 dm1_filters1 = XAFSEpicsMotor('XF:06BMA-BI{Fltr:01-Ax:Y1}Mtr', name='dm1_filters1') dm1_filters2 = XAFSEpicsMotor('XF:06BMA-BI{Fltr:01-Ax:Y2}Mtr', name='dm1_filters2') mcs8_motors.extend([dm1_filters1, dm1_filters2]) dm1_filters2.llm.put(-52) ## monochromator
## http://patorjk.com/software/taag/#p=display&f=Doom&t=MIRRORS ################################################# # ___ ____________________ ___________ _____ # # | \/ |_ _| ___ \ ___ \ _ | ___ \/ ___| # # | . . | | | | |_/ / |_/ / | | | |_/ /\ `--. # # | |\/| | | | | /| /| | | | / `--. \ # # | | | |_| |_| |\ \| |\ \\ \_/ / |\ \ /\__/ / # # \_| |_/\___/\_| \_\_| \_|\___/\_| \_|\____/ # ################################################# run_report('\tmirrors') from BMM.motors import XAFSEpicsMotor, Mirrors, XAFSTable, GonioTable ## harmonic rejection mirror m3_yu = XAFSEpicsMotor('XF:06BMA-OP{Mir:M3-Ax:YU}Mtr', name='m3_yu') m3_ydo = XAFSEpicsMotor('XF:06BMA-OP{Mir:M3-Ax:YDO}Mtr', name='m3_ydo') m3_ydi = XAFSEpicsMotor('XF:06BMA-OP{Mir:M3-Ax:YDI}Mtr', name='m3_ydi') m3_xu = XAFSEpicsMotor('XF:06BMA-OP{Mir:M3-Ax:XU}Mtr', name='m3_xu') m3_xd = XAFSEpicsMotor('XF:06BMA-OP{Mir:M3-Ax:XD}Mtr', name='m3_xd') mcs8_motors.extend([m3_yu, m3_ydo, m3_ydi, m3_xu, m3_xd]) m1 = Mirrors('XF:06BM-OP{Mir:M1-Ax:', name='m1', mirror_length=556, mirror_width=240) m1.vertical._limits = (-5.0, 5.0) m1.lateral._limits = (-5.0, 5.0) m1.pitch._limits = (-5.0, 5.0) m1.roll._limits = (-5.0, 5.0) m1.yaw._limits = (-5.0, 5.0)
TAB = '\t\t\t' dcm = False from BMM.dcm import DCM #from BMM.user_ns.motors import dcm_x dcm = DCM('XF:06BMA-OP{Mono:DCM1-Ax:', name='dcm', crystal='111') wait_for_connection(dcm) print(f'{TAB}FMBO motor group: dcm') if dcm.connected is True: if hasattr(dcm.bragg, 'tolerance'): # relevant to Jamie's DeadbandEpicsMotor dcm.bragg.tolerance.put(0.0001) dcm_bragg = XAFSEpicsMotor('XF:06BMA-OP{Mono:DCM1-Ax:Bragg}Mtr', name='dcm_bragg') dcm_pitch = VacuumEpicsMotor('XF:06BMA-OP{Mono:DCM1-Ax:P2}Mtr', name='dcm_pitch') dcm_roll = VacuumEpicsMotor('XF:06BMA-OP{Mono:DCM1-Ax:R2}Mtr', name='dcm_roll') dcm_perp = XAFSEpicsMotor('XF:06BMA-OP{Mono:DCM1-Ax:Per2}Mtr', name='dcm_perp') dcm_para = XAFSEpicsMotor('XF:06BMA-OP{Mono:DCM1-Ax:Par2}Mtr', name='dcm_para') dcm_x = XAFSEpicsMotor('XF:06BMA-OP{Mono:DCM1-Ax:X}Mtr', name='dcm_x') dcm_y = XAFSEpicsMotor('XF:06BMA-OP{Mono:DCM1-Ax:Y}Mtr', name='dcm_y') dcm_para.hlm.put(161) # this is 21200 on the Si(111) mono # # hard limit is at 162.48 if hasattr(dcm_bragg,