lyse and PyQt

64 views
Skip to first unread message

pel...@terpmail.umd.edu

unread,
Sep 13, 2021, 9:53:08 AM9/13/21
to the labscript suite

Hi All,
    I've been wanting a bit more interactive analysis scripts, and want to use something faster than matplotlib. I tried making a simple test PyQt application, but it only runs once, then crashes on the second shot unless I restart the worker process. Something like a tkinter window will only allow lyse to move to the next shot when the window is closed. Has anyone had any luck making more interactive scripts? or is Lyse mostly designed to work with matplotlib only? Thanks!
    -Peter

Zak V

unread,
Sep 13, 2021, 11:18:16 AM9/13/21
to the labscript suite
Hi Peter,

I'm not sure how feasible it is to have a GUI application running from within a lyse script. It may be possible or it may not be, I'm not sure.

A straightforward way to sidestep that potential issue though would be to write your interactive application as its own program which is run separately, rather than running it from a lyse script. Then you could write a lyse script to send shot files to your application. Basically you'd have lyse send shots to your program in the same way that blacs sends shots to lyse. You could also have your program send data back to the lyse script if you want to update the lyse dataframe with any results. I've done something sort of similar to this in the past and could provide a bit of guidance if you took this approach.

I also have a vague memory that a few years ago, while looking through various labscript-related repos, I saw that someone had written an interactive analysis application. I can't seem to find it at the moment (maybe it was only hosted on Bitbucket), but if anyone still uses it maybe they can point you to it.

Cheers,
Zak

Sauerwein Nick Jacob

unread,
Sep 13, 2021, 11:50:33 AM9/13/21
to the labscript suite

Hey Peter,


Yeah, I did something similar not to long ago. Maybe you can check our github page and then ask me if you have any questions ;).


https://github.com/LQG-EPFL/analysis_plot_panel


Enjoy your day,


Nick Sauerwein


EPFL SB IPHYS LQG

BATIMENT PH, D3 314

STATION 3, CH 1015 LAUSANNE

SWITZERLAND,

CH

Tel: 0041 21 69 34095

Email: nick.sa...@epfl.ch



From: labscri...@googlegroups.com <labscri...@googlegroups.com> on behalf of Zak V <zven...@gmail.com>
Sent: September 13, 2021 5:18:16 PM
To: the labscript suite
Subject: [labscriptsuite] Re: lyse and PyQt
 
--
You received this message because you are subscribed to the Google Groups "the labscript suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to labscriptsuit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/8e98dc5d-0d8d-468c-9d22-b81a295f3446n%40googlegroups.com.

Philip Starkey

unread,
Sep 24, 2021, 3:53:58 AM9/24/21
to labscri...@googlegroups.com
Hi Peter,

Lyse is really only designed to work with matplotlib, but the matplotlib plots are launched within a PyQt window, and there is some ability to customise it (but it's not really documented anywhere - sorry!). We haven't used that ability for a while, but an example of it is here where you define a custom plot class and register it in your lyse analysis script like this. Information can be passed between the lyse analysis script and the custom plot class via the routine storage that persists between shots (so stored data exists for the life of the plot window even though the analysis of a shot may have finished, until it is overwritten by another shot).

We generally just used it to add some custom buttons to the existing plot windows. I'm not sure how far you can push it for creating an entirely custom UI. If it doesn't suit your needs, you are probably best off having a standalone GUI program that communicates with a lyse analysis script via ZMQ or similar for notification of when new shots come in, etc.

Cheers,
Phil

--
You received this message because you are subscribed to the Google Groups "the labscript suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to labscriptsuit...@googlegroups.com.


--
Dr Philip Starkey
Senior Technician (Lightboard developer)

School of Physics & Astronomy
Monash University
10 College Walk, Clayton Campus
Victoria 3800, Australia
Reply all
Reply to author
Forward
0 new messages