![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/1413436/esrf_logo_full.png)
presented by Matias Guijarro - BLISS team
Beamline Control Unit, Software Group
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/1413529/ESRF-Logo-RGB.png)
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>
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4938131/spec_plot_window.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4938146/ps2.png)
Poor macro language
No continuous scan framework
Limited data management
No beamline-wide global configuration
No extensibility
Limitations
Workarounds
Maintenance cost
Revolution !
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534065/delacroix_gilet_jaune.jpg)
Beamline Instrumentation Support Software
BLISS project goals
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4938387/esrf_ebs_mockup.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4938833/new-scientific-challenges.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4938838/mxbl2015.jpg)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4203286/ebs.png)
BLISS technical choices
Python library + set of tools
Configuration application, Command Line Interface, Online data visualisation application
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4940794/HDF_logo.svg.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4942099/redis.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4940778/149-cd5e16ee581b44ef.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/3628032/silx_small.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4206534/TANGO_controls_logo.png)
gevent
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534439/ko_addnews__Open-source.png)
powered by
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4205731/bliss_architecture.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4205734/10-2-arrow-png.png)
online data analysis
data visualisation
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4205743/10-2-arrow-png.png)
data archiving
2D detector
Beacon: configuration, settings, broker
Beacon static configuration service
BLISS modular architecture
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4942099/redis.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4940848/yaml_logo.gif)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/3621771/beacon-config.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4769957/flint.png)
All-in-one solution
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4569924/scan_data_flow.png)
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]:
![](https://jon.dehdari.org/images/logos/bash.png)
Support for Trajectories in Scans
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5068802/ARBITRARY-PATH-GENERATION.gif)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4569924/scan_data_flow.png)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5264531/deesse-hindou-bras-Sigi-Kolbe.jpg)
... and developing at the same time...
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4943874/bliss_beamlines_2018.png)
ID31
ID21 (DCM)
ID15
ID13
ID11
ID10
Assessing the system on beamlines before the shutdown
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5066689/id13users.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4941014/20180501_124524_HDR.jpg)
Wago
Pilatus
Eiger
Andor
Xia Mercury
P201
MUSST
OPIOM
Keithley
Dexela
PI E712
Icepap
Galil
Smaract
NF8742
Symetrie Hexapod
Aerotech
PEPU
Simulink
SB beamlines
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534316/screaming_fear.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534316/screaming_fear.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534316/screaming_fear.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534318/muscles_strong.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534318/muscles_strong.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534318/muscles_strong.png)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534508/software_developers.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534519/under-construction_geek_man_01.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/5534519/under-construction_geek_man_01.png)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/1434663/spongebob.png)
New development means lots of questions
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/4566851/singe-qui-se-gratte-la-tete.jpg)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/331850/images/1717563/225px-Dexter2.png)
HKL workshop
By Matias Guijarro
HKL workshop
- 1,034