From fc9f717c7a51e7a8ff6fe27b7b9299f3c66bac57 Mon Sep 17 00:00:00 2001 From: gac-furka Date: Wed, 29 Jan 2025 12:35:24 +0100 Subject: [PATCH] added several shortcuts; added several adjustables; added detector --- furka.py | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 149 insertions(+), 14 deletions(-) diff --git a/furka.py b/furka.py index c4d1c9f..43bb1dc 100644 --- a/furka.py +++ b/furka.py @@ -26,7 +26,7 @@ from sensors import * mono_new = PVAdjustable("SATOP11-OSGM087:SetEnergy", "SATOP11-OSGM087:photonenergy", accuracy=0.1, process_time=10, name="Mono new") -from tth import Coupled_tth, Coupled_tth_outer, Coupled_tth_RIXSside +from tth import Coupled_tth, Coupled_tth_outer_RixsSide, Coupled_tth_RIXSside from tth import LakeShore from tth import Coupled_THzGate from tth import Coupled_THzGate_fixedDelta @@ -39,7 +39,7 @@ from qspace import HistoryDummy from constraints import ExtraConstraint -from sasespec import sasespecs +#from sasespec import sasespecs @@ -60,6 +60,8 @@ parab_RY = Motor("SATES30-MCS001:MOT_4", name="Parab RY") parab_RX = Motor("SATES30-MCS001:MOT_7", name="Parab RX") taget_along_beam = SmarActAxis("SATES30-XSMA184:MOT6", name="Target along beam") +I0_filter= Motor("SATES30-MCS003:MOT_12", name="I0 Filter") + #Retro Chamber Motors #mot_x = Motor("SATES30-RETRO:MOT_X", name="Retro X") #mot_y = Motor("SATES30-RETRO:MOT_Y", name="Retro Y") @@ -150,13 +152,14 @@ TX = ParkableMotor("SATES30-ARES:MOT_STX", name = "Diff TX") TY = ParkableMotor("SATES30-ARES:MOT_STY", name = "Diff TY") TZ = ParkableMotor("SATES30-ARES:MOT_STZ", name = "Diff TZ") TwoTRY=ParkableMotor("SATES30-ARES:MOT_2TRY", name = "Diff 2TRY") +JFRY = ParkableMotor("SATES30-ARES:MOT_JFRY", name = "Diff JFRY") tth_scan = Coupled_tth(delta=0, name="theta 2theta") tth_scan_RIXS = Coupled_tth_RIXSside(delta=0, name='theta 2theta RIXS side') -tth_scan_outer = Coupled_tth_outer(delta=0, name="theta 2theta outer") +tth_scan_outer = Coupled_tth_outer_RixsSide(delta=0, name="theta 2theta outer") Thz_Gate_scan = Coupled_THzGate( name = "THz Gate coupled ") -Thz_Gate_scan_fixedD = Coupled_THzGate_fixedDelta(delta=73.11, name = "Thz Gate fix Delta") +Thz_Gate_scan_fixedD = Coupled_THzGate_fixedDelta(delta=48.509, name = "Thz Gate fix Delta") GRX = Motor("SATES30-RIXS:MOT_GRX", name = "Pitch grating") DTZ = Motor("SATES30-RIXS:MOT_DTZ", name = "DTZ (r2)") @@ -206,7 +209,7 @@ spreadsheet = Spreadsheet(spreadsheet_info, placeholders=["comment", "sample"], instrument = "furka" -pgroup = "p21972" #User p group +pgroup = "p21645" #User p group #check_intensity = PVCondition("SATFE10-PEPG046:FCUP-INTENSITY-CAL", vmin=5, vmax=None, wait_time=3, required_fraction=0.8) check_intensity = PVCondition("SATBD01-DBPM060:Q2", vmin=5, vmax=None, wait_time=1, required_fraction=0.8) @@ -214,8 +217,9 @@ check_intensity = PVCondition("SATBD01-DBPM060:Q2", vmin=5, vmax=None, wait_time -detectors = DetectorConfig("JF18T01V01") -#detectors = None #Remove this line to enable Jungfrau! +#detectors = DetectorConfig("JF18T01V01") +#detectors = DetectorConfig("JF19T01V01") +detectors = None #Remove this line to enable Jungfrau! daq = SFAcquisition(instrument, pgroup, default_channels=channels, default_pvs=pvs, default_detectors=detectors, rate_multiplicator=1, spreadsheet=spreadsheet) daq.update_config_pvs() @@ -306,7 +310,8 @@ def KBh_Pointing(KBh_RYv): print("KBh pointing change done") -def GoToXAS_RIXS(RYv, TwoTRYv, Del_or_Norm, ESv, GAv, MonoNewv, HWPv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, KBh_RYv, DC_updownv ): +def GoToXAS_RIXS(RYv, TwoTRYv, Del_or_Norm, ESv, GAv, MonoNewv, HWPv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, +KBh_RYv, DC_updownv, I0_fil_v ): #close shutter caput('SATOP31-OPSH138:REQUEST', 'close') #caput('SATES30-MCS003:MOT_5.VAL', DC_updownv) @@ -335,17 +340,147 @@ def GoToXAS_RIXS(RYv, TwoTRYv, Del_or_Norm, ESv, GAv, MonoNewv, HWPv, KBv_B1v, K print("Mono done") laser_WP.set_target_value(HWPv).wait() print("HWP done") + I0_filter.set_target_value(I0_fil_v).wait() + print("I0 filter done") print("all done") return 1 - -@as_shortcut -def TrXAS_pos(name = "TrXAS Positions"): - GoToXAS_RIXS(-44.8, 45, "Del", 400, 1.0, 578.2, 22.0, 3.8459, 3.8378, 3.8200, 4.0200, 13.1998, 13.11231, 0.0) + +def GoToRIXS(RYv, Del_or_Norm, ESv, GAv, MonoNewv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, +KBh_RYv, DC_updownv): + #close shutter + caput('SATOP31-OPSH138:REQUEST', 'close') + caput('SATES30-MCS003:MOT_5.VAL', DC_updownv) + print("DC target moved") + KBv_Focusing(KBv_B1v-0.1, KBv_B2v-0.1) + KBv_Focusing(KBv_B1v, KBv_B2v) + KBv_Pointing(KBv_RXv) + KBh_Focusing(KBh_B1v-0.1, KBh_B2v-0.1) + KBh_Focusing(KBh_B1v, KBh_B2v) + KBh_Pointing(KBh_RYv) + print("KB pointing done") + mu.set_target_value(RYv) + print("RY movement done") + if Del_or_Norm == "Del": + caput('SLAAT01-LTIM-PDLY:DELAYEDSHOT.PROC', 1 ) + else: + caput('SLAAT01-LTIM-PDLY:NORMAL.PROC', 1 ) + print("delay mode done") + Mon_ES.set_target_value(ESv).wait() + print("Exit slit done") + gas_attenuator_trans.set_target_value(GAv).wait() + print("GA done") + mono_new.set_target_value( MonoNewv).wait() + print("Mono done") + print("all done") + return 1 + + +def GoToXAS(Del_or_Norm, ESv, GAv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, +KBh_RYv, DC_updownv): + #close shutter + print("Shutter closed") + caput('SATOP31-OPSH138:REQUEST', 'close') + caput('SATES30-MCS003:MOT_5.VAL', DC_updownv) + print("DC target moved") + KBv_Focusing(KBv_B1v-0.1, KBv_B2v-0.1) + KBv_Focusing(KBv_B1v, KBv_B2v) + KBv_Pointing(KBv_RXv) + KBh_Focusing(KBh_B1v-0.1, KBh_B2v-0.1) + KBh_Focusing(KBh_B1v, KBh_B2v) + KBh_Pointing(KBh_RYv) + print("KB pointing done") + if Del_or_Norm == "Del": + caput('SLAAT01-LTIM-PDLY:DELAYEDSHOT.PROC', 1 ) + else: + caput('SLAAT01-LTIM-PDLY:NORMAL.PROC', 1 ) + print("delay mode done") + Mon_ES.set_target_value(ESv).wait() + print("Exit slit done") + gas_attenuator_trans.set_target_value(GAv).wait() + print("GA done") + # mono_new.set_target_value( MonoNewv).wait() + #print("Mono done") + print("all done") + return 1 + + +def GoToDC_timing(Del_or_Norm, ESv, GAv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, KBh_RYv, DC_updownv): + #close shutter + caput('SATOP31-OPSH138:REQUEST', 'close') + print("Shutter closed") + caput('SATES30-MCS003:MOT_5.VAL', DC_updownv) + print("DC target moved") + KBv_Focusing(KBv_B1v-0.1, KBv_B2v-0.1) + KBv_Focusing(KBv_B1v, KBv_B2v) + KBv_Pointing(KBv_RXv) + KBh_Focusing(KBh_B1v-0.1, KBh_B2v-0.1) + KBh_Focusing(KBh_B1v, KBh_B2v) + KBh_Pointing(KBh_RYv) + print("KB pointing done") + if Del_or_Norm == "Del": + caput('SLAAT01-LTIM-PDLY:DELAYEDSHOT.PROC', 1 ) + else: + caput('SLAAT01-LTIM-PDLY:NORMAL.PROC', 1 ) + print("delay mode done") + Mon_ES.set_target_value(ESv).wait() + print("Exit slit done") + gas_attenuator_trans.set_target_value(GAv).wait() + print("GA done") + print("all done") + return 1 + + +def GoTo_RIXS(Del_or_Norm, ESv, GAv, DC_updownv): + #close shutter + caput('SATOP31-OPSH138:REQUEST', 'close') + print("Shutter closed") + caput('SATES30-MCS003:MOT_5.VAL', DC_updownv) + print("DC target moved") + if Del_or_Norm == "Del": + caput('SLAAT01-LTIM-PDLY:DELAYEDSHOT.PROC', 1 ) + else: + caput('SLAAT01-LTIM-PDLY:NORMAL.PROC', 1 ) + print("delay mode done") + Mon_ES.set_target_value(ESv).wait() + print("Exit slit done") + gas_attenuator_trans.set_target_value(GAv).wait() + print("GA done") + print("all done") + return 1 @as_shortcut -def RIXS_pos(name = "RIXS Positions"): - GoToXAS_RIXS(-36.8,50, "Norm", 70, 0.2, 576.8, 22.0, 3.1890, 3.340, 3.810, 4.010, 13.188, 13.128, 4) +def DC_timing_pos(name = "DC timing Positions"): + GoToDC_timing("Del", 2000, 1.0, 3.9599, 4.0400, 4.6199, 4.9199, 13.1400, 13.0650, -10.0) +#GoToDC_timing(Del_or_Norm, ESv, GAv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, KBh_RYv, DC_updownv) + + +@as_shortcut +def TrXAS_pos(name = "TrXAS Positions"): + GoToXAS("Del", 100, 1.0, 3.66, 3.74, 3.8200, 4.1200, 13.1350, 13.0850, 0.0) +#GoToXAS(Del_or_Norm, ESv, GAv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, KBh_RYv, DC_updownv): + +#Dec 2024 +@as_shortcut +def TrRIXS_pos(name = "TrRIXS Positions"): + GoToXAS("Norm", 90, 0.8, 3.26, 3.34, 3.8200, 4.1200, 13.1300, 13.0850, 0.0) +##GoToXAS(Del_or_Norm, ESv, GAv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, KBh_RYv, DC_updownv): + + + +#def RIXS_pos(name = "RIXS Positions"): +# GoToXAS_RIXS(0,50, "Norm", 70, 0.05, 576.8, 22.0, 3.1890, 3.340, 3.810, 4.010, 13.188, 13.128, 0.0, -14.5) + +#@as_shortcut +#def RIXS_pos(name = "RIXS Positions"): +# GoTo_RIXS("Norm", 80, 1, -5.3) +# +#@as_shortcut +#def timing_pos(name = "Timing Positions DC"): +# GoTo_RIXS("Del", 1000, 1, -10.3) + + + #@as_shortcut #def EOS_pos(name = "EOS Positions"):