presented by Matias Guijarro - BLISS team

Beamline Control Unit, Software Group

HKL Workshop

27th of November, 2018

BLISS:

experiments control

of EBS beamlines

Spec is driving ESRF experiments since 26 years

                   Welcome to "spec" Release 6.03.11
         Copyright (c) 1987-2016 Certified Scientific Software
                          All rights reserved

 (Portions derived from a program developed at Harvard University.)
 (Linked with BSD libedit library for command line editing.)

 Using "/bliss/users/blissadm/spec/redhate4/spec.d"
  for auxiliary file directory (SPECD).

 Getting configuration parameters from "SPECD/matias/config".

 =
 Type h changes for info on latest changes.
 Browse to http://www.certif.com for complete documentation.
 =

 Reading file "SPECD/standard.mac".
 Warning:  No open data file.  Using "/dev/null".
 Type "startup" to initialize data file, etc.

 Reading file "SPECD/site.mac".
 Reading file "/bliss/users/blissadm/local/spec/macros/ID00setup.mac" (level 2).
 Reading file "/bliss/users/blissadm/spec/macros/lock.mac" (level 3).
 Reading file "/bliss/users/blissadm/spec/macros/stlocal.mac" (level 3).
 Reading file "/bliss/users/blissadm/spec/macros/stlist.mac" (level 3).
 Reading file "/bliss/users/blissadm/spec/macros/pseudo.mac" (level 3).
 Reading file "/bliss/users/blissadm/spec/macros/tw.mac" (level 3).
 Reading file "/bliss/users/blissadm/spec/macros/joy.mac" (level 3).
 Reading file "/bliss/users/blissadm/spec/macros/cplotarray.mac" (level 3).

 Doing SETUP.
 Reading file "SPECD/setup".
 Reading file "SPECD/matias/setup".

 1.MATIAS> 

Poor macro language

No continuous scan framework

Limited data management

 No beamline-wide global configuration

No extensibility

Limitations

Workarounds

Maintenance cost

Revolution !

Beamline Instrumentation Support Software

BLISS project goals

State-of-the-art beamline control

Continuous scans, Trajectories,

Data management

Integrated environment

Command Line Interface, Configuration, Online data display

Ready for new challenges

Extensibility, user sequences

BLISS technical choices

Python library + set of tools

Configuration application, Command Line InterfaceOnline data visualisation application

gevent

powered by

online data analysis

data visualisation

data archiving

2D detector

Beacon: configuration, settings, broker

Beacon static configuration service

BLISS modular architecture

All-in-one solution

Welcome to BLISS version 0.2 running on brian (in bliss Conda environment)
Copyright (c) ESRF, 2015-2018
-
Connected to Beacon server on brian (port /tmp/beacon_sV2AIq.sock)
test_session: Executing setup...
Initializing 'heater`
Initializing 's1vo`
Initializing 'hooked_error_m0`
Initializing 'diode3`
Initializing 'diode2`
Initializing 'MG2`
Initializing 's1vg`
Initializing 'hook0`
Initializing 'hook1`
Initializing 'hooked_m1`
Initializing 's1u`
Initializing 'm1enc`
Initializing 'custom_axis`
Initializing 's1ho`
Initializing 'bad`
Initializing 'hooked_m0`
TEST_SESSION INITIALIZED
Done.


TEST_SESSION [1]: loopscan(10, 0.1, diode)
Total 10 points, 0:00:01 (motion: 0:00:00, count: 0:00:01)

Scan 2 Mon Nov 26 23:01:16 2018 /tmp/scans/test_session/ test_session user = matias
loopscan 10 0.1

           #         dt[s]         diode
           0             0     -0.888889
           1      0.102648       8.66667
           2       0.20467      -15.5556
           3      0.306539           -30
           4      0.408959      -1.22222
           5      0.511389       7.11111
           6      0.613842      0.888889
           7      0.716302            16
           8      0.818801            24
           9      0.921281       7.66667

Took 0:00:01.081073 (estimation was for 0:00:01)
         Out [1]: Scan(name=loopscan_2, run_number=2, path=/tmp/scans/test_session/)

TEST_SESSION [2]: 

Support for Trajectories in Scans

Any trajectory can be described as discrete (Position, Velocity, Time) tuples

  • default mode for many controllers
  • BLISS Motor Controller framework allows to easily integrate trajectories
    • currently implemented: PI E712, IcePAP

BLISS online data publishing

from bliss import * # imports generic scans, cleanup functions, etc
from bliss.setup_globals import * # imports objects from session (setup)
import numpy # I know you dreamt of it
import gevent

def set_detector_cover(in):
    wcidxx.set('detcover', in)
 
    # 5 seconds timeout waiting for detector cover to move
    with gevent.Timeout(5):
        while wcidxx.get('detcover_in') == in:
          time.sleep(0.1)

def my_super_experiment(name):
    safety_shutter.open()

    old_att = attenuators.get()

    def restore_beamline():
        set_detcover_open(False)
        attenuators.set(old_att)

    with cleanup(safety_shutter.close):
        with error_cleanup(restore_beamline):
            attenuators.set(50)
            set_detcover_open(True)

            SCAN_SAVING.name = name
            MEASUREMENT_GROUP.enable('diode')
            
            data_node = dscan(m0, -5, 5, 10, 0.1)
            
            for data in data_node.walk_data():
              # do something useful with data...
with cleanup(safety_shutter.close): # cleanup is always called at the end
    with error_cleanup(restore_beamline):  # only called in case of error
        ...

Use of Python context managers for cleanup

Normal Python functions

Easy timeouts with gevent.Timeout

# 5 seconds timeout waiting for detector cover to move
with gevent.Timeout(5):
    while wcidxx.get('detcover_in') == in:
        time.sleep(0.1)

BLISS sequences (a.k.a "macros")

Current state of BLISS

... and developing at the same time...

ID31

ID21 (DCM)

ID15

ID13

ID11

ID10

Assessing the system on beamlines before the shutdown

Wago

Pilatus

Eiger

Andor

Xia Mercury

P201

MUSST

OPIOM

Keithley

Dexela

PI E712

Icepap

Galil

Smaract

NF8742

Symetrie Hexapod

Aerotech

PEPU

Simulink

SB beamlines

BM16

BM32

Road to BLISS v1.0.0

Python 3.7: on-going (almost done !)

 

Documentation writing retreat: 6th of December, 2018

 

Feedback from users: 13th of December

 

3 new developers will join us in January

2019-2020: BLISS deployment during EBS shutdown

ID31, ID13, ID10, ID15A, ID21, ID19


 

ID11, ID16B, BM23, BM29, ID29, ID22, ID32


 

ID24, ID26, ID15B, ID16A, ID12, ID06, BM05

 

 

+ French CRG beamlines (1 engineer to be hired to help)

Diffractometers in BLISS

New development means lots of opportunities

New development means lots of  questions

Diffractometers in BLISS

Calculations will be based on HKL library from F. Picca (SOLEIL), see next presentation

Still, many open questions

  • how to define crystal and UB matrix ? command line vs GUI
  • Saving, retrieving crystal lattice definition for reuse ?
  • how to define reflection angles ?
  • how to select mode ?
  • how to add new geometries ?
  • how to handle axes limits ?
  • collisions check ? 3D modelling of diffractometer ?
  • HKL trajectories scans
  • how to handle multiple diffractometers ?
  • metadata in HDF5 files: crystal info and what else ? In which form?
  • which online data display ?
  • ...

Not reinventing anything: inspiration to be taken from spec and experience from scientists

HKL workshop

By Matias Guijarro

HKL workshop

  • 1,101