c_merge_ddrs- Updates the output DDR fields based on the input DDRs

SYNTAX

#include "las.h"

FUNCTION c_merge_ddrs (parblk,host_in,host_out,nmrimg,window,bands, nbands, line_inc,samp_inc,out_nbands,cflag,out_bddr,out_ddr, upddr_flag)

     struct              PARBLK *parblk;
     char                host_in[][CMLEN];
     char               *host_out;
     long               *nmrimg;
     long                window[][4];
     long                bands[][MAXBND +1];
     long                nbands[];
     double             *line_inc;
     double             *samp_inc;
     long               *out_nbands;
     long               *cflag;
     struct              BDDR **out_bddr;
     struct              DDR *out_ddr;
     char                upddr_flag;

PARAMETERS

parblk (input, PARBLK)

TAE parameter block passed by reference. It is assumed that TAE has been initialized prior to calling c_merge_ddrs().

host_in (input, character, length(imglimit)(CMLEN))

Image host filename(s) from which the DDR values are to be retrieved and used to calculate the output DDR values.

host_out (input, character, length(CMLEN))

Output image host filename for which the DDR values are calculated and written to.

nmrimg (input, integer)

Total number of input image(s).

window (input, integer, length(imglimit)(4))

Two-dimensional array containing the window specification for each input image. The first dimension is imglimit and the second is 4. The four elements of the window are SL, SS, NL, NS.

bands (input, integer, length(imglimit)(MAXBND + 1))

Two-dimensional array containing the band numbers of each of the input images. The first dimension is imglimit and the second is MAXBAND + 1.

nbands (input, integer, length(imglimit))

Number of bands specified for each input image.

line_inc (input, double)

Number of pixels of the input image(s) that one output pixel will represent in the line direction. A positive fractional value greater than 0 and less than 1 specifies that the input image(s) have been expanded. A positive integer value greater than 1 specifies that the input image(s) have been subsampled. If no replication or subsampling of pixels was completed enter a value of 1.

samp_inc (input, double)

Number of pixels of the input image(s) that one output pixel will represent in the sample direction. A positive fractional value greater than 0 and less than 1 specifies that the input image(s) have been expanded. A positive integer value greater than 1 specifies that the input image(s) have been subsampled. If no replication or subsampling of pixels was completed enter a value of 1.

out_nbands (input, integer)

Total number of bands the output image will contain.

cflag (input, integer)

Flag indicating whether the input images will be combined into one band of the output image. This value should be set to COMB for functions like CONCAT, MATH where the number of output bands is not the same as the number of input bands. Valid values are:

out_bddr (output, BDDR)

The output band dependent DDR records.

out_ddr (output, DDR)

The output DDR.

          COMB   (1) > images will be combined 
          NOCOMB (0) > images will not be combined

DESCRIPTION

The c_merge_ddrs() call reads nmrimg DDR files associated with the image host filenames specified in host_in. Based upon the values of window, bands, nbands, line_inc, samp_inc, out_nbands, cflag, and the values contained in the input DDR, the DDR associated with host_out will contain values that are copied from the input DDRs, recalculated from the input DDRs, or invalidated. See DDR Implementation Guidelines section for more details.

RETURN VALUE

c_merge_ddrs() returns

     E_SUCC (0)  --> successful completion
     E_FAIL (-1) --> operation failed

SPECIAL CONSIDERATIONS

This function call does not actually write to an output DDR file. That is performed by the c_upddr() function in lieu of calling this function.