Replaces regions in a two-dimensional NDF by bad values or by linear interpolation
The bounds of the area to be replaced can be specified either by using a graphics cursor, or directly in response to parameter prompts, or by supplying a text file containing the bounds (see Parameter MODE). In the first two modes the application loops asking for new areas to zap, until told to quit or an error is encountered. In the last mode processing stops when the end of file is found. An output text file may be produced containing a description of the areas replaced (see Parameter COLOUT). This file may be used to specify the regions to be replaced in a subsequent invocation of ZAPLIN.
"File". Each record in the file must be either a blank
line, a comment (indicated by a "!" or "#" in column 1), or a definition of
an area to be replaced, consisting of three or four space-separated fields.
If a range of columns is to be replaced, each of the first two fields should
be a formatted value for the first axis of the current co-ordinate Frame of
the input NDF, and the third field should be the single character "C". If a
range of lines is to be replaced, each of the first two fields should be a
formatted value for the second axis of the current co-ordinate Frame, and the third
field should be the single character "L". If a rectangular region is to be
replaced, the first two fields should give the formatted values on axes 1 and 2 at
one corner of the box, and the second two fields should give the formatted
values on axes 1 and 2 at the opposite corner of the box. "File". If COLOUT is null (!), no file will be created. [!] "Columns" or "Region", and
Parameter MODE is set to "Interface". Each x value should be given as a formatted
value for Axis 1 of the current co-ordinate Frame of the input NDF. The two
values should be separated by a comma, or by one or more spaces. "Cursor".
[Current graphics device] "Cursor" or "Interface". The options are as
follows.
"Lines" –- Replaces lines of pixels between the y values specified by Parameter LINES.
Each replaced line extends the full width of the image.
"Columns" –- Replaces columns of pixels between the x values specified by Parameter
COLUMNS. Each replaced column extends the full height of the image.
"Region" –- Replaces the rectangular region of pixels within the x and y bounds
specified by Parameters COLUMNS and LINES. The edges of the box are parallel to the
pixel axes.
If this parameter is specified on the command line, and Parameter MODE is set to
"Interface", only one area will be replaced; otherwise a series of areas will be
replaced until a null (!) value is supplied for this parameter.
"Lines" or "Region", and Parameter MODE is set to
"Interface". Each y value should be given as a formatted value for Axis 2 of the
current co-ordinate Frame of the input NDF. The two values should be separated by a
comma, or by one or more spaces. "Mark". It specifies the type of marker with which
each cursor position should be marked, and should be given as an integer PGPLOT marker
type. For instance, 0 gives a box, 1 gives a dot, 2 gives a cross, 3 gives
an asterisk, 7 gives a triangle. The value must be larger than or equal to
−31.
[current value] "Interface" –- Bounds are obtained using Parameters COLUMNS and LINES. The type of area
to be replaced is specified using Parameter LINCOL.
"Cursor" –- Bounds are obtained using the graphics cursor of the device specified by
Parameter DEVICE. The type of area to be replaced is specified using Parameter LINCOL.
The WCS information stored with the picture in the graphics database is used to map
the supplied cursor positions into the pixel co-ordinate Frame of the input NDF. A
message is displayed indicating the co-ordinate Frame in which the picture and the
output NDF were aligned. Graphics may be drawn over the image indicating the region to
be replaced (see Parameter PLOT).
"File" –- The bounds and type of each area to be replaced are supplied in the text file
specified by Parameter COLIN.
[current value]
"Linear". If a TRUE value is supplied, gaussian noise is
added to each interpolated pixel value. The variance of the noise is equal to the
variance of the data value being replaced. If the data variance is bad, no noise is
added. If the input NDF has no VARIANCE component, variances equal to the absolute
data value are used. This facility is provided for cosmetic use. [FALSE] "Adapt" –- Causes "Box" to be used if a region is being replaced, "Vline" is a
range of columns is being replaced, and "Hline" if a range of lines is being
replaced.
"Box" –- A rectangular box with edges parallel to the edges of the graphics device is
drawn with the two specified positions at opposite corners.
"Mark" –- Each position is marked by the symbol specified by Parameter MARKER.
"None" –- No graphics are produced.
"Vline" –- A vertial line is drawn through each specified position, extending the
entire height of the selected picture.
"Hline" –- A horizontal line is drawn through each specified position, extending the
entire width of the selected picture.
[current value]
A comma-separated list of strings should be given in which each string is either an
attribute setting, or the name of a text file preceded by an up-arrow character
".
Such text files should contain further comma-separated lists which will be read and
interpreted in the same manner. Attribute settings are applied in the order in which
they occur within the list, with later settings overriding any earlier settings given
for the same attribute.
"
Each individual attribute setting should be of the form:
<name>=<value>
where <name>
is the name of a plotting attribute, and
<value>
is the value to assign to the attribute. Default values will be used for any
unspecified attributes. All attributes will be defaulted if a null value (!)–-the
initial default–-is supplied. To apply changes of style to only the current invocation,
begin these attributes with a plus sign. A mixture of persistent and temporary style
changes is achieved by listing all the persistent attributes followed by a plus sign
then the list of temporary attributes.
See Section E for a description of the available attributes. Any unrecognised attributes are ignored (no error is reported).
The appearance of vertical and horizontal lines is controlled by the attributes
Colour(Curves), Width(Curves), etc. (the synonym Lines may be used in place of Curves). The
appearance of boxes is controlled by the attributes Colour(Border), Size(Border), etc.
(the synonym Box may be used in place of Border). The appearance of markers is
controlled by attributes Colour(Markers), Size(Markers), etc. [current value]
!) propagates the title from
the input image to the output image. [!] Its integer index within the current Frame of the output NDF (in the range 1 to the number of axes in the current Frame).
Its Symbol string such as "RA" or "VRAD".
A generic option where "SPEC" requests the spectral axis, "TIME" selects the time axis,
"SKYLON" and "SKYLAT" picks the sky longitude and latitude axes respectively. Only
those axis domains present are available as options.
A list of acceptable values is displayed if an illegal value is supplied. If a
null (!) value is supplied, the axes with the same indices as the first two
significant NDF pixel axes are used. [!]
"Bad" –- Replace the selected pixels by bad values.
"Linear" –- Replace the selected pixels using linear interpolation. If a range of lines
is replaced, then the interpolation is performed vertically between the first non-bad
pixels above and below the selected lines. If a range of columns is replaced, then the
interpolation is performed horizontally between the first non-bad pixels to the left
and right of the selected columns. If a rectangular region is replaced, then the
interpolation is bi-linear between the nearest non-bad pixels on all four edges of the
selected region. If interpolation is not possible (for instance, if the selected pixels
are at the edge of the array) then the pixels are replaced with bad values. ["Linear"]
"Cursor", this will copy the NDF associated with the last
DATA picture to an NDF called cleaned, interactively replacing areas using the
current graphics device. Linear interpolation is used to obtain the replacement
values. A record of the areas replaced will be stored in a text file named
fudge.dat. aaoccd1.dat, and stores the result in an NDF called m42c. Bounds supplied in Interface and File mode are transformed into the PIXEL Frame of the input NDF before being used.
Complicated results arise if the axes of the current Frame of the input NDF are not parallel to the pixel axes. In these cases it is usually better to switch to the PIXEL Frame (using WCSFRAME) prior to using ZAPLIN. Roughly speaking, the range of pixel lines and/or columns which are replaced will include any which intersect the specified range on the current-Frame axis.
When using input files care should be taken to ensure that the co-ordinate system used in the file matches the current co-ordinate Frame of the input NDF.
If the input NDF is a section of an NDF with a higher dimensionality, the "lines" and
"columns" are with respect to the two-dimensional section, and do not necessarily refer
to the first and second dimensions of the NDF as a whole. See the "Examples".
This routine correctly processes the AXIS, DATA, QUALITY, VARIANCE, LABEL, TITLE, UNITS, WCS, and HISTORY components of the input NDF and propagates all extensions.
Processing of bad pixels and automatic quality masking are supported.
All non-complex numeric data types can be handled.