Feb 2024 status

This commit is contained in:
gac-furka
2024-02-08 14:01:58 +01:00
parent b6746d317a
commit f7ee0918c3
17 changed files with 758 additions and 47 deletions

155
furka.py
View File

@ -2,6 +2,7 @@
from slic.core.acquisition import SFAcquisition
from slic.core.acquisition import PVAcquisition
from slic.core.acquisition import BSChannels, PVChannels, DetectorConfig
#from slic.core.acquisition import FakeAcquisition
from slic.core.adjustable import PVAdjustable, DummyAdjustable
from slic.core.condition import PVCondition
@ -25,17 +26,20 @@ 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
from tth import Coupled_tth, Coupled_tth_outer, Coupled_tth_RIXSside
from tth import LakeShore
from tth import Coupled_THzGate
from tth import Coupled_THzGate_fixedDelta
from SASE_motions import SASE_coupled_camera
from qspace import QSpace3D
from qspace import Wavelength
from qspace import HistoryDummy
from constraints import ExtraConstraint
from sasespec import sasespecs
@ -43,7 +47,7 @@ from epics import caput
class ParkableMotor(Motor):
def park(self):
kill_pvname = self.pvname[:-4] + "_KILL"
kill_pvname = self.pvname + "_KILL"
caput(kill_pvname, 1)
@ -52,8 +56,8 @@ dummy = DummyAdjustable(units="au")
from slic.devices.general.smaract import SmarActAxis
parab_RY = SmarActAxis("SATES30-XSMA182:MOT4", name="Parab RY")
parab_RX = SmarActAxis("SATES30-XSMA182:MOT7", name="Parab RX")
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")
@ -66,8 +70,14 @@ taget_along_beam = SmarActAxis("SATES30-XSMA184:MOT6", name="Target along beam")
#Furka Kbs motors
KBV_RX = PVAdjustable("SATOP31-OKBV178:W_RX.VAL", pvname_moving="SATOP31-OKBV178:MOVING", name = "KB Ver RX")
KBH_RY = PVAdjustable("SATOP31-OKBH179:W_RY.VAL", pvname_moving="SATOP31-OKBH179:MOVING", name = "KB Horiz RY")
KBv_RX = PVAdjustable("SATOP31-OKBV178:W_RX.VAL", pvname_moving="SATOP31-OKBV178:MOVING", name = "KB Ver RX")
KBv_B1 = PVAdjustable("SATOP31-OKBV178:BU.VAL", pvname_moving="SATOP31-OKBV178:MOVING", name = "KB Ver B1")
KBv_B2 = PVAdjustable("SATOP31-OKBV178:BD.VAL", pvname_moving="SATOP31-OKBV178:MOVING", name = "KB Ver B2")
KBh_RY = PVAdjustable("SATOP31-OKBH179:W_RY.VAL", pvname_moving="SATOP31-OKBH179:MOVING", name = "KB Horiz RY")
KBh_B1 = PVAdjustable("SATOP31-OKBH179:BU.VAL", pvname_moving="SATOP31-OKBH179:MOVING", name = "KB Hor B1")
KBh_B2 = PVAdjustable("SATOP31-OKBH179:BD.VAL", pvname_moving="SATOP31-OKBH179:MOVING", name = "KB Hor B2")
@ -130,25 +140,30 @@ wl = Wavelength(mono_new)
#Diffractometer motions
mu = ParkableMotor("SATES30-ARES:MOT_SRY.VAL", name = "Diff RY")
chi = ParkableMotor("SATES30-ARES:MOT_SRZ.VAL", name = "Diff RZ")
phi = ParkableMotor("SATES30-ARES:MOT_SRX.VAL", name = "Diff RX")
nu = ParkableMotor("SATES30-ARES:MOT_DRY.VAL", name = "Diff DRY")
q = QSpace3D("SOMETHING:Q", mu, chi, phi, nu, wl)
##Diffractometer motions
mu = ParkableMotor("SATES30-ARES:MOT_SRY", name = "Diff RY")
chi = ParkableMotor("SATES30-ARES:MOT_SRZ", name = "Diff RZ")
phi = ParkableMotor("SATES30-ARES:MOT_SRX", name = "Diff RX")
nu = ParkableMotor("SATES30-ARES:MOT_DRY", name = "Diff DRY")
#q = QSpace3D("SOMETHING:Q", mu, chi, phi, nu, wl)
TX = ParkableMotor("SATES30-ARES:MOT_STX.VAL", name = "Diff TX")
TY = ParkableMotor("SATES30-ARES:MOT_STY.VAL", name = "Diff TY")
TZ = ParkableMotor("SATES30-ARES:MOT_STZ.VAL", name = "Diff TZ")
TwoTRY=ParkableMotor("SATES30-ARES:MOT_2TRY.VAL", name = "Diff 2TRY")
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")
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")
Thz_Gate_scan = Coupled_THzGate( name = "THz Gate coupled ")
Thz_Gate_scan_fixedD = Coupled_THzGate_fixedDelta(delta=36.932, name = "Thz Gate fix Delta")
Thz_Gate_scan_fixedD = Coupled_THzGate_fixedDelta(delta=60.65, name = "Thz Gate fix Delta")
GRX = Motor("SATES30-RIXS:MOT_GRX.VAL", name = "Pitch grating")
DTZ = Motor("SATES30-RIXS:MOT_DTZ.VAL", name = "DTZ (r2)")
GRX = Motor("SATES30-RIXS:MOT_GRX", name = "Pitch grating")
DTZ = Motor("SATES30-RIXS:MOT_DTZ", name = "DTZ (r2)")
SASE_camera_scan = SASE_coupled_camera(delta=-41.149, name="SASE YAG Coupled Camera")
#fake_mu = HistoryDummy.init_from(mu)
#fake_chi = HistoryDummy.init_from(chi)
@ -171,7 +186,11 @@ WL_delay = Motor("SLAAT31-LMOT-M807:MOT", name="WL Delay")
gate_delay = Motor("SLAAT31-LMOT-M808:MOT", name="Gate Delay")
twomicron_delay = Motor("SLAAT31-LMOT-M813:MOT", name="2um Delay")
laser_WP = Motor("SLAAT31-LMOT-M801:MOT", name="Laser WavePlate")
#laser_WP = Motor("SLAAT31-LMOT-M801:MOT", name="Laser WavePlate")
laser_WP = Motor("SLAAT31-LMOT-M809:MOT", name="Laser WavePlate")
laser_fluence = Motor("SLAAT31-LMOT-M801:MOT", name="Laser fluence")
@ -187,14 +206,18 @@ spreadsheet = Spreadsheet(spreadsheet_info, placeholders=["comment", "sample"],
instrument = "furka"
pgroup = "p21266" #Commissioning p group
pgroup = "p21613" #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)
#check_intensity = None
daq = SFAcquisition(instrument, pgroup, default_channels=channels, default_pvs=pvs, rate_multiplicator=1, spreadsheet=spreadsheet)
detectors = DetectorConfig("JF18T01V01")
#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()
#daq = FakeAcquisition(instrument, pgroup, default_channels=channels, default_pvs=pvs, rate_multiplicator=1)
#daq = BSAcquisition .... TBI
@ -203,6 +226,7 @@ daq.update_config_pvs()
scan = Scanner(default_acquisitions=[daq], condition=check_intensity, default_sensor=s3)
gui = GUI(scan, show_goto=True, show_spec=True, show_run=True)
guitest = GUI(scan, show_goto=True, show_spec=True, show_run=True, title="Test GUI")
#scanPV = Scanner(default_acquisitions=[daqPV], condition=check_intensity)
@ -248,24 +272,93 @@ def Diffr_pos(TRYv, DRYv, TXv , TYv, TZv, RXv, RYv, RZv):
for t in ts:
t.wait()
print("moving done")
for t in ts:
t.park()
pms=[TwoTRY, nu, TX, TY, TZ, phi, mu, chi]
for pm in pms:
pm.park()
print("done")
def KBv_Focusing(KBv_B1v, KBv_B2v):
KBv_B1.set_target_value(KBv_B1v-0.15).wait()
KBv_B1.set_target_value(KBv_B1v).wait()
KBv_B2.set_target_value(KBv_B2v-0.15).wait()
KBv_B2.set_target_value(KBv_B2v).wait()
print("KBv moving done")
def KBh_Focusing(KBh_B1v, KBh_B2v):
KBh_B1.set_target_value(KBh_B1v-0.15).wait()
KBh_B1.set_target_value(KBh_B1v).wait()
KBh_B2.set_target_value(KBh_B2v-0.15).wait()
KBh_B2.set_target_value(KBh_B2v).wait()
print("KBh moving done")
def KBv_Pointing(KBv_RXv):
KBv_RX.set_target_value(KBv_RXv-0.15).wait()
KBv_RX.set_target_value(KBv_RXv).wait()
print("KBv pointing change done")
def KBh_Pointing(KBh_RYv):
KBh_RY.set_target_value(KBh_RYv-0.15).wait()
KBh_RY.set_target_value(KBh_RYv).wait()
print("KBh pointing change done")
def GoToXAS_RIXS(TRYv, Del_or_Norm, ESv, GAv, MonoNewv, HWPv, KBv_B1v, KBv_B2v, KBh_B1v, KBh_B2v, KBv_RXv, KBh_RYv ):
#close shutter
caput('SATOP31-OPSH138:REQUEST', 'close')
KBv_Focusing(KBv_B1v, KBv_B2v)
KBv_Pointing(KBv_RXv)
KBh_Focusing(KBh_B1v, KBh_B2v)
KBh_Pointing(KBh_RYv)
TwoTRY.set_target_value(TRYv).wait()
print("2TRY 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("Mono done")
gas_attenuator_trans.set_target_value(GAv).wait()
print("GA done")
mono_new.set_target_value( MonoNewv).wait()
print("Mono done")
laser_WP.set_target_value(HWPv).wait()
print("HWP done")
print("all done")
return 1
@as_shortcut
def TrXAS_pos(name = "TrXAS Positions"):
GoToXAS_RIXS(85, "Del", 400, 1.0, 529, 42, 3.221, 3.444, 3.723, 3.917, 13.218, 13.215)
@as_shortcut
def RIXS_pos(name = "RIXS Positions"):
GoToXAS_RIXS(85, "Norm", 200, 0.8, 529, 42, 3.0209, 3.2439, 3.023, 3.217, 13.233, 13.245)
@as_shortcut
def EOS_pos(name = "EOS Positions"):
Diffr_pos(149.440, 29.5, 3.5, 1.6, -0.7, 0, 82, 0)
Diffr_pos(148.335, 74.5, 0, 3.0, -6.5, 0, -90, -3.0)
@as_shortcut
def Sample_position_45deg(name = "Sample Positions (45 deg)"):
Diffr_pos(65.0, 29.5, 2, -3.6, -0.9, 0, 45, 0)
def CTape_pos(name = "X-ray knife edge"):
Diffr_pos(85, 95, -1, -1.6, -1.5, 0, -30, 0)
@as_shortcut
def EOS_LV_pos(name = "EOS LV Positions"):
Diffr_pos(149.440, 29.5, 3.0, 2.5, -0.69, 15, 82, 0)
def xray_knife(name = "X-ray knife edge"):
Diffr_pos(125, 165.3, 0, 2.0, -6.5, 0, -90, -3.0)
#@as_shortcut
#def Sample_position_RIXS(name = "Sample Positions RIXS"):
# Diffr_pos(85.0, 80.5, -3.6, -1.3, -3, 0, -8, -4)
#@as_shortcut
#def EOS_LV_pos(name = "EOS LV Positions"):
# Diffr_pos(149.440, 29.5, 3.0, 2.5, -0.69, 15, 82, 0)
@as_shortcut
def Transfer_pos(name = "Transfer Positions"):