presented by Matias Guijarro - BLISS team

Beamline Control Unit, Software Group

NOBUGS         

19/09/2022

PSI, Villigen, Switzerland

 

Beamline Instrumentation Support Software

ESRF beamline control system

image/svg+xml

December, 2015

BLISS project starts

May, 2018

First tests with friendly users

October, 2017

1st talk about BLISS @ ICALEPCS '17 (Barcelona)

 

ESRF Upgrade shutdown period

BLISS team in September 2019

December, 2018

ESRF EBS shutdown

August, 2020

Restart of ESRF user operation

 August 2022

BLISS 1.0

image/svg+xml

Deployment on EBS beamlines

... continuing BLISS deployment on all beamlines ...

March 2020

COVID lockdown

BLISS 1.10

 December, 2020

 February, 2020

1st publication with BLISS data

(hal-02466436)

ID31

BM32

ID21

ID15

ID13

ID11

ID10

Text

BM29

BM23

ID22

ID19

ID29

ID30

ID23

ID26

BM30

ID24

BM05

BM18

ID27

ID09

BM08

BM16

ID01

Full deployment aimed at the horizon of 2024

image/svg+xml

BLISS beamlines (september 2022)

Data portal: https://data.esrf.fr

E-logbook

Live data visualization

Online data analysis workflows

Graphical user interface for data acquisition

Faster detectors, data production

Efficient data format, storage

Today's experiment control system challenges

image/svg+xml

Experiment scripts, user sequences

Jungfrau @ ID29

 Data publishing,

acquisition made independent of storage

Scanning with the acquisition chain

Tree structure to represent "trigger" relationship of devices in a scan

All-in-one solution

configuration management, logging, communication protocols, hw drivers, shell (CLI), scanning engine, live data display, publishing and saving

I/O based on gevent

cooperative multi-tasking,

asyncio interoperability

 

BLISS technical choices and design principles

Written in Python

Built-in direct hardware control

                 extensions for

interoperability with other systems, or in case of shared hw

Mini frameworks

motion control, regulation, monochromator, spectrometer, MCA...

Beacon server

data

streams

Mini frameworks within BLISS, to ease integration of same kind of hardware

Adaptation layer, to make hardware controllers behaving properly in scans, depending on the scan

BLISS modular architecture overview

Daiquiri

web GUI

BLISS data flow

BLISS features tour

Most praised by ESRF scientists

1. Python!

2. Flint, BLISS interactive data display

3. Software axes and counters

4. Software regulation loops

5. Accessing BLISS data on the fly

1. Python!

Example from BM23 (Kirill Lomachenko): beamline "health check" for local contacts via Telegram, thanks to Telegram Python API

Scientists can take advantage of the huge Python ecosystem in their own scripts

1. Python!

from bliss.setup_globals import fsh, diffrz
import numpy as np

def ftomo_series(scanname, start, num_scans, sleep_time=0, pars=None):
    for i in np.arange(start, start+num_scans): 
        newdataset(f"{scanname}{i}")
        umv(diffrz, pars['start_pos'])
        with fsh.closed_context():
            print("taking dark images")
            ftimescan(pars['exp_time'], pars['nref'], 0)
        if i==start or not(i%pars['ref_int']):
            print("taking flat images")
            ref_scan(pars['ref_mot'], pars['exp_time'], pars['nref'], pars['ref_step'], pars['start_pos'], pars['scan_mode'])
        else:
            print("skipping flat images - stay where we are")
            ftimescan(pars['exp_time'], 10,0)
        print("taking projections...")
        fscan(diffrz, pars['start_pos'], pars['step_size'], pars['num_proj'], pars['exp_time'], scan_mode = pars['scan_mode'])
        print("resetting diffrz to 0")
        umv(diffrz, pars['start_pos']+360)
        diffrz.position=pars['start_pos']
        sleep(sleep_time)                                     

Example from ID11: tomography @ nanofocus endstation

25 degrees/s.

diffrz

500 fps

700 GB per hour of (compressed) data

