ANSI-C program: lin_comb_ref.c
NAME
lin_comb-ref - Calculate linear combination of 2 images (float)
with option to add or subtract the scaled average of a specified
reference region
SYNOPSIS
lin_comb_ref <f1> <f2> <constant>
<factor1> <factor2> <f_out> <width>
[roff] [loff] [nr] [nl] [zflag]
<f1> | (input) input data file 1 (float) |
<f2> | (input) input data file 2, reference scene if this mode selected by selecting a region with roff and loff (float) |
constant | constant value to add to output |
<factor1> | factor1 to multiply with f1 |
<factor2> | factor2 to multiply with f2 |
<f_out> | output file (float) |
<width> | number of samples/row |
[roff] | range pixel offset to center of the reference region in f2, (default: -1, otherwise center of reference region) |
[loff] | line offset to center of the reference region |
[nr] | number of range pixels to average in the reference region (enter - for default = 16) |
[nl] | number of lines average in the reference region (enter - for default= 16) |
[zero_flag] | interpretation of 0.0 data values: 0: interpreted as missing value (default) 1: 0.0 is valid data value |
EXAMPLE
lin_comb_ref 20020831_20021111.adf.unw
20021229_20030428.adf.unw 0. 1 -1 diff_phase.unw
600
Reads the two float format files 20020831_20021111.adf.unw
20021229_20030428.adf.unw. The constant is 0.0, and the
scaling factors are 1.0 and -.0 respectively. The difference of
the data in the two two files is written to the output file
diff_phase.unw. Each
line is 600 samples.
lin_comb_ref 20020831_20021111.adf.unw
20020831_20021111.adf.unw 0. 1 -1 b.unw 600 100 100 16
16
Reads the two float format files 20020831_20021111.adf.unw
20021229_20030428.adf.unw. The second file is used
to provide a reference value determined by averaging the data in
a 16x16 region centered on the coordinate 100,100. The average
value is multiplied by factor2 and added to the sum. The constant
is 0.0, and the scaling factors are 1.0 and -1.0
respectively.
DESCRIPTION
lin_comb_ref calculates
the linear combination of 2 float format files. Scale factors and
a constant can be used to scale the individual data.
There is the option to use the second file as a source for
reference values. A region can be specified centered at
roff,loff. The values in this region are averaged and used as the
data value for the second file.
Values 0.0 of the input data files may either be interpreted as NULL values (zero_flag=0) or as valid data. In the case of an interpretation as NULL values 0.0 is written to the output file as soon as at least one of the input data files has NULL value for a pixel.