ANSI-C program: replace_values.c
NAME
replace_values - Replace value(s) of input data file with
indicated value or values extracted from a second input data
file.
SYNOPSIS
replace_values <f_in> <value>
<new_value> <f_out> <width> [rpl_flag]
[type]
<f_in> | input data file |
<value> | value to be replaced or threshold |
<new_value> | new value to use or second input data file (float) |
<f_out> | output data file (float) |
<width> | number of samples/row |
[rpl_flag] | replacement option flag (default = 0) 0 : replace all points == value with new_value 1 : replace all points >= value with new_value 2 : replace all points <= value with new_value |
[type] | data type (default 2:float 4:short integer) |
EXAMPLE
replace_values 1868_1911.hgt 0.0 1911_1954.hgt
1868_1911.hgt_out 2500
replace_values sv150194d1_sv180194d1.pwr.coffs.real 20. 0.0 sv150194d1_sv180194d1.pwr.coffs.real_out 256 1
Values larger than 20. in the input file are replaced by missing values (i.e. 0.0).replace_values bern.hgt -32768 0 bern2.dem 1201 0 4
short data values of -32768 are replace by 0 in the file bern.hgt.INSTALLATION
Source code replace_values.c in ./src. For compilation adjust and
use Makefile. Executable version replace_values in ../bin.
AVAILABILITY
Uses DISP type definition file display.h.
DESCRIPTION
replace_values reads a real valued input data file (of type float
or short) and generates a new output data file replacing for each
pixel equal, larger or smaller than a specified one its value
with a new one.
In the case where value is give as nan the data points in the input float format file are tested to see if they are not a number (nan) and replaced with the new_value.
OPTIONS
The replacement options flag specifies if values equal, larger or
smaller than the specified one are to be replaced.
The new values to be used instead of the replaced value can
either be the indicated constant value or can be extracted from a
second input data file (float) at the identical pixel
position.
SEE ALSO
display.h.
DIAGNOSTICS
All messages are generally self-explanatory.
NOTES
None.
© Copyrights for Documentation, Users Guide and Reference Manual by Gamma Remote Sensing, 2003.
UW, CW, TS, last change 21-Nov-2003.