Only a few tasks make use of the TV server, but there are many more that use PGPLOT for their graphical display. PGPLOT devices cannot be zoomed or panned, but they can be used to return quantitative information from the display (coordinates, values). In addition, it is possible to interactively modify the lookup table and transfer function of some PGPLOT devices (notably the X-window devices) in software. See Chapter 16 for a discussion of which tasks of this capability.
PGPLOT devices are specified by the standard PGPLOT specification and
are assigned to the MIRIAD
keypwrd device. The
specification has two parts separated by a /
: these are the
name and type parts.
The name part either gives a device name (usually for graphics
devices) or a file name (usually for hardcopy devices, such as
postscript printers). In the case of a file name, any normal file name
can be given. However if it contains a /
character, then the
entire file name should be enclosed in double quotes ("
). Once a
file has been created, you will generally have to issue operating system
commands to spool this to the appropriate output plotter, etc. The
name part can often be left blank -- it defaults to something sensible.
The most common case where you do not let it default is when you are
specifying a disk plot file.
The type part tells PGPLOT what sort of graphics or hardcopy device is being used. Minimum match is used. Some possible types are:
% lwp filename
Examples of PGPLOT devices are:
Another useful pseudo-PGPLOT device is ?. This causes a complete list of PGPLOT types to be printed, and then the task will prompt you to give a PGPLOT device.
When plotting in an X window, you must meet the conditions which allow PGPLOT to communicate with your X server. In particular:
% setenv DISPLAY localhost:0
to the machine you are running MIRIAD tasks on. Here localhost is the name of the host machine running X windows. Normally this will be you local workstation.
% xhost + remotehost
to your local host. Here remotehost is the name of the host machine that you want to grant permission to. For MIRIAD applications, this will be the host you are running the plotting task on.
PGPLOT has two X windows servers, and as of PGPLOT V5.0, one of which ( pgdisp) is deprecated. The PGPLOT device types /xs and /xd are now mediated by a server (called pgxwin_server). This server is automatically started whenever either of these devices is invoked. The /xs windows are permanent and resizable whereas the fixed size /xw windows disappear as the application terminates. This server allows multiple windows and you can choose to write to whichever one you like (see above example). The resources for these windows are managed through the standard X windows resource file; see the PGPLOT manual for details of these issues.
The deprecated server, pgdisp, which creates a resizable persistent X window is started by hand with a command such as
% pgdisp &
from a workstation window (usually the console window). This window is written to with the keyword device, see below). This window can be used for line graphics as well as grey scales. By default, the pgdisp window only has 16 colour levels, which is insufficient for most image display applications, but fine for line graphics.
If you start it up with the command
% pgdisp -lineColors 128 &
then the window will be allocated 128 colours which is sufficient for imaging applications. This window is much slower than the windows mediated by the pgxwin_server. In addition you can only have one.