[comp.sys.amiga] Image displays: Mainframe->Amiga: PAWSDisp

myb100@csc.anu.oz.au (09/21/90)

[What follows is an edited version of the PAWSDisp readme file]

Do you have images on your mainframe computer (Sun or Vax), an Amiga
sitting on your desk, and a serial line connecting the two ? Or, instead
of images, any two-dimensional data/model, whatever. If you would like
to be able to display these images on your Amiga, read on. 

Announcing the first external release of:

PAWSDisp 1.40 : 18 September 1990 - Markus Buchhorn


What is PAWS ?
==============

PAWS = Personal Astronomical WorkStation.

PAWS is a terminal emulation program for Commodore Amigas. It runs on all
models (A500/A1000/A2000/A2500 - and we have no reason to believe it
shouldn't run on the A3000) It was written by Dr Ken J. Mighell, who is
(at time of writing this) a Post Doc at Mount Stromlo Observatory, Canberra,
Australia. The PAWS executable is freely distributable. The PAWS source
and PAWS-Language documentation is available for (some quantity of money)-
contact Ken at mighell@mso.anu.oz.au 

PAWS provides a three screen device: A VT100, A Tek4010 and an image display 
screen, (no particular emulation) programmable with Tek4010 commands. The VT100
is Dave Wecker's VT100 2.4. The Tek4010 is a fixed two-colour 640x400 screen.
The Image display screen is 320x200 , 32 colours, 4 of which are used by the
system, leaving 28 for the actual image. PAWS provides 3 colour tables you
can choose from, swapping at any time you like, also flipping and rotating of
the colour table is possible.

PAWS is a programmable emulator. It uses the PAWS Language to move between
screens, clear screens, display a row of pixel data, draw lines, etc. Much of
this is based on TEK4010 codes. All data transfer is done over the serial line.
This means that PAWS can be run over a modem. It uses a clever compression 
technique to send data over the serial line, and the Amiga decompresses this
and displays it. This means that PAWS runs at quite a respectable rate over
9600 baud lines, and you can cope quite well with just 2400 baud. Unless you
have Ethernet/etc., you'll be stepping up ! :-)

Anybody can write programs in Fortran/C/Pascal/whatever that program PAWS,
using the PAWS_LIB library. You can thus tailor your programs to do whatever
you want.

What is PAWSDisp ?
==================

PAWSDisp provides a standard interface for PAWS image displays. It provides a
large number of image manipulation/analysis features, together with a very
flexible usage: The user provides the header program to read data in, and then 
calls PAWSDisp as outlined below. PAWS and PAWSDisp were written with Astronomy
in mind. Hence, it provides features to speed up data reduction. For the
Astronomers out there, we currently have headers for 

(1) FIGARO, (VAX and Sun)
(2) Mike Cawson's GASP, (VAX)
(3) IRAF (Sun)
(4) Starlink BDF (VAX)
(5) Diskfits (Sun)

[Still to come: STSDAS, MIDAS .bdf, PANDORA .sad, NCSA .hdf, Poskanzer's PBM,
anything else that comes along...?]

But PAWSDisp is not just for Astronomers. Anybody with images on a mainframe
that they want to look at can use PAWS. And not just images. If you have
a scientific model, say, with three parameters: Put two of them as coordinates
on a grid, and make the third one an intensity. Treat that as an image and
display it/print it. This is a *very* effective way of presenting data/models.

Installing and using PAWSDisp:
==============================

Given that you have some image data, you need to write a small program to
do the following: 

Read your data (nx,ny) into a real*4 2D array, of size xlim,ylim. 
[...]
The name of the file is 'frame' which is used as the root for files generated
by PAWSDisp (NB This can include the path! Take care!). You can define a PAL 
or NTSC display on the subroutine call.

Hence:

integer xlim,ylim,nx,ny
real*4 image(xlim,ylim)
character frame

[...]

         CALL pawsdisp(image,xlim,ylim,nx,ny,frame,'PAL','ERASE')
[...]
	end 

simple, really.... :-) (the 'ERASE' indicates the screen should be wiped
when PAWSDisp first starts up)

