writefits
Writes the array X to disk as a FITS file with specified filename. If the optional argument bitpix is given, the following can be used:
  bitpix =  32: signed   long  integer          (32 bits per pixel)
  bitpix =  16: unsigned short integer          (16 bits per pixel)
  bitpix =   8: unsigned char  integer          ( 8 bits per pixel)
  bitpix = -32: single precision floating point (32 bits per pixel)
  bitpix = -64: double precicion floating point (64 pits per pixel)
bitpix defaults to -32.
Syntax
writefits FILENAME, X [, bitpix]
Arguments
FILENAME: A string
X: A matrix.
bitpix: An integer number.

contour
Draw a contour map of X. levels give the contour levels in percent of the maximum value.
Syntax
contour fits X, fits levels [,title=string] [,xtitle=string] [,ytitle=string]

display
Displays a grayscale image of X. If min and max are set, the display of the image is clipped at these values. An optional keyword method can have 3 values:
method = 0: linear scaling
method = 1: log scaling
method = 2: square root scaling
Syntax
display fits [, float min, float max]

exec
Execute cmd (which is given as a character string). Control is returned to DPUSER when cmd is finished.
Syntax
exec cmd
Arguments
cmd: A string containing the command to be executed.
Examples
Do a directory listing:
<code>exec "dir"

sleep
Sleep for the specified amount of seconds.
Syntax
sleep seconds
Arguments
seconds: An integer number.

spec3d
Draw an averaged spectrum of the cube multiplied by the mask.
Syntax
spec3d cube, mask [,title=string] [,xtitle=string] [,ytitle=string]
Arguments
cube: A 3-dimensional matrix
mask: A 2-dimensional matrix

print
prints the argument. Depending on the argument, the following happens:
  integer, real number, complex number, string, string array: the value is printed.
  matrix: some statistics on the array are printed.
Syntax
print argument

mem
Prints information on all local variables.
Syntax
mem

plot
Plots the 1-dimensional vector y. If x is given, x versus y is plot, else the running number versus y is plot. ymin and ymax can be specified to set the plot range in the y axes. If symbol is given and >= -31, each point will be represented by a symbol, else the lines will be connected by a polyline. See "help pgpt" for a description of available symbols.
Syntax
plot [x, ] y [,title=string] [,xtitle=string] [,ytitle=string] [,symbol=integer] [, ymin] [, ymax] [, /xlog] [, /ylog] [, /noclose]
See also
pgplot_pgpt

free
Release all memory taken by local variables.
Syntax
free

sao
Uses IRAF imtool to display X. An image display server needs to be running. Programs supported at the time are: saoimage, ximtool, saotng, ds9 (which is, in addition to UNIX, also available on the Microsoft Windows platform).
Syntax
sao X [, min, max] [, /log, /zscale]
Arguments
X: A 2-dimensional matrix
min, max: Minimum and maximum array value for display scaling
Switches
/log: display the image in logarithmic scaling.
/zscale: Use a display representation similar to IRAF's zscale.

shift
Shifts (and optionally wraps) X by specified values.
Syntax
shift X, xs, ys [, zs] [, /wrap]
Arguments
X: The array to be shifted
xs: Shift vector in the first dimension
ys: Shift vector in the second dimension
zs: Shift vector in the third dimension
Switches
wrap: Pixels shifted off the array will be wrapped to the opposide side.
Notes
If either shift vector is non-integer, a subpixel shift is applied and the array type changed to R4. Subpixel shift is only supported in 2 dimensions.
See also
function_shift

center
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
center X
See also
function_center

centroid
Returns the centroid of X in the variables x, y, and z.
y and z are optional.
Syntax
centroid X, VARIABLE x [, VARIABLE y [, VARIABLE z]]

upper
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
upper X
See also
function_upper

lower
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
lower X
See also
function_lower

rotate
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
rotate X, angle [, xcen, ycen]
See also
function_rotate

fft
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
fft X
See also
function_fft

