SB Day Out, 15th of September 2015, Château de la Beaume, Seyssins - France
Matias Guijarro
Software Engineer @ Beamline Control Unit
European Synchrotron Radiation Facility
Grenoble, France
Foreword
E-motion = new beamline control software replacing spec
E-motion is only part of the system
E-motion is a motor controllers library
"A new sequencer for the beamlines will be developed to replace SPEC.
[...] The new sequencer will be based on Python. [...]
The new sequencer will rewrite the experiment macros so that
they are easier to maintain.
To use the long shutdown optimally, the new system has to be developed and
tested on as many different kinds of experiments as early as possible beforehand.
This means starting the development of the new system as soon as possible.
Extra resources will be hired to help with the development and installation during the long shutdown."
(New Experiment Sequencer (CP1), page 174)
MASSIF beamlines are the first ESRF beamlines without spec
Why?
Why ?
Standards
Strong will to move away from spec
Long time investment in SW development
UPBL10
How?
How ?
Latest BCU developments
production ready
beta version
in development
"Rogue" BCU development
Ideas coming from the study made for FP7 WP 10.2,
and DAQ systems evaluations (ended in June, 2010)
... and highly motivated developers
Configuring with Beacon
T. Coutinho, M. Guijarro, S. Petitdemange
Beacon, brilliant Beamline Configuration
Beacon, brilliant Beamline Configuration
Positioning with the ESRF Motion (Emotion) library
C. Guilloud, M. Guijarro, M. Perez
Emotion features
Default back-end is XML
Beacon back-end
Emotion configuration with Beacon
controller:
class: IcePAP
host: iceid306
axes:
-
name: DtoX
address: 26
steps_per_unit: 80
velocity: 125
acceleration: 500
>>> from beacon import static
>>> cfg = static.get_config()
>>> dtox = cfg.get("DtoX")
>>> dtox
<emotion.axis.Axis object at 0x2729190>
>>> dtox.position()
700.0
>>> dtox.acceleration()
500.0
>>> dtox.velocity()
250.0
bacon:~/local/beamline_control/configuration % tree
.
├── calibrated_diodes.dat
├── eh
│ ├── bpms.yml
│ ├── detector_cover.yml
│ ├── fshutter.yml
│ ├── i0i1.yml
│ ├── __init__.yml
│ ├── MD2S.yml
│ ├── motors
│ │ ├── DtoX.yml
│ │ ├── ehtable.yml
│ │ ├── fshut.yml
│ │ ├── __init__.yml
│ │ ├── mirror.yml
│ │ ├── slitbox.yml
│ │ └── ss2lits.yml
│ ├── musst.yml
│ ├── tango_shutters.yml
│ ├── transmission.yml
│ └── wagos.yml
├── __init__.yml
├── oh
│ ├── bpms.yml
│ ├── frontend.yml
│ ├── __init__.yml
│ ├── mbv1_diode.yml
│ ├── monocal_diode.yml
│ ├── motors
│ │ ├── energy_wl.yml
│ │ ├── __init__.yml
│ │ ├── mono.yml
│ │ ├── pslits.yml
│ │ ├── ss1lits.yml
│ │ ├── transfocator.yml
│ │ └── undulators.yml
│ ├── transfocator.yml
│ └── wagos.yml
├── percent.arr
└── undulators.dat
plugin: emotion
Supported motor controllers
Hardware
PI E517, PI E712, PI E753
Galil DMC 213
PMD 206
NewFocus 8753
FlexDC
IcePAP
Virtual
Slits
KB mirror
2-leg table
3-leg table
Energy
Software
Tango Undulator
MD2 Exporter (for MD2 motors)
PiezoJack
Introducing
Khoros
A. Beteva,
M. Guijarro,
S. Petitdemange
Khoros, MASSIF sequencer and beamline control software
Beamline components
Scanning
Sequences
Khoros Sequences
from khoros import *
from khoros.setup_globals import *
import logging
import sys
import numpy as np
def quick_realign(slits={s1v:0.2}, cnt=i0, mot=thgt, npts=40, start=-0.2, stop=0.2):
def restore_slits(motor_pos = [(m, m.position()) for m in slits.iterkeys()):
for m, pos in motor_pos:
logging.info("Restoring '%s` to %f", m.name, pos)
m.move(pos)
def quick_realign_cleanup(transmission = attenuators.get_transmission()):
fast_shutter.close()
safshut.close()
attenuators.set_transmission(transmission)
with cleanup(quick_realign_cleanup):
with cleanup(restore_slits):
for m, pos in slits.iteritems():
m.move(pos, wait=False)
safshut.open()
fast_shutter.open()
attenuators.set_transmission(100)
flux = cnt.read()
logging.info("Flux before quick realign: %f", flux)
dscan(mot, start, stop, npts, 0.1, cnt)
data = last_scan_data()
max_pos = data[np.argmax(data[:,1]),0]
mot.move(max_pos)
centrebeam()
flux = cnt.read()
logging.info("Flux after quick realign: %f", flux)
Khoros Shell
Web application, a la IPython Notebook (Jupyter)
Khoros intregration within MXCuBE 2
Used as a Python library, no need to start another process
A specific hardware object is used as a "footbridge" for others to get access to exported Khoros objects within MXCuBE
from HardwareRepository.BaseHardwareObjects import HardwareObject
import os
import sys
import khoros
class Khoros(HardwareObject):
def __init__(self, *args):
HardwareObject.__init__(self, *args)
def init(self, *args):
setup_file = self.getProperty("setup_file")
khoros.setup(setup_file, self.__dict__)
Structural Biology Software Status
MXCuBE
Khoros
BsxCuBE
Challenges for the Future
From desktop applications to web applications
Python-based data acquisition
BM29 software (BsxCuBE)
Thanks for your attention
Questions ?