Gamma LAT: Reference Manual


poly_math

C program: poly_math.c 

NAME
poly_math - apply arithmetic operations to data within polygonal regions

SYNOPSIS
poly_math <data_in> <data_out> <width> <polygon> [offset_scale] [mode] [offset] [scale] <

<data_in> input data file (4-byte float)
<data_out> output data file (4-byte float)
<width > data line width in samples
<polygon > text file containing polygon vertices
[offset_scale] text file containing offset and scale factors for data in each polygon,
enter - to read offset and scale from the command line
[mode] data mode (0:copy all data, 1:copy data only within polygons, background set to 0.0)
[offset] constant offset applied for all data within polygons, (default=0.0)
[scale] scale factor for all output polygon (default=1.0)

EXAMPLE
poly_math landers.unw landers_update.unw 4912 polygons.dat offset_scale.dat

INSTALLATION
Source code poly_math.c in src directory. Executable version ../bin/poly_math.c

DESCRIPTION
poly_math is used to modify values of binary floatinging point values within a polygonal region by adding an offset and scaling. This program is especially useful for correcting phase unwrapping errors in polygonal regions by adding multiples of 2¶. It can also be used to extract regions from a file and copy them to the output file for display of data classes. The vertices of the polygons are stored in an text file generated using program polyras.

Data values within each polygon are offset by a constant and scaled using values in the offset_scale file. This file has a line entry for each polygon with each line consisting of 3 values separated by spaces. The first column is the integer polygon number, and the second and third values are the offset and scale factors respectively. There must be an entry line in the offset_scale file for each polygon. If the offset_scale file is ommitted using a - as the entry, then the offset and scale values from the command line are applied. Default values for these parameters are 0.0 and 1.0 respectively.

Typically the polygons are selected using program polyras.c though the vertices may also be entered using a text editor. To see the format run the program poly_ras and examine the output. Each group of vertices is separated by a blank line. The vertices have the x and y coordinate and the vertex number, all as integers.

If the data mode on the command line is set to 0, the output file has a copy of the input data with the modified data values replacing the input data. For mode=1, the background is set to 0.0, so only the data within polygons and on the edges appear in the ouput. This mode is useful for displaying data sets used for classification.

OPTIONS
The offset and scale values entered on the command line are applied to all polygons if - is entered for the offset_scale file name.

SEE ALSO
polyx.c, histogram.c, polyras.c


© Copyrights for Documentation, Users Guide and Reference Manual by Gamma Remote Sensing, 2006.
UW, CW, last change 19-Jun-2006.