99 lines
2.8 KiB
Python
99 lines
2.8 KiB
Python
#!/usr/bin/env python
|
|
|
|
from slic.core.acquisition import SFAcquisition
|
|
from slic.core.acquisition import PVAcquisition
|
|
from slic.core.adjustable import PVAdjustable, DummyAdjustable
|
|
from slic.core.condition import PVCondition
|
|
from slic.core.scanner import Scanner
|
|
from slic.devices.general.delay_stage import DelayStage
|
|
from slic.devices.general.motor import Motor
|
|
from slic.devices.general.smaract import SmarActAxis
|
|
from slic.gui import GUI
|
|
from slic.utils import devices
|
|
from slic.devices.simpledevice import SimpleDevice
|
|
from slic.utils import as_shortcut, Marker
|
|
|
|
from undulator import Undulators
|
|
from undulator import Mono
|
|
|
|
dummy = DummyAdjustable(units="au")
|
|
|
|
mot_x = Motor("SATES30-RETRO:MOT_X", name="Retro X")
|
|
mot_y = Motor("SATES30-RETRO:MOT_Y", name="Retro Y")
|
|
mot_z = Motor("SATES30-RETRO:MOT_Z", name="Retro Z")
|
|
mot_theta = Motor("SATES30-RETRO:MOT_RY", name="Retro Theta")
|
|
|
|
retro = SimpleDevice("Retro Stages", x=mot_x, y=mot_y, z=mot_z, theta=mot_theta)
|
|
|
|
#CH0 = PVAdjustable("SATES30-LSCP10-FNS:CH0:VAL_GET")
|
|
|
|
und = Undulators(name="Undulators")
|
|
#Mon = Mono("SATOP11-OSGM087")
|
|
|
|
Mon = PVAdjustable("SATOP11-OSGM087:SetEnergy", pvname_done_moving="SATOP11-OSGM087:MOVING", name="MONO")
|
|
laser_delay = DelayStage("SLAAT31-LMOT-M808:MOT", name="Laser Delay")
|
|
laser_WP = Motor("SLAAT31-LMOT-M801:MOT", name="Laser WavePlate")
|
|
|
|
channels = [
|
|
"SATFE10-PEPG046:FCUP-INTENSITY-CAL",
|
|
"SATFE10-PEPG046-EVR0:CALCI",
|
|
"SATFE10-PEPG046:PHOTON-ENERGY-PER-PULSE-AVG",
|
|
"SATES30-LSCP10-FNS:CH0:VAL_GET",
|
|
"SATES30-LSCP10-FNS:CH1:VAL_GET",
|
|
"SATES30-LSCP10-FNS:CH4:VAL_GET",
|
|
# "SATES30-LSCP10-FNS:CH0:WFM"
|
|
]
|
|
|
|
pvs = [
|
|
"SATFE10-PEPG046:PHOTON-ENERGY-PER-PULSE-AVG",
|
|
"SATES30-RETRO:MOT_RY.RBV",
|
|
"SATES30-RETRO:MOT_X.RBV",
|
|
"SATES30-RETRO:MOT_Y.RBV",
|
|
"SATES30-RETRO:MOT_Z.RBV"
|
|
]
|
|
|
|
live_channels = [
|
|
"SATES30-LSCP10-FNS:CH0:VAL_GET",
|
|
"SATES30-LSCP10-FNS:CH1:VAL_GET",
|
|
# "SATES30-LSCP10-FNS:CH0:WFM"
|
|
# "SATES30-LSCP10-FNS:CH4:VAL_GET"
|
|
]
|
|
|
|
|
|
|
|
instrument = "furka"
|
|
pgroup = "p19197" #Commissioning p group
|
|
|
|
#check_intensity = PVCondition("SATFE10-PEPG046:FCUP-INTENSITY-CAL", vmin=5, vmax=None, wait_time=3, required_fraction=0.8)
|
|
check_intensity = None
|
|
|
|
daq = SFAcquisition(instrument, pgroup, default_channels=channels, default_pvs=pvs, rate_multiplicator=1)
|
|
#daqPV = PVAcquisition(instrument, pgroup, default_channels=live_channels)
|
|
scan = Scanner(default_acquisitions=[daq], condition=check_intensity)
|
|
|
|
gui = GUI(scan, show_goto=True, show_spec=True, show_run=True)
|
|
|
|
|
|
#scanPV = Scanner(default_acquisitions=[daqPV], condition=check_intensity)
|
|
|
|
|
|
'''
|
|
Button that runs a function
|
|
'''
|
|
@as_shortcut
|
|
def test():
|
|
print("test")
|
|
# use marker() to go to a marker position
|
|
|
|
'''
|
|
Single marker
|
|
'''
|
|
m1 = Marker(dummy,value=25,name='Normal IN')
|
|
|
|
|
|
|
|
print("To start the GUI, run: gui()")
|
|
|
|
|
|
|