added adhoc lxt; switch to Channels.from_file; more detector cfg; adjusted condition; added spreadsheet; update pvs on launch; added sfxdaq/sfxgui/pedestalgui; added PVAdj that presses go button
This commit is contained in:
97
alvra.py
97
alvra.py
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from slic.core.acquisition import SFAcquisition
|
||||
from slic.core.adjustable import PVAdjustable
|
||||
#from slic.core.acquisition import BSAcquisition, DBAcquisition, DIAAcquisition, PVAcquisition, SFAcquisition
|
||||
#from slic.core.acquisition.bschannels import BSChannels
|
||||
from slic.core.scanner import Scanner
|
||||
@ -12,6 +13,8 @@ from slic.utils import Config, Elog, Screenshot, load_channels
|
||||
from slic.core.condition import PVCondition
|
||||
from slic.gui import GUI
|
||||
|
||||
from slic.core.acquisition.spreadsheet import Spreadsheet
|
||||
|
||||
from slic.utils import devices
|
||||
from slic.utils import Marker, as_shortcut
|
||||
|
||||
@ -19,9 +22,6 @@ from devices import *
|
||||
from adhoc import *
|
||||
|
||||
|
||||
adhoc_lxt = PVAdjustable("SLAAR01-LTIM-PDLY:DELAYNS", pvname_done_moving="SLAAR01-LTIM-PDLY:WAITING", name="adhoc lxt")
|
||||
|
||||
|
||||
#TODO: why do we need this suddenly?
|
||||
try:
|
||||
from IPython import get_ipython
|
||||
@ -51,24 +51,38 @@ pvs = PVChannels.from_file(fn_pvs)
|
||||
#fn_channels = "/sf/alvra/config/com/channel_lists/laser_channel_list_BS"
|
||||
#fn_pvs = "/sf/alvra/config/com/channel_lists/laser_channel_list_PV"
|
||||
#
|
||||
#channels = Channels(fn_channels)
|
||||
#channels = BSChannels.from_file(fn_channels)
|
||||
#detectors = None
|
||||
#pvs = Channels(fn_pvs)
|
||||
#pvs = PVChannels.from_file(fn_pvs)
|
||||
|
||||
|
||||
detectors_raw = DetectorConfig("JF06T32V02", "JF02T09V03")
|
||||
#detectors_raw = DetectorConfig("JF06T32V02", "JF02T09V03")
|
||||
|
||||
detectors_raw = DetectorConfig()
|
||||
|
||||
detectors_config = DetectorConfig()
|
||||
|
||||
#detectors_config.add("JF06T32V02", remove_raw_files=True)
|
||||
#detectors_config.add("JF06T32V03")
|
||||
#detectors_config.add("JF06T32V07", adc_to_energy=True, geometry=True, compression=True, double_pixels_action='mask', factor=7.1, remove_raw_files=True) ## this is for LaB6
|
||||
detectors_config.add("JF06T32V07", adc_to_energy=True, compression=True, crystfel_lists_laser=True, double_pixels_action='mask', factor=8.0, remove_raw_files=True, save_dap_results=True) ## this is for CrystFEL
|
||||
#detectors_config.add("JF06T32V07", adc_to_energy=True, geometry=True, compression=True, double_pixels_action='mask', factor=0.25, downsample=(2,2), remove_raw_files=True) ## this is for XSS
|
||||
|
||||
#detectors_config.add("JF06T08V03")
|
||||
detectors_config.add("JF06T08V03", adc_to_energy=True, compression=True, crystfel_lists_laser=True, double_pixels_action='mask', factor=0.25, remove_raw_files=True)
|
||||
#detectors_config.add("JF06T08V06")
|
||||
#detectors_config.add("JF06T08V07", adc_to_energy=True, geometry=True, compression=True, double_pixels_action='mask', factor=8.01, remove_raw_files=True) ## this is for LaB6
|
||||
#detectors_config.add("JF06T08V07", adc_to_energy=True, compression=True, crystfel_lists_laser=True, double_pixels_action='mask', factor=8.01, remove_raw_files=True, save_dap_results=True) ## this is for CrystFEL
|
||||
|
||||
#detectors_config.add("JF02T09V03", disabled_modules=[0, 3, 4, 7, 8], remove_raw_files=True)
|
||||
#detectors_config.add("JF02T09V03")
|
||||
#detectors_config.add("JF02T09V03", adc_to_energy=True, geometry=True, roi={'Cr2UP':[290, 320, 2800, 3500], 'Cr2DW':[200, 230, 2800, 3500]})
|
||||
#detectors_config.add("JF02T09V03", adc_to_energy=True, geometry=True, roi={
|
||||
#'LbUP1':[280, 330, 5800, 6600],
|
||||
#'LbDW1':[160, 210, 5800, 6600],
|
||||
#'LbUP2':[280, 360, 2600, 3400],
|
||||
#'LbDW2':[140, 220, 2700, 3500],
|
||||
#'LbUP1_bkg':[350, 400, 5800, 6600],
|
||||
#'LbDW1_bkg':[90, 140, 5800, 6600],
|
||||
#'LbUP2_bkg':[380, 460, 2600, 3400],
|
||||
#'LbDW2_bkg':[40, 120, 2700, 3500]
|
||||
#})
|
||||
|
||||
|
||||
|
||||
@ -78,12 +92,50 @@ detectors = detectors_config
|
||||
|
||||
|
||||
#check_intensity = PVCondition("SARFE10-PBPG050:HAMP-INTENSITY-CAL", vmin=0, vmax=1500, wait_time=0.25, required_fraction=0.8)#
|
||||
check_intensity = PVCondition("SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US", vmin=0, vmax=2000, wait_time=0.5, required_fraction=0.8)
|
||||
#check_intensity = PVCondition("SARFE10-PBPS053:INTENSITY", vmin=0.05,vmax=2, wait_time=0.5, required_fraction=0.8)
|
||||
check_intensity = PVCondition("SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US", vmin=50, vmax=2000, wait_time=0.5, required_fraction=0.9)
|
||||
#check_intensity = PVCondition("SARFE10-PBPS053:INTENSITY", vmin=0.05,vmax=10, wait_time=0.5, required_fraction=0.8)
|
||||
#check_intensity = PVCondition("SAROP11-PBPS110:INTENSITY", vmin=0.05,vmax=20, wait_time=0.5, required_fraction=0.8)
|
||||
#check_intensity = PVCondition("SAROP11-PBPS122:INTENSITY", vmin=0.1,vmax=10, wait_time=0.5, required_fraction=0.8)
|
||||
#check_intensity = PVCondition("SAROP11-PBPS110:INTENSITY", vmin=0.1, vmax=10, wait_time=0.5, required_fraction=0.9)
|
||||
#check_intensity = PVCondition("SAROP11-PBPS122:INTENSITY", vmin=0.1, vmax=10, wait_time=0.5, required_fraction=0.9)
|
||||
#check_intensity = None
|
||||
|
||||
daq = SFAcquisition(cfg.instrument, cfg.pgroup, default_channels=channels, default_pvs=list(pvs), default_detectors=detectors, append_user_tag_to_data_dir=True, rate_multiplicator=1)
|
||||
from datetime import datetime
|
||||
|
||||
class Date:
|
||||
def __str__(self):
|
||||
dt = datetime.now()
|
||||
return str(dt).split()[0]
|
||||
|
||||
class Time:
|
||||
def __str__(self):
|
||||
dt = datetime.now()
|
||||
return str(dt).split()[1]
|
||||
|
||||
|
||||
spear_adjs = {
|
||||
"Date": Date(),
|
||||
"Time": Time(),
|
||||
"Energy": mono_und,
|
||||
"Laser Wavelength": 600,
|
||||
"Sample": "Cu Ni",
|
||||
"Edge": "Ni K",
|
||||
"Concentration": "2 mM",
|
||||
"Topas Delay": PVAdjustable("SLAAR01-LTIM-PDLY:SYS_MOVED"),
|
||||
#"vOD Filter": laser.motion.vOD_filter,
|
||||
}
|
||||
|
||||
spreadsheet = Spreadsheet(
|
||||
host="saresa-vcons-01.psi.ch", port=9090, adjs=spear_adjs,
|
||||
placeholders=("Laser Energy", 'Comment')
|
||||
)
|
||||
|
||||
|
||||
#daq = SFAcquisition(cfg.instrument, cfg.pgroup, default_channels=channels, default_pvs=list(pvs), default_detectors=detectors, api_address='http://sf-daq-8:10002', append_user_tag_to_data_dir=True, rate_multiplicator=1, spreadsheet=spreadsheet) #, cell_file="lyso"
|
||||
daq = SFAcquisition(cfg.instrument, cfg.pgroup, default_channels=channels, default_pvs=list(pvs), default_detectors=detectors, append_user_tag_to_data_dir=True, rate_multiplicator=1, spreadsheet=spreadsheet) #, cell_file="lyso"
|
||||
#daq = SFAcquisition(cfg.instrument, cfg.pgroup, default_channels=channels, default_pvs=None, default_detectors=detectors, append_user_tag_to_data_dir=True, rate_multiplicator=1, spreadsheet=spreadsheet) #, cell_file="lyso"
|
||||
|
||||
daq.update_config_pvs()
|
||||
#daq.client.address = 'http://sf-daq-8:10002'
|
||||
|
||||
scan = Scanner(
|
||||
scan_info_dir="/sf/alvra/data/{}/res/scan_info".format(cfg.pgroup),
|
||||
@ -93,7 +145,9 @@ scan = Scanner(
|
||||
default_sensor=None
|
||||
)
|
||||
|
||||
gui = GUI(scan, show_spec=True, show_goto=True, show_run=True)
|
||||
gui = GUI(scan, show_spec=True, show_goto=True, show_run=True, show_sfx=True, extras={"Mono": "Special"})
|
||||
sfx_gui = GUI(scan, show_static=False, show_scan=False, show_spec=False, show_scan2D=False, show_tweak=True, show_goto=True, show_run=False, show_sfx=True, title="SFX GUI")
|
||||
pedestal_gui = GUI(scan, tabs={}, title="Pedestal GUI")
|
||||
|
||||
|
||||
bsdaqJF = Deprecator("bsdaqJF", "daq")
|
||||
@ -110,6 +164,19 @@ scansJF = Deprecator("scansJF", "scan")
|
||||
# default_acquisitions=[daqBS],
|
||||
#)
|
||||
|
||||
class PVAdjustableWithGo(PVAdjustable):
|
||||
|
||||
def __init__(self, *args, pvname_go=None, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.adj_go = None if pvname_go is None else PVAdjustable(pvname_go)
|
||||
|
||||
def set_target_value(self, value):
|
||||
super().set_target_value(value)
|
||||
if self.adj_go is not None:
|
||||
self.adj_go.set_target_value(1).wait()
|
||||
|
||||
#att_ns = PVAdjustableWithGo("SLAAR03-PLAS-EKSPLA:HOLD_ATTN", pvname_go="SLAAR03-PLAS-EKSPLA:EXE_SET_ATTN.PROC", name="OPO transmission")
|
||||
|
||||
|
||||
|
||||
from CTAstuff import CCAcquisition, ccta
|
||||
|
Reference in New Issue
Block a user