*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
user avatar
chrisjbillington authored
Unsure since when this has been broken, but lyse routines used to work
fine outside of lyse, as long as you specified the h5 file. However,
prior to this fix, when instantiating a `Run` object whilst running a
script outside of lyse, `Run.__init__()` fails to introspect the name
of the main script, in order to select the default group name to which
results should be saved.

The previous introspection code likely predates some changes we made
such that traversing a call stack in order to find the top-level script
is no longer necessary. The analysis routine appears in `sys.modules`
as the `__main__` module, as does the top-level script when running an
analysis routine from outside of lyse. So we can just use that. As
before, if the `Run` object finds it is being instantiated in an
unusual environment where there is no `__main__` module in
`sys.modules` or it doesn't have a `__file__`, then we just skip
setting the group name. We used to cough a warning about this, but
that's no longer needed as the user will instead get an exception if
they try to save a result, telling them they they need to set the group
first.
5138e40a
History
the labscript suite – lyse

the labscript suite » lyse

Online analysis of live experiment data

Actions Status License Python Version PyPI Conda Version Google Group

lyse is a data analysis framework for experiments controlled by the labscript suite. It coordinates online analysis of live experiment data, by automatically running Python analysis scripts.

Analysis routines are Python scripts that can be run on a labscript experiment (HDF5) file. We break analysis into two distinct groups:

  1. single-shot analysis routines analyze a single HDF5 file corresponding to one realization of an experimental sequence, or shot; and
  2. multi-shot analysis routines perform higher-order analysis on data from many shots.

A set of Python scripts can be loaded for each analysis category, which will run (when appropriate) on new shot files as they are sent to lyse from blacs. Acquired data, global variables from runmanager and analysis results generated in lyse, for all loaded shots, are stored in a table (a pandas DataFrame. This is a powerful analysis schema that takes advantage of the self-documenting nature of labscript experiment shot files.

The DataFrame is displayed in the lyse GUI and can also be accessed remotely from another PC as follows:

import lyse
df = lyse.data(host='127.0.0.1', port=42519)

Moreover, the lyse DataFrame can be serialized so that an analysis session can be restored in lyse or in a headless environment.

lyse interface – screenshot

The lyse interface, comprising:

  • Single- and multi-shot analysis routines (Python scripts);
  • A graphical representation of the Pandas DataFrame;
  • Figures generated by the analysis scripts.†
  • The output log from lyse and the analysis routines.

† In this example, these are publication quality figures generated for the manuscript Science 364, pp. 1267 (2019) doi:10.1126/science.aat5793.

Installation

lyse is distributed as a Python package on PyPI and Anaconda Cloud, and should be installed with other components of the labscript suite. Please see the installation guide for details.