reass
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
reass X
See also
function_reass

norm
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
norm X [, /unity, /total, /average]
See also
function_norm

clip
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
clip X, low, high [, value]
See also
function_clip

smooth
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
smooth X, fwhm
See also
function_smooth

boxcar
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
boxcar X, width [, /average, /minimum, /maximum, /median]
See also
function_boxcar

3dmerge
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
3dmerge X, Y, tweak
See also
function_3dmerge

3dmegacal
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
3dmegacal X, run, band
See also
function_3dmegacal

3dcal
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
3dcal X, calset
See also
function_3dcal

3dcubin
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
3dcubin X, year, band, scale
See also
function_3dcubin

3dexpand
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
3dexpand X
See also
function_3dexpand

flip
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
flip X, axis
See also
function_flip

enlarge
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
enlarge X, scale, method = 0
See also
function_enlarge

resize
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
resize X, naxis1, naxis2, naxis3
See also
function_resize

wien
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
wien X, PSF [, height]
See also
function_wien

lucy
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
lucy X, PSF, niter [, threshold]
See also
function_lucy

3dnorm
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
3dnorm X
See also
function_3dnorm

correl
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
correl X, Y
See also
function_correl

rebin
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
rebin X, x1, x2
See also
function_rebin

ssaplot
Plot ssa statistics. The first argument must be created with ssastat Optionally, a title can be given as second argument which will be printed above all plots.
Syntax
ssaplot fits x [, string title]
See also
function_ssastat

freddy
Draw an isometric plot of x.
Syntax
freddy fits x, int xsize, int ysize, float scale, float angle

surface
Draw an isosurface of x. This is seen under the angle. If skip is specified and > 1, only every nth line is drawn.
Syntax
surface fits x, float angle [, int skip]

imexa
Display X on an associated FITS viewer (like saoimage). Interactively, the following can be done pressing keys in the viewer: 
key  action
 c   contour plot
 s   isosurface
 h   horizontal cut
 v   vertical cut
 r   radial average
 i   increase window size
 d   decrease window size
 q   quit and return to dpuser
Syntax
imexa X
See also
procedure_sao

sbfint
Initialises the software buffer for crystal-plotting. It should  be called just once per plot (buffer), after PGWINDOW but before any crystal-related routines.
Syntax
sbfint RGB,IC,IBMODE,IBUF,MAXBUF
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
RGB:      R*4    I       3      The RGB values for the background.
IC:       I*4    I       -      The index for the background colour.
IBMODE:   I*4    I       -      Buffering mode for initialisation:
                                 1 = Ordinary, default.
                                 2 = Will want to save later.
                                 3 = Initialise from saved buffers.
IBUF:     I*4    I       -      Software buffer to be used (>=1).
MAXBUF:   I*4    O       -      Maximum number of buffers available.

sbfbkg
Sets the shading for the background. This routine should be called after SBFINT, and COLINT or COLTAB, but before any objects are plotted.
Syntax
sbfbkg IC1,IC2,ISHADE
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
ISHADE:   I*4    I       -      Order of shading (IC1-->IC2 - IC1):
                                  1 - Bottom to top.
                                  2 - Left to right.
                                  3 - Bottom-left to top-right.
                                  4 - Top-left to bottom-right.
                                  5 - Bottom, middle and top.
                                  6 - Left, middle and right.
                                  7 - Rectangular zoom to centre.
                                  8 - Elliptical zoom to centre.

sbfsav
Save a rendered picture-buffer, and its Z-buffer, for subsequent use in re-initialisation with SBFINT.
Syntax
sbfsav IBUF
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
IBUF:     I*4    I       -      Software buffer to be saved (>=1).

sbfcls
Closes the software buffer for crystal-plotting, by outputing it to the screen or writing out a postscript file (as appropriate).
Syntax
sbfcls IBUF
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
IBUF:     I*4    I       -      Software buffer to be output (>=1).

