76 lines
1.8 KiB
Python
Executable File
76 lines
1.8 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from slic.controls import PV
|
|
from slic.daq import BS, DIA
|
|
from slic.scans import Scanner
|
|
from slic.utils import Channels, Config, Elog, Screenshot
|
|
from slic.checkers import PVChecker
|
|
|
|
from devices import *
|
|
from adhoc import *
|
|
|
|
|
|
#fn_cfg = "/sf/alvra/config/exp/current_experiment.json"
|
|
fn_cfg = "./slickits/alvra/config/config.json"
|
|
cfg = Config(fn_cfg)
|
|
|
|
elog = Elog(cfg.elog_url, cfg.screenshot_directory, user=cfg.user, password="supercorrect") #TODO: remove fake password
|
|
screenshot = Screenshot(cfg.screenshot_directory)
|
|
|
|
|
|
check_intensity = PVChecker("SARFE10-PBPG050:HAMP-INTENSITY-CAL", vmin=-100, vmax=300, wait_time=3)
|
|
|
|
bsdaqJF = DIA(#TODO: gain and pedestal?
|
|
instrument="alvra",
|
|
api_address="http://sf-daq-alvra:10000",
|
|
jf_name="JF_4.5M",
|
|
pgroup=cfg.pgroup
|
|
)
|
|
|
|
scansJF = Scanner(
|
|
data_base_dir="scan_data",
|
|
# scan_info_dir="/sf/alvra/data/{}/res/scan_info".format(cfg.pgroup),
|
|
scan_info_dir="./",
|
|
default_counters=[bsdaqJF],
|
|
checker=check_intensity,
|
|
scan_directories=True
|
|
)
|
|
|
|
|
|
#fn_channels = "/sf/alvra/config/com/channel_lists/default_channel_list"
|
|
fn_channels = "./slickits/alvra/config/channel_list"
|
|
channels = Channels(fn_channels)
|
|
|
|
bsdaq = BS(channels, default_file_path="???")
|
|
|
|
scansBSreadLocal = Scanner(
|
|
# data_base_dir="/sf/alvra/data/{}/res/scan_data".format(cfg.pgroup),
|
|
# scan_info_dir="/sf/alvra/data/{}/res/scan_info".format(cfg.pgroup),
|
|
data_base_dir="./",
|
|
scan_info_dir="./",
|
|
default_counters=[bsdaq],
|
|
scan_directories=True
|
|
)
|
|
|
|
|
|
|
|
#TODO: just some generic examples:
|
|
from slic.devices.device import Device
|
|
|
|
shut_und = Device(
|
|
"SARFE10-OPSH044",
|
|
description="Photon shutter after Undulator"
|
|
)
|
|
|
|
pbps_und = Device(
|
|
"SARFE10-PBPS053",
|
|
z_undulator=44,
|
|
description="Intensity position monitor after Undulator (PBPS)"
|
|
)
|
|
|
|
print(shut_und)
|
|
print(pbps_und)
|
|
|
|
|
|
|