pyspMonitor vs. pyspViewer vs. local graphics

PySpectra is a graphics library being used by pyspMonitor and pyspViewer. These are detached applications. PySpectra can also be used within the same process (local mode). Below you find some hints about how to use PySpectra depending on your use case.

pyspMonitor

This application is used for online monitoring. It receives 0D and 1D data created during the execution of Sardana scans through a Sardana Door. The program is started by

pyspMonitor3.py

This command launches a widget as displayed here 4.1. It stays alive until it is closed by the user.

PyspMonitors register to the Macroserver allowing data to be sent to all instances of pyspMonitor. The use case is that a beamline scientist connects from home, opens a pyspMonitor and sees what the user sees.

The function toPyspMonitor(), 7.2, also sends data to all running pyspMonitors. The use case for this feature is to display processed data generated by a Python script or a Macro running between scans.

pyspViewer

The pyspViewer is a stand-alone application receiving (5) data via toPyspViewer() (6.2).

pyspViewer3.py

It is used, if the data to be displayed are created by a Python script running independent of Sardana. In general this will by an analysis script but it could also be a programm reading data from hardware through PyTango bypassing the Sardana or it can be the Bluesky docHandler, see here

Comparing the pyspViewer with the local mode, see below, we find that the pyspViewer has the advantage that the data stay available, even if the Python script creating the data has terminated. The user can then still look at the data, zoom in and out, execute some basic algorthms, create a pdf file, create a .fio file, etc.

local mode graphics

Local mode graphics is generated within the same process. This kind of graphics disappear when the script finishes. Examples of how to create local mode graphics can be found here 7.1.