User-written acquisition sequence == night shift macro

continuous, hardware-synchronized scans

direct import of beamline objects from BLISS setup in user scripts

nice Python features: context manager, to ensure fast shutter is closed

whole Python ecosystem can be available

Python functions, with named arguments and default values

2. Flint, BLISS interactive data display tool

Flint is a GUI companion for BLISS for online data visualization

It built based on ESRF silx (ScIentific Library for eXperimentalists) and Qt (Qt)

TOMO_SESSION [1]: edit_roi_counters(tomocam, 1.0)
WARNING 2020-10-16 15:39:45,049 flint: Flint starting...
Waiting for ROI edition to finish on tomocam [default, default]...
WARNING 2020-10-16 15:39:46,999 flint: Waiting for selection in Flint window.

 

 

 

It provides live display of BLISS scans,

custom plotting

and interactive control

from BLISS scripts

 

 

 

It provides live display of BLISS scans,

custom plotting

and interactive control

from BLISS scripts

3.1 Software pseudo axes

Example from BM32: Laue diffraction

Pseudo axis to switch from Energy (HKL reciprocal space)

to crystal angle (real hardware, rotation axis)

Energy to Bragg angle abacus




from bliss.controller.motor import CalcController

class EnergyCalc(CalcController):
  def initialize(self):
    """Load abacus data, to be able to do the calculation"""
    ...
    
  def calc_to_real(self, **positions):
    """Take pseudo axis position, and return real axis position"""
    ...
    
  def calc_from_real(self, **positions):
    """Return calculated axis position from real axis position"""
    ...
    
    
- controller:
    class: EnergyCalc
    package: bm32.ctrls.pseudo_laue
    axes:

    -   name: $thf
        tags: real thf

    -   name: Edia
        tags: Edia
        unit: eV

file: ~/local/bm32/ctrls/pseudo_laue.py

3.2 Software pseudo counters

In BLISS, a counter is a Python object representing an experimental parameter which can be measured during a scan

A Software counter takes multiple counters as inputs and produces multiple calculated counters as outputs

Software counters can be created in code, or declared from the BLISS configuration:

- class: ExpressionCalcCounterController
  name: calc_diodes
  inputs:
      - counter: $diode1
        tags: d1
      - counter: $diode2
        tags: d2
      - counter: $diode3
        tags: d3
      - counter: $diode4
        tags: d4
  constants:
       m : 0.5
       n : 0.8
  outputs:
      - name: intensity
        expression:  (d1 + d2 + d3 + d4 )
      - name: cen_x
        expression:  m*(d2-d1) + m*(d4-d3)
      - name: cen_y
        expression:  m*(d3-d1) + m*(d4-d2)

4. Software regulation loops (see poster by P. Guillou tomorrow)

Example: beam position regulation

Compensation of low frequency drifts due to thermal load changes or mechanical instability

BLISS provides a Software Loop object, that knows how to regulate with PID parameters

 

Existing BLISS objects with "read" interface can be taken as Input, and objects with "set" interface can be taken as Output

5. Accessing BLISS data (see poster by L. Felix tomorow)

Example from ID10: measurement of coherent x-ray speckle patterns

User group from Tubingen University (Germany) developed a data acquisition and processing graphical interface on top of customized Flint and BLISS data API

Contributors: Linus Pithan, Vladimir Starostin, Prof. F. Schreiber

two-time correlation function (TTC) for XPCS
 (X-ray photon correlation spectroscopy) calculated online on NICE cluster

Eiger Lima server

BLISS Data API

Listen to BLISS scans

frames from Lima server + scan metdata

Conclusion

Wants to know more ? Come to try BLISS at the BLISS satellite meeting on Thursday morning

BLISS has been designed to fulfill scientists needs and synchrotron experiments control challenges

More than half of ESRF beamlines run BLISS, all beamlines will be converted at the horizon of 2024

Would be happy to start collaborations around BLISS with interested people

BLISS @ NOBUGS 2022

By Matias Guijarro

BLISS @ NOBUGS 2022

  • 309