Gamma LAT: Reference Manual


replace_values

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
   2: float (default)
   4:short integer

EXAMPLES

replace_values 1868_1911.hgt 0.0 1911_1954.hgt 1868_1911.hgt_out 2500

Missing values in the 1868_1911.hgt height map (i.e. 0.0 values) are replaced by the value of the height map 1911_1954.hgt_out.

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.

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.

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.


© Copyrights for Documentation, Users Guide and Reference Manual by Gamma Remote Sensing, 2013.
UW, CW, TS, last change 21-Mar-2013.