Z-plots is an LCLS software application that plots all the values of some set of beamline elements (on y axis), plotted with respect to their longitudinal position in the beamline (x-axis). It's called a Z-plot because of the coordinate system used in accelerators, where Z is the longitudinal axis of the beamline. So Z position is plotted on the x-axis.

These are all the EACT (Estimated Energy) at each Quadrupole (QUAD) in the 52SL2 beamline. This was generated by plotz -b 52 QUAD EACT - see script interface below.

FEATURES

The following are implemented features of the Z-plot tools and canned z-plots already completed:

1) Canned z-plots for some commonly required properties
2) Dialog facility for user defined z-plots
3) Command line tools for z-plots, including modular tools useful for EPICS developers
4) Interactive plotting. Supports zoom, unzoom, log plots, ruler etc
3) Wildcards and regular expressions supported
5) Beamline aware, even for non-modelled devices
6) High Performance. User can very quickly get a z-plot of any kind of EPICS device (~ 4 seconds to acquire and render a plot of all vacuum gauge pressures in the full machine).
7) Full Help provided: https://confluence.slac.stanford.edu/display/ACCSOFT/Z-plots

Getting a z-plot

There are 3 ways:

  1. canned plots from EPICS EDM screens
  2. the interactive interface from EDM
  3. use the basic scripts directly on the command line

Canned z-plots fro EPICS EDM screens

Two predefined Z-plots EDM screens are available:

To close a plot window, please set focus to the "Z-plot" window, and hit Enter. Closing the gnuplot window itself is NOT enough to stop gnuplot from running in the background!

Buttons at the top of the EDM screen can launch small wrapper programs for plotz and plotz_devices.

Interactive zplot of Modelled Devices

To get an interactive session with plotz, hit this button on EDM:

This will bring up an interactive dialog session like this:

Note: when using the interactive plotz session, you don't need quotes around a regular expression.

When you have finished plotting z-plots, type "exit" to close the interactive window.

Interactive zplot of Unmodelled Devices

To get an interactive session with plotz_devices, hit this button on EDM:

This will bring up an interactive dialog session like this:

Z-plot scripts

There are two scripts which can be used to get z-plots. One is for modeled devices (plotz) and the other is for devices that have no model (plotz_devices):

$ plotz QUAD EACT                            ! Plots all QUADs' EACT by Z.
$ plotz '(.cor|quad):(in20|li2[1-5])' bdes   ! Plots BDES of all quads and correctors

$ plotz_devices -l VGXX:% P                  ! Plots all combined Vacuum Guages (on a log plot)
$ plotz_devices -l PICM:LTU%:% P1_LOSS       ! All the PICM P1_LOSSes in the LTU

Note that they differ in two important respects: plotz can take a full regular expression, plotz_devices can't (plotz_devices can take only a pattern with a '%' wildcard).

Put regular expressions in quotes. This stop the unix shell from trying to interpret it.

Options for Z-plots: Zooming, unzooming, logs, rulers etc.

See the top left of the plot for help with zooming (MB3) and unzoom (hit 'a'), log plotting, toggling the grid and toggling ruler mode.

Defining what to z-plot

For modelled devices, you can supply any part of the device you want to match, with a regular expression. For instance "QUAD BDES" is enough because QUAD will match in the "type" part of the name.

See here for a cheat sheet to regular expressions regular-expressions-cheat-sheet-v1.pdf.

For unmodelled devices, you can't use regular expressions, but you can use the simpler "%" wildcard (not "*" because * would be interpreted by the shell). For instance, to get all the vacuum gauge settings, use "VGXX:%".

Why can only plotz take a regular expression?_
Answer: Because plotz sources its list of devices from an aida acquisition of the beamline model, so that it can get area and Z data. It can then parse this beamline with a regular expression. But plotz_devices has to use aidalist to get a list of all devices (since they're not modelled and therefore not in a formal list of beamline device), and aidalist, being an Oracle query, takes only the % wildcard. aidalist could take a regular expression too, and pass that on to Oracle to perform the search, but performance tests found that Oracle takes ~40 seconds to do a regular expression search on AIDA_NAMES, wheres it can do a simple wildcard in <1 second.

  • No labels