BLISS:

experiments control

of EBS beamlines

presented by the BLISS team

Beamline Control Unit, Software Group

ESRF, Grenoble, France

ISDD Seminar

16-10-2017

The BLISS core development team

A. Homs

E. Papillon

J. Bodera

C. Guilloud

J. Bodera

M. Guijarro

T. Coutinho

S. Petitdemange

V. Michel

BLISS =

BeamLine Instrumentation Support Software

Why BLISS ?

spec: 26 years driving experiments at ESRF

  • Direct control of devices
    • easier to debug
    • restarting = reset
  • Integrated tool
    • configuration
    • controllers for all kinds of devices
    • plotting
  • Server mode to connect with external processes (GUI...)
  • Commercial support
  • Poor macro language
  • No extensibility
  • Single task operation
  • Exclusive hardware control
  • Per-session configuration, no sharing
  • No built-in continuous scan framework
  • Limited data management
  • No code ownership, less freedom

spec: 26 years driving experiments at ESRF

Limitations

Workarounds

Maintenance cost

The path to BLISS

  • Python library + tools

  • Technical choices

  • Beacon: services for BLISS

  • Configuration example

  • Scanning & data acquisition

  • Online data publishing and visualisation

BLISS Python library and tools

BLISS Python library and tools

Embed into any Python program

>>> from bliss.common.axis import Axis
>>> from bliss.controllers.motors import IcePAP
>>> iceid2322 = IcePAP.IcePAP("iceid2322",
                              {"host": "iceid2322"},
                              [("mbv4mot", Axis, { "address": 1, 
                                                   "steps_per_unit": 80,
                                                   "velocity": 125,
                                                   "acceleration": 500
                                              }
                              )], [])
>>> iceid2322.initialize()
>>> m = iceid2322.get_axis("mbv4mot")
>>> m.velocity()
125.0
>>> m.acceleration()
500.0
>>> m.position()
252.23750000000001
>>>

BLISS Python library and tools

Command Line Interface based on ptpython

matias@kashyyyk:~ % bliss -s test_session
test_session: Executing setup...
Initializing 'heater`
...
Initializing 's1hg`
Done.

>>> ascan(m1, 0, 10, 30, 0.1, diode, save=False)
Total 30 points, 3.0 seconds

Scan 4 Mon Sep 11 11:58:03 2017 <no file> test_session user = guijarro
ascan m1 0 10 30 0.1

  #  timestamp  m1  diode
  0  1.50512e+09   0  499.112
  1  1.50512e+09  0.345  500.799
...
 28  1.50512e+09  9.655  505.622
 29  1.50512e+09  10  499.883

BLISS Python library and tools

Configuration web application

BLISS Python library and tools

Graphical interface for users: interactive web shell

BLISS technical choices

BLISS key concepts

All I/O based on gevent

cooperative multi-tasking

Direct hardware control

Distributed control ownership & shared state

Persistent settings

 cache

 Transient data store

Scan acquisition chain, represented as a tree

BLISS modular architecture

online data analysis

data visualisation

data archiving

Beacon:

services for BLISS

(presented by T. Coutinho)

Beacon static configuration service

Web interface for configuration editing

Beacon server

.yml

Devices & sequences configuration in YAML format

Sessions to group

objects

Python setup file

User scripts

Can replace TANGO DB

Conversion script provided

Configuration web application DEMO

Beacon dynamic services

Beacon server,

services built on top of

Transient data store

Persistent settings cache

Message broker

  • state sharing
  • distributed lock

BLISS Hardware Control

Direct hardware control

image/svg+xml .yml class: IcePAPhost: iceid001axes: - name: psy1 address: 3 ... - name: psz1 address: 4 ... config IcePAP def read_position(self, axis): ...def start_all(self, *motion_list): ... psy1 psz1 Axis settings axis.psy1.dial_position: axis.psy1.offset:... axis.psy1.dial_position: axis.psy1.offset:... 123.4-99.10 -634.710.36 from bliss.config.static import get_configcfg = get_config()psz1 = cfg.get(‘psz1’)psz1.move(200)... Beacon static config settings

Demo: sensor with direct hardware control

BLISS scans

(presented by

S. Petitdemange)

BLISS scans

  • Acquisition chain
    • a tree with master & slave nodes
    • master triggers data acquisition
    • slave takes data
  • AcquisitionMaster, AcquisitionDevice
    • wrappers around BLISS control objects
  • Data writer
    • HDF5

Scans demo

Model for organizing acquired data

  • Mirroring of the Acquisition Chain tree

    • each device in the chain has a name

    • each device define 1 or more 'AcquisitionChannel' objects

  • Acquisition channels

    • must have a name, a type and a shape

  • Metadata

    • scan_info dictionary ({ key: value, ... }) associated with scans

Online data publishing

  • While a scan is running, data is published to the redis database provided by Beacon

    • scalar values are stored directly

    • bigger data (images, spectra) is just referenced

    • configurable time to live (TTL)

  • Any external process can access redis data to perform online data analysis, for example

Online data publishing demo

Conclusion

Project state

  • Current state of deployment
    • MX beamlines are already running BLISS
    • 3 more beamlines (Materials Science) for the end of the year
    • Full deployment in 2020
  • Project is in active development

Conclusion

  • Long term project for EBS beamlines
  • Control paradigm: keep what works, add new concepts
  • Python scanning framework
  • Prepared for current and future challenges
    • scans with online feedback
    • data management
    • evolutive platform