SATAN Graphics and printing
| GSI | Biophysics | SATAN long write-up |

## SATAN graphics and printing

The SATAN graphics is based on X11 for screen graphics and PostScript for paper copies and import into text processing programs like TeX. Pictures are by default also stored on a temporary plotfile (meant for internal access only) which holds the device-independent graphics information. This mechanism allows e.g. a virtual hardcopy of a picture from screen to PostScript without loss of quality.

Display commands are used to draw analyzer spectra on a graphic device providing various modes of one- and two-dimensional representations. Abbreviations for command names may be used as long as they are unique.

### Display types

Three major types of displays are supported.
• One-dimensional displays
The analyzer spectrum is shown as a histogram. The appropriate command is DISPLAY. With DCONTRACT, DEXPAND or DSHIFT a contracted, expanded, or shifted region is shown, respectively. DSCALE presents a segment in y-direction. With DOVERLAY another spectrum may be overlaid on the current display. Generally a static picture is shown, that is, accumulated histograms are not updated automatically.
• Two-dimensional static displays
A two-dimensional spectrum is represented as a cluster plot, alternatively as an isometric or contour plot. An extra display command D2 is provided in order to avoid an overloaded command syntax; with D2EXPAND a spectrum segment defined by the cursor is displayed.
• Two-dimensional live displays
A single analyzer or two correlated analyzers may be displayed dynamically, plotting each event as a point immediately after it is analyzed. Up to 4 simultaneous live displays are supported. All commands for live display start with the characters DL. The basic command is DLIVE. Additional control commands to initialize (DLINIT), stop (DLFINISH) and restart (DLCONTINUE) the live display are provided. Optionally up to 10 conditions of different analyzers can be defined by DLCND which have to be satisfied by an event before displaying it.
Examples:
• One-dimensional displays

D 1 1                      display analyzer no. 1 of event no. 1

DSC 100 1000 / LOG         display the last analyzer  with a logarithmic
y-scale ranging from 100 to 1000


DEXP                       display an expanded segment defined by cursor

DOV 2 1 20 10 40 20        overlay  analyzer  no. 2.1 with  the  channel
limits 20  and 40  matching with  channels 10
and 20 of the present display

• Two-dimensional static displays

D2 A LIST / CON Z(1,*) LOG
draw a contour plot of analyzer A.LIST with a
default number of cuts  of logarithmic incre-
ment, ranging from 1 to the actual maximum of
the spectrum

D2EXP / LOG                display an expanded segment defined by cursor
using the last mode

• Two-dimensional live displays
DLINIT 2                   initialize 2 simultaneous live displays
DLIVE E DE / W(1000,2000,500,900)
display analyzer E within  the channel limits
1000 to  2000 versus analyzer DE  (limits 500
to 900)
DLIVE E T                  display analyzer E versus analyzer T
DLFIN                      stop live display
DLP                        get the coordinates of a live point by cursor
DLCND 2 E / COND(1)        display events of live  display no. 2 only if
condition no. 1 of analyzer E is satisfied
DLINIT / LAST              re-initialize  and restart  the live  display
specified last


### Spectrum modes

Various modes may be selected for the graphic representation of a spectrum: linear, logarithmic or squareroot y-axis, automatic or fixed y-scaling. There are two possibilities to select a special display mode:
• As a global mode using the commands DMODE or DATTR.
The global mode pertains throughout the whole session unless it is changed by one of these commands above.
• As a local mode in various display commands.
Specified as an optional parameter in a display command other than DMODE or DATTR, the corresponding spectrum mode is valid only for the execution of the issued command. The global mode takes effect again after completion of that command.
Example:

DMOD / LOG                 define logarithmic representation of spectrum
contents as global mode
D 1                        display analyzer 1
D / LIN                    display  the  last  analyzer  with  a  linear
counts axis
D                          the analyzer is displayed  again with a logarithmic axis


### Windows and points

The provide four different possibilities to define windows or single channels (points) in a spectrum.
• Analyzer Conditions
are related to a logical condition defined as a part of an analyzer and used in the analysis program. Analyzer conditions can be modified interactively using the commands ACDEF or DSWINDOW. Redefinition of conditions immediately affects a running analysis. Conditions of two-dimensional analyzers are represented by closed polygon lines which can be edited in a display using the cursor.
• Display Windows,
identified by uppercase letters, serve only to store spectrum segment limits. They are elements of an analyzer but have no effect on the analysis. The commands DSWINDOW, DGWINDOW and DWSUM define, mark and integrate, respectively, a display window.
• Display Points
serve only to store channel numbers. They are also associated with a given analyzer but have no effect on the analysis. They are handled by the commands DSPOINT, DGPOINT and DPSUM to define, mark and integrate points. They are marked with uppercase letters.
• Temporary Window
is the last displayed spectrum segment which is not stored as an analyzer condition or a display window (it is volatile). Whenever an unnamed segment specified by channel limits or cursor (analyzer conditions and display windows are named) is displayed, the temporary window, labeled by a number sign '#', is updated. It is not connected with a particular analyzer, but is carried over to each new analyzer selected by a display command. Thus it can be used to compare corresponding segments of different analyzers.
Examples