colint
Initialises a colour table for a geometrical object. In general, it is recommended that SHINE = 0.0 if DIFUSE > 0.0 and vice versa.
Syntax
colint RGB,IC1,IC2,DIFUSE,SHINE,POLISH
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
RGB:      R*4    I       3      Red, green and blue intenisty for 
                                fully-lit non-shiny object (0-1).
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for shading.
DIFUSE:   R*4    I       -      Diffusiveness of object (0-1).
SHINE:    R*4    I       -      Whiteness of bright spot (0-1).
POLISH:   R*4    I       -      Controls size of bright spot.

coltab
Initialises a colour table for a "grey-scale" map.
Syntax
coltab RGB,NCOL,ALFA,IC1,IC2
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
RGB:      R*4    I   3 X NCOL   Red, green and blue intenisty for 
                                the colour table.
NCOL:     I*4    I       -      No. of colours in the input table.
ALFA:     R*4    I       -      Contrast-factor (linear=1).
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the output.

colsrf
Initialises a colour table for a 3-D surface rendering of a 2-D array of "data".
Syntax
colsrf RGB,NCOL,ALFA,IC1,IC2,NCBAND,DIFUSE,SHINE,POLISH
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
RGB:      R*4    I   3 X NCOL   Red, green and blue intenisty for 
                                the colour table.
NCOL:     I*4    I       -      No. of colours in the input table.
ALFA:     R*4    I       -      Contrast-factor (linear=1).
IC1,IC2:  I*4    I       -      Lowest and highest colour-index to
                                be used for the rendering.
NCBAND:   I*4    I       -      Number of colour-bands for the
                                height, so that the number of shades
                                per band = (IC2-IC1+1)/NCBAND.
DIFUSE:   R*4    I       -      Diffusiveness of object (0-1).
SHINE:    R*4    I       -      Whiteness of bright spot (0-1).
POLISH:   R*4    I       -      Controls size of bright spot.

sbball
This subroutine plots a shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0.
Syntax
sbball EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
CENTRE:   R*4    I       3      (x,y,z) coordinate of ball-centre.
RADIUS:   R*4    I       -      Radius of ball.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
LSHINE:   L*1    I       -      Shiny ball if .TRUE., else diffuse.
X0,Y0:    R*4    O       -      Centre of projected ball.
R0:       R*4    O       -      Average radius of projected ball.

sbtbal
This subroutine plots a semi-transparent shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0.
Syntax
sbtbal EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0,ITRANS
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
CENTRE:   R*4    I       3      (x,y,z) coordinate of ball-centre.
RADIUS:   R*4    I       -      Radius of ball.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
LSHINE:   L*1    I       -      Shiny ball if .TRUE., else diffuse.
X0,Y0:    R*4    O       -      Centre of projected ball.
R0:       R*4    O       -      Average radius of projected ball.
ITRANS:   I*4    I       -      Level of transparency:
                                     1 = 25%; 2 = 50%; 3 = 75%.

sbplan
This subroutine plots a diffusively-lit coloured plane; the user must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0.
Syntax
sbplan EYE,NV,VERT,IC1,IC2,LIGHT
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
NV:       R*4    I       -      No. of verticies (>=3).
VERT:     R*4    I     3 x NV   (x,y,z) coordinate of verticies.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.

sbplnt
This subroutine plots a diffusively-lit, semi-transparent, coloured plane; the use must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0.
Syntax
sbplnt EYE,NV,VERT,IC1,IC2,LIGHT,ITRANS
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
NV:       R*4    I       -      No. of verticies (>=3).
VERT:     R*4    I     3 x NV   (x,y,z) coordinate of verticies.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
ITRANS:   I*4    I       -      Level of transparency:
                                     1 = 25%; 2 = 50%; 3 = 75%.

