DATAMANIP commands


PROGRAM NAME

kreplace - Replace All Occurrences of X with Y

DESCRIPTION

The Replace Value operator, kreplace, replaces each occurrence of the specified old value (X) with a new value (Y). The operations occur on the map segment if one is present in the source object otherwise the operations occur on the value segment.

The optional tolerance values allow the value that is being replaced to fall within a given range (X - Lower tolerance to X + Upper tolerance).

Data Type The data type of the output object is the same as the input object's data type. Internally, the data is processed using one of the following: unsigned byte, long, unsigned long, double, or double complex. Data will not be cast to a lower type for processing.

Map Data If the input object contains a map, then the operation is performed on the map data. If the input object does not have a map but has value data, then the operation is performed on the value data.

Validity Mask If there is a validity mask associated with the input object, the mask is transferred to the output object. To decrease processing time, the operation will still be performed on those data that have corresponding mask values equal to zero. If the data under the mask is genuinely fInotfP processable, such as NaN or infinity, the user can specify that a value be substituted in place of the original value when it is accessed. The masked data substitution attributes for a data object can be explicitly set and stored using the fISet AttributefP operator, DATAMANIP::ksetdattr.

Explicit Location and Time Data If the input object has time data or location data, it is transferred to the output object.

Failure Modes This program fails if the input object lacks both map data and value data.

REQUIRED ARGUMENTS

-i
type: infile
desc: Input file
-oval
type: double
desc: Value to be replaced (X)
bounds: no range checking
-nval
type: double
desc: New value to be substituted (Y)
bounds: no range checking
-o
type: outfile
desc: Output file

OPTIONAL ARGUMENTS

-utol
type: double
desc: Upper tolerance allowed in searched value
default: 0
bounds: no range checking
-ltol
type: double
desc: Lower tolerance allowed in searched value
default: 0
bounds: no range checking

EXAMPLES

SEE ALSO

RESTRICTIONS

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.