--------------------------------------------------------------------------
                    A very brief description of the commands
--------------------------------------------------------------------------
The standard PAWS commands - all implemented (LUT=Look-up table)

	ALT 1 = go to vt100 window     ALT ! = erase vt100 window
	ALT 2 = go to tek window       ALT @ = erase tek window
	ALT 3 = go to image window     ALT # = erase image window
	ALT F = flip color table       ALT L = change color table
	ALT R = toggle LUT rotation    ALT W = display color table
	ALT T = toggle window title

PAWSDisp commands. Note that (except where given) most of these commands
are case-insensitive. Any keystroke not listed here will just measure the
data value wherever the cursor currently is. (I recommend using the
space-bar for this.) 

	?-/  = Type the help menu           Q   = Quit
	C    = Clip LUT                     F   = Fold LUT
	S    = Set LUT limits by hand       R   = Auto-set LUT
	T    = Toggle data header           L   = Toggle log. scale
	X    = Flip image in X              Y   = Flip image in Y
	Z    = Zoom onto image              A   = Display whole image
	d-D  = Zoom out by 1-3             i-I  = Zoom in by 1-3
	 G   = Zoom in or out by a factor of 2
	 \   = List info of image           N   = Refresh the screen

	h-H  = horizontal spectrum         v-V  = vertical spectrum

These produce binned spectra of the image, sliced in x (h/H) or in y (v/V).
The Tektronix screen has three options: q-to quit,|-for PS output (see below)
and any other key will measure the point, with the output going to the VT100
screen. 

	|   = Screen -> PostScript 

'|' (the UNIX pipe symbol) will produce a file of the image you can print on
laserwriters. It only contains that part of the image that is currently on
screen, in the same orientation, same greyscale (+/- laserwriter quality).
Also includes the icon (if up) along with the 'you are here' box, and 
writes up a header line, plus any comments you might like to add.

The same command given on the Tektronix (spectrum) display will produce a
PostScript file of the plot. It allows you to add your own labels for the
axes and the main label, in addition to the information header. It's fairly
simple PS (witness who wrote it :-) ) so if you want to rearrange stuff
afterwards, change labels, etc., it's very easy. 

        W   = Write points to file
	P   = pan / finder chart           O  = set panscreen LUT

Produces an iconic form of the image, indicating current screen. If you select
a point *on* the icon, that becomes the new center - shifts the image to there,
while conserving the zoom. This allows you to move around very quickly. 
'P' again removes the panscreen. The greyscale on the panscreen is the default
one it starts with, which is sometimes wrong - the 'O' command will let you set
it interactively. 

       B    = histogram plot of pixel values
       U    = change icon size
       E   = expand the image in y

-----------------------------------------------------------------------------

To Do Yet:

- Allow arrays for conversion of pixel values to other values, 
  e.g. wavelength scale, intensity scale...
- Allow for batch-mode operation...
- Arbitrary direction slices, with input slit width.
- More ILASER-ish like output for the Postscript image output. (i.e. tickmarks.)
- Flip the Tek(and TPS)-spectrum in x or y if the image itself is flipped.
- Improve the label positioning on the Tek/TPS output - still kinda screwy now.
-   Suggestions ????

-----------------------------------------------------------------------------

So, where do I get it ?
=======================

Anonymous ftp from merlin.anu.oz.au [130.56.4.215] in the directory
pub/PAWS_Sun or pub/PAWS_Vax

There are differences between the two machines that I won't go into. Take the
one appropriate to your machine. 

There is also a header program for IRAF images in the PAWS_Sun directory.
Others are available - mail me if you want them, or need help writing your own.

Please remember that we are GMT+10hrs here at the moment - keep your ftp'ing
to a quiet time of our day please, if possible.

Have fun !
Cheers,
	Markus

===============================================================================
 Markus Buchhorn                                           ///  | This space
 Mt Stromlo and Siding Spring Observatories, Canberra     ///   | 
 PMB Weston Ck. P.O. A.C.T. 2611, Australia           \\\///    | intentionally
 markus@mso.anu.oz.au  -or-  nssdca::psi%mssso::markus \XX/     | left blank
===============================================================================