next up previous contents
Next: wspiros Up: Stage-II programs Previous: eci

wop

NAME

wop - arithmatic operations on FITS image files.

SYNOPSIS

   * wop
   * wop statement [,statement]

The program can be started with no arguments at all, in which case it will
run in an interactive mode. Wop display's a promptstring and executes
commands, there is NO quit/exit command, stop by typing ^D (control D).

If legal statements are passed as arguments, wop executes them one by one
and exits.

DESCRIPTION

wop is a first attempt to develop a program performing a number of
operations on FITS datafiles, both images and tables. Say we have a FITS
file A, containing an image in the PRIMARY extension plus 3 image
extensions, a0,a1 and a2

The statement


B=A[a1,5:10,0:5]

creates a FITS image file B, with NAXIS= 2, NAXIS1= 10, NAXIS2= 5. The image
in B is a section (x from 5 to 14 (inclusive), y from 0 to 4) from the
extension a1 in A. Generally, a FITS imagefile can be referenced as:

Filename[extname,x0:nx,y0:ny....] (syntax)

..

..

..

Currently, no operations are defined on FITS 'BINARY TABLE' extensions.

OPERATIONS

FUNCTIONS

bin ([fx,] [fy,] fitsimage)
     parameters: fx binfactor for first dimension of image (default value is
     1). fy binfactor for second dimension of image (default value is 1).
     fitsimage fits-image input.
crash ([axis,] [mode,] fitsimage)
     crash, ie. reduce the number of dimensions of an image by 1. this
     reduction is accomplished by replacing all data along an axis, a row
     (column, vector or whatever) by just a scalar value, this can be the
     mean, minimum or maximum from the axis being crushed. parameters: axis
     "x", "y" etc. (alternativly 0 (== "x") 1 ..) mode "s" compute mean "t"
     select maximum "v" select minimum fitsimage fits-image input.
clip ([low,] fitsimage)
     clip the image, all pixels with value .lt. low are replaced by this
     value. parameters: low clip all image data with a value under low.
     fitsimage fits-image input.
his ([np,] [low,] [upr,] fitsimage)
     produce a histogram, a 1D vector with np elements. parameters: np
     number of bins in histogram (default value is 100). low lower bound on
     pixelvalues (default value is minimum of fitsimage). upr upper bound on
     pixelvalues (default value is maximum of fitsimage). fitsimage
     fits-image input.
int (fitsimage)
     integrate the fitsimage, ie. starting at the first axis, replace p[x,
     y, z...] with the sum p[0, y, z...]+p[1, y, z...]+ .. + p[x, y, z...],
     x= 1-nx, y= 0-ny, z= 0-nz ... then repeat for the next axis until all
     done.

     parameters: fitsimage fits-image input.

mirror ([r,] fitsimage)
     mirror the fitsimage in one of its axis, given by r. parameters: r 0:
     mirror in x-axis (y := -y), 1: mirror in y-axis (x := -x) fitsimage
     fits-image input.
plot ([device,] [label,] [slabel,] fitsimage { [,slabel,] fitsimage })
     plot fitsimage, this image is always interpreted as a 1D vector, if the
     image has more dimensions only the first row of numbers is plotted. if
     you give several fitsimage input data, all these will be tiled onto one
     output page in (smaller and smaller, as the number increases) subplots.
     parameters: device pgplot style outputdevice (eg. "pic.ps/ps" create
     postscript file pic.ps). label label for the complete plot output.
     slabel sub-label, tagged on the individual plots. fitsimage fits-image
     to be plotted, if this image has more then 1 dimension, only the values
     along the first axis are used.
sum (fitsimage)
     print the sum of all pixelvalues in fitsimage.
stats ([dim,] [mode,] fitsfile)
     print some characteristics of the pixelvalues in fitsimage, printed are
     : name n sum mean sd min max
tile ([dim,] [mode,] fitsfile)

EXAMPLE

The instrument database file contains an extension named WFCcf, an 3D image,
containing the Tk correction factors. For every pixel in the camera's,
digitized, field of view, the first plane of WFCcf gives 1.0/Ao, Ao
represents the detector area (in geometrical sense) seen from this skypixel,
the second imageplane gives 1.0/Ac, Ac is the from this skypixel not
visible, area of the detector.
The WFC mask has an overal transparancy of 1/3, so, looking from any
skypixel, (and ignoring the detector support structure) Ao/Ac is aprox. one
halve.

wfc.ins is the name of the instrument database file, the command:

wopi "A= wfc.ins[WFCcf,,,1:1] / wfc.ins[WFCcf,,,0:1]"

results in a FITS image A, giving (1.0/Ac)/(1.0/Ao)= Ao/Ac, for every pixel
in the field of view.
The image may be displayed (eg. saoimage), or you can examine the
distribution of the pixel values (expected value 0.5) with the command:

wopi "plot(his(500, .4, .6, A))"

plotting a histogram of all pixels in 500 points, ranging from 0.4 to 0.6. a
command like:

wopi "plot(1/wfc.ins[WFCcf,0:,255:1,0:1])"

illustrates the WFC's triangular response, the plot shows the active
detector area in cm2, along the x-axis (0:, start offset 0, full length) in
the center of the field of view (y=255:1, start offset 255, length 1 pixel)
and from the first image plane (z=0:1, start offset 0, length 1 pixel).

----------------------------------------------------------------------------
                       wopi expression syntax
  term                              expansion
list      ::= [; statement]
statement ::= NAME = expr | expr
expr      ::= term [(+ | -) term]
term      ::= factor [(* | /) factor]
factor    ::= ffile | const | NAME ( explist ) | ( expr ) | - expr
ffile     ::= NAME [qualifier]
qualifier ::= [ NAME ] | [ section ] | [ NAME , section ]
section   ::= axis [, axis]
axis      ::= | [initial] : length | initial : [length]
explist   ::= [expr [, expr]]
NAME      ::= string of characters
const     ::= number | string
string    ::= "string of characters exept quote "
initial   ::= integer
length    ::= integer
number    ::= real | integer

SEE ALSO



Mark Savenije
Sat Jan 18 15:04:49 MET 1997