.ec _
.ll 76
.ad b
.in 4
.\"====================================================================
.ti -4
1 Language
.ce
GREG3_\ Language Summary

.nf
IMAGE [Filename] : Reads the GDF map Filename. Default extension is .GDF
KILL             : Kills pixels.
SPECTRUM         : Extracts or compute a mean spectrum from an image.
.fi
.\"====================================================================
.ti -4
1 IMAGE
.ti +4
[GREG3_\]IMAGE [Filename] [/PLANE I1 I2] [/SUBSET Imin Imax Jmin Jmax]
[/WRITE] [/CLOSE]

Associated "G__*" variables are defined after the first call to the
IMAGE, SPECTRUM or KILL commands of GREG3_\ language.

Read the GDF map Filename. The default image extension is .gdf. This
command defines the image found in given file as the new current
image. Projection, system and extremas are also defined if
needed. Unless options are present, the first plane of the image
becomes the new Regular Grid array in GreG.

The /PLANE I1 I2 option allows to define part of a more than
2-Dimensional image as the regular grid array. A file name should not
be specified if you want to select a new plane in the current image.

The /SUBSET Imin Imax Jmin Jmax option allows to load only a subset of
the input image or image plane. Again, a file name should be specified
only to change the input image. You can combine /PLANE and /SUBSET
options.

At open time, the /WRITE option allows you to map the image writeable
(instead of Readonly by default), a prerequisite to use some functions
(e.g. KILL which kills pixels).

The /CLOSE option allows you to close the currently opened file, and
to free associated memory, if any.

Without option nor argument, the header of the image currently in
memory is listed, if any.
.\"====================================================================
.ti -4
1 KILL
.ti +4
[GREG3_\]KILL

KILL calls the interactive cursor to interact with the current IMAGE
buffer. The buffer must have been loaded in write mode (IMAGE /WRITE).
Recognised keys are:
.in +4
.ti -2
- V to give the value of the pixel,
.ti -2
- K to give the current blanking value to the pixel,
.ti -2
- I to interpolate the value from the neighbour pixels,
.ti -2
- E to exit from interactive cursor mode.
.in -4
Any other key is ignored.
.\"====================================================================
.ti -4
1 SPECTRUM
.ti +4
[GREG3_\]SPECTRUM I [J [K]]
.ti +8
or
.ti +4
[GREG3_\]SPECTRUM OutSpec InCube [Mask] [/CORNER Imin Imax Jmin Jmax]
  [/PLANE First Last]  /MEAN  or  /SUM

SPECTRUM I [J [K]]
.br
Extract a spectrum from an image according to the following numbering:
.ti +4
Spectrum (l) = Image (l,i,j,k)
.br
for a 4-dimensional image. The spectrum is loaded into the X,Y buffers
of GreG. It can be processed later by the standard commands LIMITS,
CONNECT, CURVE and so on.

The alternate syntax, used if any option is present, computes in the
output variable OutSpec a mean or integrated spectrum
over the specified region of the input Image variable InCube, using the
current Greg polygon and the specified Mask if any.

.ti -4
2 /CORNER
.ti +4
[GREG3_\]SPECTRUM OutSpec InCube [Mask] /CORNER Imin Imax Jmin Jmax
  [/PLANE First Last] /MEAN] or /SUM

  Restricts the computation to the specified 2-D region of the data cube.
One of the mutually exclusive options /MEAN or /SUM must be present.

.ti -4
2 /MEAN
.ti +4
[GREG3_\]SPECTRUM OutSpec InCube [Mask] /MEAN
  [/CORNER Imin Imax Jmin Jmax] [/PLANE First Last]

  Indicates that we are computing a Mean spectrum, not extracting
  a spectrum from the default Greg data cube. The spectrum is
  the average spectrum accounting for all valid values.

.ti -4
2 /PLANE
.ti +4
[GREG3_\]SPECTRUM OutSpec InCube [Mask]  /PLANE First Last
  [/CORNER Imin Imax Jmin Jmax] /MEAN  or  /SUM

  Restricts the spectrum to the specified channels of the data cube.
One of the mutually exclusive options /MEAN or /SUM must be present.

.ti -4
2 /SUM
.ti +4
[GREG3_\]SPECTRUM OutSpec InCube [Mask] /SUM
  [/CORNER Imin Imax Jmin Jmax] [/PLANE First Last]

  Indicates that we are computing an integrated spectrum, not extracting
  a spectrum from the default Greg data cube. Blanked pixels
  are treated as zeros. The result corresponds to the integral
  of the signal over the valid area (sum of values times the
  pixel size in user units).

  /SUM is typically used to compute integrated flux from Jy/Beam
  units.

.\"====================================================================
.ti -4
1 ENDOFHELP