D 1 / W(#)                 display analyzer 1 in the  limits of the temporary window
DGW A G                    mark display windows A, B, ..., G
DWSUM 1                    return the sum of counts within analyzer condition 1
DSW H                      set limits of display window H by cursor

Each time a spectrum segment is displayed or marked, the sum of counts, mean value and full width at half maximum of this segment are calculated and written to screen and protocol file. The following formulas are used:

sum = SIGMA yi
mean = SIGMA(yixi) / s
fwhm = 2.3548 ( n SIGMA yi(xi-mean)2 / (n-1) sum )1/2

where yi and xi are the data points and n is the number of spectrum bins with non-negative counts. (Bins with negative counts are not considered for mean and width.)

### Graphical Input (Cursor)

Usually X-Window devices provide a cursor to locate a point on the screen or to position graphical objects to be drawn with a command. You use the mouse to position the cursor. The buttons of the mouse have the following functions:
• Left: Send actual cursor position
• Right: End cursor input

### Graphic Devices, printing & picture export

At present SATAN supports two kinds of graphic output devices: X-Window screens and PostScript files. By default the current X-Window screen as defined in the environment variable DISPLAY is used. You use the DDEVICE command to define the various output devices.
Examples
DDEV xyz.ps           a PostScript file
DDEV xyz.eps          a PostScript file
DDEV p65gps           directly to the specified printer
DDEV biori6k:0        X-Window display on host biori6k
DDEV *                current X-Window display
DDEV / CLOSE          closes current output device

Note that the extensions .eps or .ps are significant in order to generate PostScript files. You may use the operating systems commands to actually print PostScript files, e. g. on UNIX
   lp  -dprinter file.ps

or
   lpr -Pprinter file.ps

Note further, that DDEVICE/FREE is necessary for a PostScript file before it is sent to a printer, in order to insert a proper end-of-file text.

A temporary plotfile logs all graphics output in a device-independent way and thus pictures on screen can be re-routed to a printer with the DCOPY command The plotfile resides on the temporary filesystem and is always active. If it grows exceedingly large, plotfile logging can be disabled also with the DCOPY/off command.

Examples

DCOPY / off            switch off plotfile
DCOPY / on             switch on plotfile
DCOPY p65gps           copy plotfile as PostScript to the specified printer
DCOPY my.eps           copy plotfile as PostScript to the specified file


The DCOPY command allows to scale down and to change the orientation of the picture in PostScript. By default a media size of DIN A4 is assumed; the picture is oriented in a way that it best fits the given media. On monochrome printers coloured PostScript pictures appear in grey scale. This does not always look nice. In such cases you might force the DCOPY'd picture to monochrome without affecting the original one. Some
Examples

DCOPY xyz.ps / size(A5)              limit output to paper size A5, default orientation
DCOPY xyz.ps / port                  force portrait orientation
DCOPY xyz.ps / land                  force landscape orientation
DCOPY xyz.ps / palette(mono)         change colours to monochrome


#### PostScript files in documents

PostScript files generated by SATAN have a bounding box and can immediately be used for inclusion in documents, e.g. LaTeX:
   \begin{figure}[hbtp]
\epsfig{file=mypicture.eps,width=120mm,height=190mm}
\caption{}
\label{mypicture}
\end{figure}


### Display attributes

You use the command DATTR to change graphics attributes like colour, line width, line type, etc of the displayed spectra. For each attribute a table with 10 entries is kept. When spectra are displayed, these entries are retrieved by indexing them with a number.

Sorry, not yet implemented.

Sorry, not yet implemented.

### Colours

Colours are handled by means of the DATTR command.

### Overlays

One-dimensional spectra may be plotted over each other by means of the DOVERLAY command. The overlaid spectra have the same scale by default. However, they may be modified by an offset and a stretch factor.
DISP  4
DOVER 5 / xfac(2)        stretches the x-axis by factor of 2


### Live display

It is possible to visualize the correlation of two parameters accumulated in an analyzer in live mode. This means that for each correlated pair of parameters a point is marked on the screen. Up to four sections of a window may be used for a live display.
Example:
DLINIT 2 / POINTS(1000)       defines 2 live displays with 1000 points
DLIVE Z2 MASS1                plot parameters of analyzer Z2 vs MASS1
DLIVE Z2 MASS2                plot parameters of analyzer Z2 vs MASS2

Instead of a pair of one-dimensional analyzers you may also specify one two-dimensional analyzer. Live mode is particularly effective for analyzers without spectrum (type 0), because the window on screen serves as storage device rather than the computer memory.

### The special gd system

Analyzer data can be exported to the gd graphics system allowing the creation of high quality representation graphics for scientific publications using a powerful set of additional graphics commands.

| GSI | Biophysics | SATAN long write-up |

Last updated: M.Kraemer@gsi.de, 3-Aug-1999

Impressum Data privacy protection