Files
Documentation/slic.md
T
2022-07-12 15:36:19 +02:00

6.2 KiB

Slic at Cristallina

Philosophy

Slic is a python software component and a lightweight layer on top of a number of established APIs. Here EPICS, and the different DAQ systems are the main underlying infrastructures.

It allows you to define a combination of process variables (PVs) as devices and builts on concepts in EPICS.

"Scannable hardware becomes a single-axis Adjustable, which may be combined into Devices for better discoverability and structure. DAQ methods are unified into Acquisition objects adhering to a minimal acquire logic. The Scanner uses these adjustables and acquisitions to perform any type of scan, which may be arbitrarily customized by providing values to move to if the default ranges if values are not sufficient."

Configuration

Slic reads it configuration from /sf/cristallina/config/com.

  • Channels from channel_lists/default_channel_list

Component implementation

Let's try an example, the JJ Apertures:

ioc records .*OAPU107.* gives us the names of the involved variables:

RECORD                                    RECORD TYPE       DESCRIPTION                               IOC                        FACILITY
----------------------------------------  ----------------  ----------------------------------------  -------------------------  --------
SAROP31-OAPU107:ASYN                      asyn              None                                      SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_H                   motor             width Y                                   SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_W                   motor             width X                                   SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_X                   motor             pos X                                     SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_X1                  motor             motor X1                                  SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_X2                  motor             motor X2                                  SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_Y                   motor             pos Y                                     SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_Y1                  motor             motor Y1                                  SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:MOTOR_Y2                  motor             motor Y2                                  SAROP31-CPPM-MOT6763       swissfel
SAROP31-OAPU107:TC1                       ai                Temperature                               SAROP31-CPCL-PHO7161       swissfel
SAROP31-OAPU107:TC2                       ai                Temperature                               SAROP31-CPCL-PHO7161       swissfel

Here, although many record types are shown as motors many variables are derived, e.g. width, height and pos from X1, X2, ....

Attenuator OATA150

ioc records .OATA150. RECORD RECORD TYPE DESCRIPTION IOC FACILITY


SAROP31-OATA150:TRANS3EDHARM_RB ai transmission 3rd harmonic read_back SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:TRANS_RB ai transmission read_back SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:ENERGY ao None SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:TRANS_SP ao transmission set_point SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:CONFIGASUB aSub None SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:MOT2TRANS aSub None SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:TRANS2MOT aSub None SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:3RD_HARM_SP bo None SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:CONFIG stringin configuration file SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:IDX_RB waveform None SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:MOTOR_1 motor Motor 1 SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:MOTOR_2 motor Motor 2 SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:MOTOR_3 motor Motor 3 SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:MOTOR_4 motor Motor 4 SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:MOTOR_5 motor Motor 5 SAROP31-CPPM-MOT7171 swissfel SAROP31-OATA150:MOTOR_6 motor Motor 6 SAROP31-CPPM-MOT7171 swissfel

Minimal examples

Acquisition

Start slic in /sf/cristallina/applications/slic using ipython -i cristallina.py (with slic conda environment) and acquire some data:

daq = SFAcquisition(instrument='cristallina', pgroup='p19739')
scan = Scanner(default_acquisitions=[daq])
daq.acquire('test_acquisition', n_pulses=1)

Motor control

Motors are based on the EPICS motor component, abstracted in SLIC to speed up initialization (hastyepics.py) and extended in functionality in devices/general/motor.py.

So we can define a motor:

m = Motor("SARFE10-OAPU044:MOTOR_X", name="Test_SARFE10_OAPU044")
print(m.get_current_value())

which yields -0.05, and m.units provides us with the respective units. Here we can also call m.gui() to start an EPICS based panel to see all parameters and status updates.