sbrod
This subroutine plots a diffusively-shaded coloured rod. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the rod-ends should be negative (< -radius); the viewing-screen is fixed at z=0.
Syntax
sbrod EYE,END1,END2,RADIUS,IC1,IC2,LIGHT,NSIDES,LEND
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
END1:     R*4    I       3      (x,y,z) coordinate of rod-end 1.
END2:     R*4    I       3      (x,y,z) coordinate of rod-end 2.
RADIUS:   R*4    I       -      Radius of cylinderical rod.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
NSIDES:   I*4    I       -      The order of the polygon to be used
                                for the cross-section of the rod.
LEND:     L*1    I       -      If true, plot the end of the rod.

sbcone
This subroutine plots a diffusively-shaded coloured right-angular cone. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the base and appex of the cone should be negative (< -radius); the viewing-screen is fixed at z=0.
Syntax
sbcone EYE,BASE,APEX,RADIUS,IC1,IC2,LIGHT,NSIDES
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
BASE:     R*4    I       3      (x,y,z) coordinate of the centre of
                                the base of the cone.
APEX:     R*4    I       3      (x,y,z) coordinate of the apex.
RADIUS:   R*4    I       -      Radius of the base of the cone.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
NSIDES:   I*4    I       -      The order of the polygon to be used
                                for the cross-section of the cone.

sbelip
This subroutine plots a shiny or matt coloured elliptical ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0.
Syntax
sbelip EYE,CENTRE,PAXES,IC1,IC2,LIGHT,LSHINE,ICLINE,ANGLIN,X0,Y0,R0
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
CENTRE:   R*4    I       3      (x,y,z) coordinate of ball-centre.
PAXES:    R*4    I     3 x 3    Principal axes of the elliposid.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
LSHINE:   L*1    I       -      Shiny ball if .TRUE., else diffuse.
ICLINE:   I*4    I       -      If >=0, colour index for lines on
                                surface of ellipsoid.
ANGLIN:   R*4    I       -      Width of lines: +/- degs.
X0,Y0:    R*4    O       -      Centre of projected ball.
R0:       R*4    O       -      Average radius of projected ball.

sbline
This subroutine draws a straight line between two points. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive, while that of both the ends should be negative; the viewing-screen is fixed at z=0.
Syntax
sbline EYE,END1,END2,ICOL,LDASH
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
END1:     R*4    I       3      (x,y,z) coordinate of end-1.
END2:     R*4    I       3      (x,y,z) coordinate of end-2.
ICOL:     I*4    I       -      Colour-index for line.
LDASH:    L*1    I       -      Dashed line if .TRUE. (else cont.).

sbtext
Write a text string in 3-d perspective. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the text string should be negative; the viewing-screen is fixed at z=0.
Syntax
sbtext EYE,TEXT,ICOL,PIVOT,FJUST,ORIENT,SIZE
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
TEXT:     C*1    I       *      The text string to be written.
ICOL:     I*4    I       -      Colour index for text.
PIVOT:    R*4    I       3      (x,y,z) coordinate of pivot point.
FJUST:    R*4    I       -      Position of pivot along the text: 
                                0.0=left, 0.5=centre, 1.0=right.
ORIENT:   R*4    I     3 x 2    (x,y,z) for X-length and Y-height
                                directions of the text.
SIZE:     R*4    I       -      Height of the reference symbol "A".

sbsurf
This subroutine plots an iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.
Syntax
sbsurf EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
LATICE:   R*4    I     3 x 4    (x,y,z) coordinates of the origin
                                and the a, b & C lattice-vertices.
DENS:     R*4    I     (N1+1)   The density at regular points within
                     x (N2+1)   the unit cell, wrapped around so
                     x (N3+1)   that DENS(0,J,K)=DENS(N1,J,K) etc..
N1,N2,N3: I*4    I       -      The dimensions of the unit-cell grid.
DSURF:    R*4    I       -      Density for the iso-surface.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
LSHINE:   L*1    I       -      Shiny surface if TRUE, else diffuse.

sbtsur
This subroutine plots a semi-transparent iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.
Syntax
sbtsur EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE,ITRANS
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
LATICE:   R*4    I     3 x 4    (x,y,z) coordinates of the origin
                                and the a, b & C lattice-vertices.
DENS:     R*4    I     (N1+1)   The density at regular points within
                     x (N2+1)   the unit cell, wrapped around so
                     x (N3+1)   that DENS(0,J,K)=DENS(N1,J,K) etc..
N1,N2,N3: I*4    I       -      The dimensions of the unit-cell grid.
DSURF:    R*4    I       -      Density for the iso-surface.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
LSHINE:   L*1    I       -      Shiny surface if TRUE, else diffuse.
ITRANS:   I*4    I       -      Level of transparency:
                                     1 = 25%; 2 = 50%; 3 = 75%.

sbslic
This subroutine plots a "grey-scale" slice through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.
Syntax
sbslic EYE,LATICE,DENS,N1,N2,N3,DLOW,DHIGH,IC1,IC2,SLNORM,APOINT,ICEDGE
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
LATICE:   R*4    I     3 x 4    (x,y,z) coordinates of the origin
                                and the a, b & C lattice-vertices.
DENS:     R*4    I     (N1+1)   The density at regular points within
                     x (N2+1)   the unit cell, wrapped around so
                     x (N3+1)   that DENS(0,J,K)=DENS(N1,J,K) etc..
N1,N2,N3: I*4    I       -      The dimensions of the unit-cell grid.
DLOW:     R*4    I       -      Density for the lowest colour-index.
DHIGH:    R*4    I       -      Density for the highest colour-index.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
SLNORM:   R*4    I       3      (x,y,z) direction of the normal to 
                                the slice to be "grey-scaled".
APONIT:   R*4    I       3      (x,y,z) coordinate of a point within
                                the slice to be "grey-scaled".
ICEDGE:   I*4    I       -      If >=0, it's the colour-index for the
                                boundary of the "grey-scaled" slice.

sbcpln
This subroutine plots a diffusively-lit, semi-transparent, coloured plane through a unit cell. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.
Syntax
sbcpln EYE,LATICE,IC1,IC2,LIGHT,SLNORM,APOINT,ICEDGE,ITRANS
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
LATICE:   R*4    I     3 x 4    (x,y,z) coordinates of the origin
                                and the a, b & C lattice-vertices.
IC1,IC2:  I*4    I       -      Lowest & highest colour-index to be
                                used for the shading.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
SLNORM:   R*4    I       3      (x,y,z) direction of normal to plane.
APONIT:   R*4    I       3      (x,y,z) coordinate of a point within
                                the plane.
ICEDGE:   I*4    I       -      If >=0, it's the colour-index for
                                the boundary of the plane.
ITRANS:   I*4    I       -      Level of transparency:
                                  0 = 0%; 1 = 25%; 2 = 50%; 3 = 75%.

sb2srf
This subroutine plots a 3-d surface given a 2-d unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.
Syntax
sb2srf EYE,LATICE,DENS,N1,N2,DLOW,DHIGH,DVERT,IC1,IC2,NCBAND,LIGHT,LSHINE
Arguments
ARGUMENT  TYPE  I/O  DIMENSION  DESCRIPTION
EYE:      R*4    I       3      (x,y,z) coordinate of eye-position.
LATICE:   R*4    I     3 x 3    (x,y,z) coordinates of the origin
                                and the a and b lattice-vertices.
DENS:     R*4    I     (N1+1)   The density at regular points within
                     x (N2+1)   the unit cell, wrapped around so
                                that DENS(0,J)=DENS(N1,J) etc..
N1,N2:    I*4    I       -      The dimensions of the unit-cell grid.
DLOW:     R*4    I       -      Lowest density to be plotted.
DHIGH:    R*4    I       -      Highest density to be plotted.
DVERT:    R*4    I       -      "Vertical" world-coordinate length
                                corresponding to density-range.
IC1,IC2:  I*4    I       -      Lowest and highest colour-index to
                                be used for the rendering.
NCBAND:   I*4    I       -      Number of colour-bands for the
                                height, so that the number of shades
                                per band = (IC2-IC1+1)/NCBAND.
LIGHT:    R*4    I       3      (x,y,z) direction of flood-light.
LSHINE:   L*1    I       -      Shiny surface if TRUE, else diffuse.

radialplot
plots a radial average of x centered at [xcenter, ycenter] with a radius of r
Syntax
radialplot fits x, int xcenter, int ycenter, int r [,title=string] [,xtitle=string] [,ytitle=string]

setfitskey
add or change a FITS key in the header. value can be any of string, integer or double.
Syntax
setfitskey fits x, string key, value, string comment
See also
function_getfitskey

setbitpix
Change pixel type of X.
Syntax
setbitpix fits x, int bitpix, double bscale = 1.0, double bzero = 0.0
See also
function_setbitpix

cd
change the current working directory.
Syntax
cd string

setwcs
set WCS information in the FITS header.
Syntax
setwcs fits, crpix1, crpix2, crval1, crval2, cdelt1 [, cdelt2]

shrink
See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.
Syntax
shrink X, factor
See also
function_shrink

view
Uses qtfitsview to display specified fits.
Syntax
view X

limits
Returns the limits for which the array is non-zero in the given variables. At least xlow and xhigh must be given.
Syntax
limits fits, xlow, xhigh [, ylow, yhigh, zlow, zhigh]

printf
Print the value (either a real number or an integer) using specified format string. The formatting is done like in the C printf function. The total length of the formatted string is limited to 256 characters.
Syntax
printf format, value

export
Export what to fname. If what is a stringarray, each string in the array is printed as a separate line. If what is a fits, all values are printed as floating point numbers, separated by a single whitespace (" "). In this case, optionally a precision can be given (default: 2 decimal places).
Syntax
export string filename, stringarray|fits what [, int precision]

writebmp
Write a bitmap (.bmp) file. If only red is given, this will be a grayscale image, else both green and blue must be given (which must be of the same size as red) and a color image will be written. The values in the fits are supposed to be scaled between 0 and 255.
Syntax
writebmp filename, red [, green, blue]
Arguments
filename: A string giving the file name of the bitmap
red: 2-dimensional array
green: A 2-dimensional array of the same size as red
blue: A 2-dimensional array of the same size as red
Examples
Write out a grayscale bitmap of a circular gaussian:
<code>writebmp "gauss.bmp", gauss(129,129,30)*255

swapbytes
Swap the bytes of given fits, which must be a variable.
Syntax
swapbytes fits

read
Print prompt and read in up to 9 variables. The variables can be of integer, floating point or string type and must exist before the call.
Syntax
read prompt, v1 [, v2, v3, v4, v5, v6, v7, v8, v9]

shade
Plot an image in a variety of ways - as provided by PGXTAL. This procedure asks for plot options interactively. Possible plots are contour, shaded surface, and colour plots with various colourtables.
Syntax
shade fits

replace
replaces all occurences of the string s by the string r.
Syntax
replace string|stringarray where, string s, string r

saomarkpoint
Draws a marker on saoimage at specified x,y coordinates with size s. Optionally a colour can be specified.
Syntax
saomarkpoint x, y, size, type [,colour]
Arguments
x: X-axes coordinate of the center of the circle
y: Y-axes coordinate of the center of the circle
size: The size of the marker to be drawn
type: Marker type, give one of the following (can be OR'ed)
FILL: 1
POINT: 2
BOX: 4
PLUS: 8
CROSS: 16
DIAMOND: 32
CIRCLE: 64
STAR: 128
HLINE: 256
VLINE: 512
HBLINE: 1024
VBLINE: 2048
colour: Optionally, a color in the range 202-217 can be given
BLACK: 202
WHITE: 203
RED: 204
GREEN: 205
BLUE: 206
YELLOW: 207
CYAN: 208
MAGENTA: 209
CORAL: 210
MAROON: 211
ORANGE: 212
KHAKI: 213
ORCHID: 214
TURQUOISE: 215
VIOLET: 216
WHEAT: 217
See also
procedure_sao
procedure_saomarklabel
procedure_saoclear

saoclear
Clear saoimage of all markers drawn
Syntax
saoclear
See also
procedure_sao
procedure_saomarkpoint
procedure_saomarklabel

saomarklabel
Draws a marker on saoimage at specified x,y coordinates with size s. Label the point Optionally a colour can be specified.
Syntax
saomarkpoint x, y, label, size, type [,colour]
Arguments
x: X-axes coordinate of the center of the circle
y: Y-axes coordinate of the center of the circle
label: A string to be printed next to the marker
size: The size of the marker to be drawn
type: Marker type, give one of the following (can be OR'ed)
FILL: 1
POINT: 2
BOX: 4
PLUS: 8
CROSS: 16
DIAMOND: 32
CIRCLE: 64
STAR: 128
HLINE: 256
VLINE: 512
HBLINE: 1024
VBLINE: 2048
colour: Optionally, a color in the range 202-217 can be given
BLACK: 202
WHITE: 203
RED: 204
GREEN: 205
BLUE: 206
YELLOW: 207
CYAN: 208
MAGENTA: 209
CORAL: 210
MAROON: 211
ORANGE: 212
KHAKI: 213
ORCHID: 214
TURQUOISE: 215
VIOLET: 216
WHEAT: 217
See also
procedure_sao
procedure_saomarkpoint
procedure_saoclear

cblank
Replace all undefined values (like NaN or Inf) by another value. If no value is specified, 0.0 will be replaced.
Syntax
cblank ARRAY [, value]
Arguments
ARRAY: A variable holding an array
value: Optional, the value to be assigned (defaults to 0)
See also
function_cblank

cubemerge
Merges several fits datacubes. All files must have the same array size (in the first two dimensions) and bitpix. The file name of the result must not be the same as any of the input names. The FITS header is copied from the first file and the NAXIS3 keyword is updated.
Syntax
cubemerge result, cubes
Arguments
result: The filename where the datacube is written to
cubes: A string array with the file names to be merged

setenv
Set or change an environment variable.
Syntax
setenv VARIABLE, VALUE
Arguments
VARIABLE: A string with the name of the new environment variable
VALUE: A string with the value of the new environment variable
See also
function_getenv

break
Stop any currently running script or loop.
Syntax
break
Arguments
none

run
Execute a script. This is equivalent to entering @script.
Syntax
run S
Arguments
S: A string with the file name of the script to be executed.

echo
Turn on or off echo mode. Echo mode determines if external scripts are echoed to the console.
Syntax
echo mode
Arguments
mode: An integer number. 0 means echo off, any other number echo on.

precess
Precess coordinates from one epoch to another.
Syntax
precess RAh, RAm, RAs, DECd, DECm, DECs, fromepoch, toepoch
Arguments
RAh, RAm, RAs: Right Ascension of the object
DECd, DECm, DECs: Declination of the object
fromepoch: Epoch in which the coordinates are given
toepoch: Epoch to which the coordinates should be precessed

pwd
Print current working directory
Syntax
pwd
Arguments
None

dir
Print directory listing.
Syntax
dir [filter]
Arguments
filter: Print directory listing of files matching given pattern

setindexbase
Set the base for array indexing
Syntax
setindexbase base
Arguments
base: The index base, 0 for C-notation, 1 for Fortran-notation (the default)
See also
procedure_cnotation
procedure_fortrannotation
function_indexbase

cnotation
Set the base for array indexing to 0
Syntax
cnotation
Arguments
none
See also
procedure_setindexbase
procedure_fortrannotation
function_indexbase

fortrannotation
Set the base for array indexing to 1 (the default for dpuser)
Syntax
fortrannotation
Arguments
none
See also
procedure_setindexbase
procedure_cnotation
function_indexbase
