saomarkpoint
Draws a marker in ds9 at specified x,y coordinates with size s. (Use ds9 v5.2 or newer!)
Syntax
saomarkpoint x, y, size, type
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)
POINT: 2
BOX: 4
DIAMOND: 32
CIRCLE: 64
See also
procedure_sao
procedure_saomarklabel
procedure_saoclear

saoclear
Clear ds9 of all markers drawn.  (Use ds9 v5.2 or newer!)
Syntax
saoclear
See also
procedure_sao
procedure_saomarkpoint
procedure_saomarklabel

saomarklabel
Draws a text label in ds9 at specified x,y coordinates. (Use ds9 v5.2 or newer!)
Syntax
saomarklabel x, y, label
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
See also
procedure_sao
procedure_saomarkpoint
procedure_saoclear

imexa
Display X in ds9. 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
(Use ds9 v5.2 or newer!)
Syntax
imexa X
See also
procedure_sao

writefits
Writes the array X to disk as a FITS file with specified filename, optionally as an extension. If X is a Fits List, a multiple extension FITS file is written.
Syntax
writefits FILENAME, X [, /ext]
Arguments
FILENAME: A string
X: A matrix or a Fits List
Switches
/ext: If specified, the matrix is written as a FITS image extension. If the file FILENAME exists already, the extension is appended (in which case the original FITS file must not be compressed), else an empty primary HDU is written and the extension appended.

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.

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, user defined or compiled functions and procedures.
Syntax
mem

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

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]

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

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

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]

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 outputting 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 [, axis]
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

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

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

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

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

userDialog
Create a dialog box for QFitsView
Syntax
userDialog function, labels [, types [, values] ]
Arguments
title: A string with the dpuser function to be executed. This will be shown also as the caption of the dialog box.
labels: A string array with the description of the parameters to be entered
types: Optional types of the arguments (as a string array): Can be either <b>int, real, fits</b>, or anything, in which case it will be treated as a string.
values: Optionally, default values for the entries can be given (as a string array).
Examples
Create a dialog box for the velmap function:
<code>userDialog "myvelmap", ["cube", "wavelength center", "fwhm"], ["fits", "real", "real"], ["", "2.13", ".001"]

compile
Converts a dpuser-script into C-code, compiles it and links it at runtime into the running dpuser-session. Unlike with user defined functions or procedures, it is not allowed to compile a function with the same name as aalready compiled procedure and vice versa.
Syntax
compile "filename"
Arguments
filename: The filename of the dpuser-script to convert
Switches
/c: Adds needed headers and forward declarations to existing C-code and links it on runtime. The general data type to use must be 'dpuserType'. Functions and procedures must begin like shown in the examples below.
/reset: Unloads all compiled functions and procedures. See example below.
Examples
To compile c-code, functions must be defined as follows:
<code>extern "C" dpuserType funcName(dpuserType &a, ...) { ... }
<code>   ...;
<code>   return funcName;
<code>}
<br>Procedures must be defined as follows:
<code>extern "C" void procName(dpuserType &a, ...) {
<code>   ...;
<code>   return;
<code>}
<br>To unload all functions and procedures:
<code>compile "", /reset

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

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 ds9 to display X. ds9 v5.2 or newer needs to be running.
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.

cirrange
Reduce a number to the range [0,360[ or [0,pi[.
Syntax
cirrange VAR [, /deg, /rad]
Arguments
VAR: A named variable whose value should be reduced. This can be a real number or a vector/matrix.
Switches
/deg: Reduce to [0,360[ (default)
/rad: Reduce to [0,pi[

swapaxes
Swap axes of a 3D array
Syntax
swapaxes VAR, newx, newy, newz
Arguments
VAR: A named variable which contains a 3D FITS
newx: Integer numer (1..3) which tells which axis shall become the X axis
newy: Integer numer (1..3) which tells which axis shall become the Y axis
newz: Integer numer (1..3) which tells which axis shall become the Z axis
Notes
The following FITS header keys are updated, if they exist:<br>
CRVAL, CRPIX, CDELT, CD matrix, CTYPE, CUNIT
Examples
OSIRIS 3D data come in the format [lambda,x,y]. To convert this to [x,y,lambda]:
<code>swapaxes buffer, 2, 3, 1

debug
Turn on or off debug information.
Syntax
debug mode
Arguments
mode: An integer number. 0 means debugging information off, any other number display debugging information.

copyheader
Copy the FITS header from one matrix to another
Syntax
copyheader VAR, source
Arguments
VAR: A named variable of type fits which should receive the FITS header
source: The matrix with the FITS header to be copied

setfitstype
Set the (FITS extension) type info of given fits to either image or bintable
Syntax
setfitstype VAR [, extension], [ /image, /bintable]
Arguments
VAR: A named variable which contains a FITS, a FITS list, or a string array
extension: Optional in case of a FITS list, which element to set
Switches
/image: set the FITS type to image
/bintable: set the FITS type to bintable

watchdir
Watch a directory and trigger an action when a new file matching given pattern is created (only available on QFitsView). The remove the watch, call the procedure with empty arguments
Syntax
watchdir directory, pattern, action
Arguments
directory: A string specifying the directory to watch
pattern: A string, the file pattern to be matched
action: A string, the dpuser script to be executed. The file name is marked as $$
Examples
To trigger reading the first extension of a FITS file when created in /tmp:
<code>watchdir "/tmp", "*.fits", "hhh=readfitsextension($$, 1)"
Stop watching:
<code>watchdir "", "", ""

message
Print out a message on the terminal, or open a dialog box with the message in QFitsView
Syntax
message text [, /information | /warning | /critical]
Arguments
text: The message text to be displayed
Switches
the switch determines which icon to be displayed in the message box

python
Either enter PYTHON mode or execute given argument as PYTHON script
Syntax
python [script]
Arguments
script: A string with the script to execute
Examples
To print the integer number 10 using python:
<code>python "print(10)"
To define a simple function as python module, callable then from DPUSER:
<code>python "def add(a,b):\n return a+b"
<code>print add(2,2)

