Replaces all occurrences of a given value in an NDF array with another
value SUBSTITUTE
A single pair of old and new values can be supplied (see Parameters OLDVAL and NEWVAL). All occurrences of OLDVAL are replaced with NEWVAL. Other values are unchanged.
A look-up table containing corresponding old and new values can be supplied. By default, each input pixel that equals an old value is replaced by the corresponding new value. Alternatively, all input pixels can be changed to a new value by interpolation between the input values (see Parameters LUT and INTERP).
"Data"
,
"Error"
, "Variance"
, or "All"
. The last of the options forces substitution
in both the data and variance arrays. This parameter is ignored if the data
array is the only array component within the NDF. ["Data"]
"None"
– Pixel values that equal an input value are replaced by the corresponding
output value. Other values are left unchanged.
"Nearest"
– Every pixel value is replaced by the output value corresponding to the
nearest input value.
"Linear"
– Every pixel value is replaced by an output value determined using linear
interpolation between the input values.
If "Nearest"
or "Linear"
is used, pixel values that are outside the range of input
value covered by the look-up table are set bad in the output. Additionally, an error
is reported if the old data values are not montonic increasing. ["None"]
!
) is supplied for this parameter the
old and new data values will instead be obtained using Parameters OLDVAL and
NEWVAL. Lines starting with a hash (#) or exclamation mark (!
) are ignored, as
are blank lines. Other lines should contain an old data value followed by the
corresponding new data value. The way in which the values in this table are used is
determined by Parameter INTERP. [!]
"All"
. It must lie within the minimum and maximum
values of the data type of the array with higher precision. The replacement
value is converted to data type of the array being converted before the search
begins. The suggested default is the current value. This parameter is only
accessed if a null value is supplied for Parameter LUT. !
) propagates the
title from the input NDF to the output NDF. [!]
!
) value is supplied, the output data type equals the
input data type. [!]
The comparison for floating-point values tests that the difference between the replacement value and the element value is less than their mean times the precision of the data type.
This routine correctly processes the AXIS, DATA, QUALITY, VARIANCE, LABEL, TITLE, UNITS, WCS, and HISTORY components of an NDF data structure and propagates all extensions.
All non-complex numeric data types can be handled.
Any number of NDF dimensions is supported.