Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muons: continuously-updating plot of temperature next to console #5015

Closed
Tom-Willemsen opened this issue Dec 6, 2019 · 4 comments
Closed

Comments

@Tom-Willemsen
Copy link
Contributor

Tom-Willemsen commented Dec 6, 2019

As an instrument scientist on muon beamlines, I would like a constantly updating plot of temperature (or other sample environment variable, such as magnetic field) to appear next to my scripting console.

Acceptance Criteria:

  • A matplotlib plot appears next to the existing scripting console
  • The plot appears when the script console is opened without needing to issue any explicit command
  • The plotting code finds the "temperature" and appends this to the graph at a regular interval (e.g. a few seconds)
    • We will need to consult with the scientists to figure out an algorithm which finds the "temperature" block in any given configuration. One approach would be to establish a block naming convention, where a block with a particular name always gets plotted.
    • Block is always called "Temp_RBV"
  • The graph permits the plotting of at least two traces (e.g. setpoint and readback values) (see Chris's comment below)
  • The contents of the graph is cleared when a new run begins
  • The plotting code runs in the background (for example, in a different thread), so that the console can still be used as normal.
  • The plot keeps going through a configuration change, and reflects any new "most representative" temperature from the new configuration. See ticket 5015-1: Make graph continuous through config change #5284
    • It is acceptable to have a brief gap in the data while the actual IOCs are restarting, but once the config is fully loaded the plots should resume plotting without any user intervention.

Notes:

  • Matplotlib plots can already been shown next to the python console using the pyplot.show() command
  • We should pay attention to what happens if multiple scripting consoles are opened - only one plotting job should run at the same time.
  • This will be used by multiple beamlines, so the InstrumentScripts repository would be a sensible place to create this code
  • The muon scientists expect users not to have to type any explicit python commands for the plot to work. It should run in the background with no intervention required.

Update

This is causing a crash as an interaction between ca channels in scripting window and normal windows. So new plan:

  • Put in separate process run by the instrument
  • Make GUI open separate tab to graph
  • Put graph on different port
@John-Holt-Tessella
Copy link
Contributor

Ideally this wants to be the start of a generalised framework. So that the scientists can easily extend it to create the plots that they want to see. I would see it being something like a class that they can inherit from or a static context they can push options to. At its simplest level of configuration the scientist inherits/set option on it which declares the block they want to plot. The next level is that they can override what happens on config change or on run start. Finally they might want to change what happens on plot. Make the initially implementation as simple as possible but with this in mind for the future.

@ChrisM-S
Copy link

ChrisM-S commented Dec 9, 2019

Probably worth adding this explicitly in case I've missed seeing the need in the acceptance criteria:

o Temperature plots will at least two traces, Desired Setpoint and Actual temperature.

(SECI experience on this - it will be required!).

@John-Holt-Tessella
Copy link
Contributor

relies on #5175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants