a few new devices; new spreadsheet; some shortcuts

This commit is contained in:
2023-02-16 17:33:34 +01:00
parent 1d95eef744
commit 3b32cec7af
2 changed files with 231 additions and 83 deletions

View File

@ -4,7 +4,7 @@ from time import sleep
from datetime import datetime
import numpy as np
from tqdm import trange
#from epics import PV
from epics import PV
from slic.gui import GUI
from slic.core.adjustable import Adjustable, PVAdjustable, DummyAdjustable
@ -22,10 +22,11 @@ from slic.utils import devices, Marker, as_shortcut
from devices.attenuator import Attenuator
from devices.undulator import Undulators, TwoColorChicane, Phases
from devices.holo_sample_motion import HoloSample
#from devices.phases import UndPhases
from channels import channels, pvs, detectors
from spreadsheet import overview, print_overview, print_line_for_spreadsheet
from spreadsheet import overview, print_overview, print_line_for_spreadsheet, spreadsheet_info
import colors
@ -53,8 +54,14 @@ pump_probe_delay = Motor("SLAAT21-LMOT-M703:MOT", name="pump_probe_delay")
laser_delay = Motor("SLAAT21-LMOT-M708:MOT", name="Laser Global Delay")
lxt = PVAdjustable("SLAAT01-LTIM-PDLY:DELAY", pvname_done_moving="SLAAT01-LTIM-PDLY:WAITING", name="LXT")
source_y = Motor("SATES20-MANIP1:MOTOR_1", name="Aerosol Injector x")
source_x = Motor("SATES20-MANIP1:MOTOR_2", name="Aerosol Injector y")
source_y = Motor("SATES20-MANIP2:MOTOR_2", name="Needle y")
source_x = Motor("SATES20-MANIP2:MOTOR_1", name="Needle x")
injector_x = Motor("SATES20-MANIP1:MOTOR_1", name="Injector X")
pump_pulse_energy = Motor("SLAAT21-LMOT-M702:MOT", name="Pump Pulse Energy (Waveplate)")
att = Attenuator("SATFE10-OATT064")
shutter = Shutter("SATOP21-OPSH138")
@ -70,7 +77,6 @@ und1.set_limits(390, 1100)
und2.set_limits(390, 1100)
class MonoUndCoupled(Adjustable):
def __init__(self, mono, und, und_energy_offset=0):
@ -94,10 +100,20 @@ class MonoUndCoupled(Adjustable):
mono_und_coupled = MonoUndCoupled(mono, und, und_energy_offset=3)
mono_und_coupled = MonoUndCoupled(mono, und, und_energy_offset=5)
### Smaract stage at an angle in the Yaxis:
#mot_x = SmarActAxis("SATES21-XSMA166:MOT8", name="Table 1: flagx")
#mot_y = Converted(
m1 = PVAdjustable("SATES23-XSMA169:MOT7:DRIVE", internal=True)
m2 = PVAdjustable("SATES23-XSMA169:MOT8:DRIVE", internal=True)
holo_sample_motion_y = HoloSample(m1, m2)
holo_sample_motion_x = SmarActAxis("SATES23-XSMA169:MOT7", name="Table 3: Sample X")
#params = unpickle("devices/phases/UE38_meas_and_fit_data.pickle")["fitdata"]
#und_names = [f"SATUN{i:02}" for i in range(6, 22+1) if i != 14]
#polarization = UndPhases("SATUN-PHASES", params, und_names=und_names, isparallel=True, name="z Polarization")
@ -130,19 +146,19 @@ mark_gascell = Marker(standa, 88.334, "Gas Cell")
mark_tof = Marker(standa, 28.330, "TOF")
#magn = PV("SATUN14-MBND100:CYCLE")
magn = PV("SATUN14-MBND100:CYCLE")
#@as_shortcut
#def cycle_magnet():
# magn.put(1, wait=True)
# for _ in trange(250):
# sleep(1)
# # set the current to 1 and 5 consecutively,
# # since the results after the first step always looks strange
# chic_delay.set(1).wait()
# sleep(1)
# chic_delay.set(5).wait()
# sleep(1)
@as_shortcut
def cycle_magnet():
magn.put(1, wait=True)
for _ in trange(250):
sleep(1)
# set the current to 1 and 5 consecutively,
# since the results after the first step always looks strange
chic_delay.set(1).wait()
sleep(1)
chic_delay.set(5).wait()
sleep(1)
# add some more devices to the overview
@ -153,6 +169,16 @@ overview.LXT = lxt
@as_shortcut
def unstuck_undulators():
und.unstuck()
from slic.core.acquisition.spreadsheet import Spreadsheet
spreadsheet = Spreadsheet(spreadsheet_info, placeholders=["comment", "sample"], host="satese-cons-01", port=9090)
instrument = "maloja"
@ -177,9 +203,13 @@ instrument = "maloja"
#pgroup = "p20553" # liquid jet
#pgroup = "p20561" # HHGX beamtime
#pgroup = "p20568" # COLTRIMS commissioning
pgroup = "p20562" # CD -- Woerner
#pgroup = "p20562" # Circular dichroism -- Woerner
#pgroup = "p20560" # Four-wave-mixing -- Knopp
#pgroup = "p20279" # SPI -- Ban
pgroup = "p20848" # Holo -- Boris
#pgroup = "p20851" # Camera test Edwin
daq = SFAcquisition(instrument, pgroup, default_channels=channels, default_pvs=pvs, default_detectors=detectors, rate_multiplicator=1, append_user_tag_to_data_dir=True)
daq = SFAcquisition(instrument, pgroup, default_channels=channels, default_pvs=pvs, default_detectors=detectors, rate_multiplicator=1, append_user_tag_to_data_dir=True, spreadsheet=spreadsheet)
#daq = FakeAcquisition(instrument, pgroup)
#daqPV = PVAcquisition(instrument, pgroup, default_channels=channels_ks) # workaround for KS not going to DB