Displaying Scanned Data

Automatically choosing the data file to display

Specfe is designed to automatically plot the data scanned by spec. It does this by 'watching' spec's data file and plotting any data that are added to it. The data are displayed in several graph panels (four graphs in the main window, an an arbitrary number of additional graphs opened in separate windows). Each instance of specfe can watch a single data file and can display data from two distinct scans - the 'current' scan and a saved 'reference' scan. Commands are provided to copy the current scan into the reference scan and to clear the reference scan. In the normal operation mode, specfe should automatically be 'told' which file to watch by spec. When you change data files in spec (with the 'newfile' command), specfe should automatically be notified of the change and will start watching the new file.

Automatic plotting of new data scans

As data is added to a file by commands run in the spec program, specfe will automatically read the new data and it it to the scan list. In most cases it will also automatically plot any new scans as they are made. In some circumstances this automatic plotting can be a nuisance, if this is the case you can control the behaviour by means of the 'AUTO LOAD DATA' check box in the main specfe window.

Manually choosing the data file to display

It is also possible to manually choose which data file to display - choose the File->Open Spec Data File... command and a file selection dialog will open, allowing you to choose a new file to watch. The ability to manually choose a file is useful in a number of situations:

  1. If the automatic file selection method fails

  2. If you would like to review data added to a file other than the current spec 'DATAFILE'

  3. If you started up specfe in the file-monitoring mode, where the automatic file selection method is disabled

Displaying a data file in a separate specfe process

Choose the File->Open File in new window... to start up an additional copy of specfe independently watching a data file. You'll be given a file selection dialog to choose the new file to monitor. Once you choose the file, another copy of specfe will be started up which will monitor the file. The new specfe will be running in file-monitoring mode.

Viewing the scans within a spec data file

When specfe opens a file, it first scans through it looking for the individual spec scans contained within it. The Scans menu is updated to display the latest scans, together with the spec commands that generated the scans. You can choose an entry from the Scans menu and specfe will load and display the data from that scan. Choose the Scans->Earlier Scans... command if you want to display earlier scans not directly displayed in the menu.

Figure 1. The "Earlier Scans..." window

One of the notebook pages of the main specfe window contains a list of all the scans in the current data file. You can view earlier scans by double-clicking on entries in this window.

Figure 2. The "Scan List" window

You may also use the Next Scan and Prev Scan buttons to step forward and backward through the scans in a data file.

The 'Reference' Scan

Each specfe instance can display data from two distinct scans within a single data file. If you choose the Graph->Save Current Scan as Reference Scan command or press the Save Reference button the data in the current scan will be duplicated and remembered as the 'reference' scan. At the same time all displayed graphs will be updated so that the new reference scan is displayed in the same configuration as the current data.

The reference data may be cleared either by clicking the Clear Reference button or choosing the Graph->Clear Reference Scan command.

Scan Numbering

You may notice an apparent inconsistency in the scan numbers in the Scans menu. The first number is the number of the scan as found by specfe - this starts from 0 at the start of the file, and increments every time a new scan is found. The number after the "#S" string is the scan number as given by spec. When you start a new file in spec, you are given the opportunity to set the next scan number for that file, indeed it is possible for the same scan number to appear more than once in a spec file. Specfe mostly displays the 'spec' scan number (in graph titles, for example) but displays the positional scan number in the Scans menu.

Choosing what to plot

Each scan read in to specfe is treated as a series of data columns, each named by the header name stored in the spec data file. Each graph panel is divided into two sections, the graph on the left, and a control dialog on the right. You can adjust the relative widths of the graph and the control panel by dragging the vertical divider with the mouse pointer. The control dialog will automatically acquire scroll bars if you try to make it narrower than the width needed to fully display all of its contents.

The control dialog has two sub-pages - one for the Current Scan, and one for the Reference Scan. Each of these lists all the data columns in the particular scan, one per row:

Figure 3. The Specfe Graph Control Dialog

For each data column there is a row of five controls:

Each graph uses a single data column for the 'X' values for each plot curve. Use the 'X' radio button to choose this. The graph can contain up to two curves for each data column - plotted against the left or right hand 'Y' axis ('Y1' and 'Y2'). Use the 'Y1' and 'Y2' check boxes to select which data columns will be plotted, and use the Color button to choose a color for the curve.

Each graph may optionally display a legend in the top right corner - the legend display may be toggled by clicking the Legend button above the graph or by choosing the Graph->Show/Hide Graph Legend... command.

Mouse commands in graphs

Move the mouse around within the graph area (without pressing any buttons) to move the red cross-hair cursor. The current coordinates of the cross-hairs (in X, Y1 & Y2 coordinates) are dynamically updated at the bottom of the graph window.

If you move the mouse pointer over one of the curves in a graph, the corresponding entry in the legend display will highlight. If you click the right mouse button on one of the entries in the legend a menu will pop up containing the following commands:

Use the left mouse button to zoom in the view on a graph - draw a rectangular area on the graph and the graph will zoom in to display that area of the coordinates. Each graph maintains a 'stack' of zooming commands, click the middle mouse button to zoom out to the previous zoom level of the graph. Click on the Auto-scale button above the graph to return to auto-scaling - the graph scale adapts automatically to display all of the data in every displayed curve.

Click the right mouse button to bring up a context sensitive menu of spec commands that can be used to 'move' a spec motor, or the mono energy or 'h','k', or 'l' to the position indicated on the graph. This feature relies of specfe comparing the scan command and 'X' column name with a number predefined scan types and column names. If it can't find an adequate match the scan section of the menu may be empty, otherwise it will contain two or more spec commands with the appropriate motor name and x value inserted into them. This provides a quick and easy way to move a just-scanned motor to the position of a peak, for example. The menu will also contain commands which cause spec to print out the coordinates of the mouse click, for example

	  print "(X,Y)=",0.98775245,0.98719212
	  print "(X,Y2)=",0.98775245,-0.012807882
	  print "(X,Y,Y2)=",0.98775245,0.98719212,-0.012807882