Level 2 Help for GTWARPXD

INP

Input file name.  This parameter is input as:
     INP=innam
where "innam" is the input file name.


DISTORT

The special case will be discussed first in this paragraph.
A previous call to GTWARPXD can save its grids and related
information with the gridout parameter... and that can be
input as the first parameter to the next call of gtwarpxd
to do an additional distortion correction.  The result is a
huge savings of time, especially if the grids are 1000 x 1000.
IF THIS OPTION IS USED, THE DCOLS(...) PARAMETER MUST START
WITH FOUR ZEROS.  THIS TELLS THE PROGRAM THAT THE FIRST FILE
IS NOT AN UNPROCESSED DISTORTION FILE, BUT A PROCESSED SET
OF ONE OR MORE DISTORTION FILES.  Note that the first file
in this case does not have to be processed so the two files
run as fast as the single file case.  This file is the one
created by the gridout parameter in a previous call (which
had to have the same reference file).  A special case of this
special case is discussed below under the title REMAPPING THE
OUTPUT.

This parameter must have five inputs, so use the format with
parentheses and four commas.  For one input, this will look like

    distort=(d1,,,,)
    
the maximum case is distort=(d1,d2,d3,d4,d5)

more than 5 can obviously be handled with the gridout feature
as discussed above.

A sequence of post-mapping distortions can be added with the
parameter DISTORT.  These will be applied in sequence to the
warp grid developed from the mapping.  These distortions are
all given in pixel (newline,newsamp,oldline,oldsamp) point pairs
in the reference image coordinate space.  The points can be
irregular (tieconv is used).  THE NET RESULT IS THAT A SINGLE
IMAGE GEOMV WILL BE APPLIED TO AVOID MULTIPLE IMAGE RESAMPLINGS.

Each distortion is calculated by the following steps (coverinp case):

1.  warp grid is calculated to (sl,ss,nl,ns).
2.  tieconv is applied to the distortion points using (sl,ss,nl,ns)
    as the bounding box.
3.  adjustments are calculated for the four edges of the bounding box.
4.  (newsl,newss,newnl,newns) are calculated by the adjustments.
5.  tieconv is applied again to the distortion points using (newsl,
    newss,newnl,newns) as the bounding box.
6.  the warp grid from step 1 is composed with the grid from step 5
    using the program gridcomp.
7.  steps 2 through 6 are repeated for each distortion input with
    the composed grid now replacing the grid started in step 1.
8.  geomv is now applied with the composed grid and (newsl,newss,
    newnl,newns).  The reference input is unchanged.

REMAPPING THE OUTPUT

If the sequential processing of raw to final is desired to be recast
at the end to a new map projection (e.g., see hywarp2.pdf), then that can be
handled by the following steps:

1.  first three or four calls to gtwarpxd use the processing map
reference file.  Also note the the gridout file name can be reused
at each step since it is read first, then written.
2.  the final call to gtwarpxd use the desired map reference file
in the reference parameter.  The gridout from the previous gtwarpxd
call has to be reprocessed to this reference by steps 3, etc.
3.  add four columns to the gridout file.
4.  process the pixel coords in (1,2) to map coordinates in the 
processing map reference (pixmap)
5.  remap the coordinates to the desired map reference (gtproj2)
6.  process the map coordinates to pixel coordinates using the 
desired map reference (pixmap).
7.  do steps 4-6 for columns (3,4) NOTE THEY ARE IN RAW INPUT REFERENCE SEE
EXAMPLE IN HYWARP2.PDF
8.  input this file to the final call of gtwarpxd.  set dcols to
the first four columns (1,2,3,4) not (0,0,0,0) so it will be processed
as a tiepoint data set (establishing (sl,ss,nl,ns))
9.  the second dist() input also has to be remapped to the desired
map reference.


DCOLS

Give four columns for each distortion file giving the columns
in order (newline,newsamp,oldline,oldsamp) all in VICAR pixels in
the reference image space.


OUT

Output file name. This parameter is input as:
     OUT=outnam
where:
"outnam" is the output file name.VARI OUT


REF

reference file name. This parameter is input as:
     REF=refnam
where:
"refnam" is the reference file name.

This is a VICAR image that has a GeoTIFF label to specify a mapping.
It could be an image of a geographic area, or it could be a single 
pixel image that serves as the holder of the GeoTIFF mapping information
only.  In the latter case only the 'coverinp case would make sense.


INTERP

This parameter has three valid keyword values: NOIN and BILIN.

NOIN means no interpolation.   The default method (used when neither keyword 
is specified) for computing the
DN values of the output picture is to use a bi-linear interpolation
on the four nearest neighbors in the input picture.  With NOIN, the
value of the nearest point is simply used.
For example, say a point in the output picture was determined
to have come from point (R,P) in the input picture.  Since R and P
are real values, we must somehow calculate a DN value for that
point.  Take IR and IP as the truncated values.  We then have
          VAL1                                 VAL2
           *                                    *
         (IR,IP)                              (IR,IP+1)
                     POINT
                       *
                     (R,P)
          VAL3                                 VAL4
           *                                    *
         (IR+1,IP)                           (IR+1,IP+1)
Here, POINT is the result of a bilinear interpolation using
VAL1, VAL2, VAL3, and VAL4.
If NOIN is specified, then POINT would be VAL1, the nearest
neighbor.

ZNOIN specifies that a four-point interpolation is done except
when one or more of the points used has a value equal to zero. 
In that case the nearest method is used.
This allows preparation of sharp edges (no interpolation rolloff)
for mosaicking.


GRIDOUT

The first file is the composed grid ready to be used in geomv or
as the first input to a subsequent call of gtwarpxd (can only be used
as the first input).  

The second file contains the geomv sl,ss,nl,ns in the first four 
columns of an ibis file, double precision, 1 record.

The third file is a copy of the ref file for the gtwarpxd and for the
geomv.


TYPREF

     1.  The keyword 'coverinp causes the procedure to map all of the
     input image to an output image that will just contain it.   The
     keyword gorewid allows the user to specify a zero-filled margin
     to make the output a little larger (or negative trims smaller).
	
     2.  The keyword 'coverref causes the procedure to map the input
     image to an output image that exactly matches the "reference" image.
     Some parts of the input can be lost, or huge areas of zero-fill
     could be added to make the images match.  The gorewid keyword has
     no effect in this case.
	   


GOREWID

Added width of gores for 'coverinp case only.  This number of pixel
columns or rows is added to all four sides.  Zero fill is used.


MEMSIZE

passed to geomv vmemsize parameter


AUXIN

Using this is much faster than calling gtwarpxd separately for each
file with the same parameters.  If this parameter is used, all 9 commas
may have to be used, e.g. for two files:
      auxin=("file1","file2",,,,,,,,)        auxout=("outfile1","outfile2",,,,,,,,)
instead of:
      auxin=("file1","file2")        auxout=("outfile1","outfile2")
This is a TAE "feature".


AUXOUT

Using this is much faster than calling gtwarpxd separately for each
file with the same parameters.  If this parameter is used, all 9 commas
may have to be used, e.g. for two files:
      auxin=("file1","file2",,,,,,,,)        auxout=("outfile1","outfile2",,,,,,,,)
instead of:
      auxin=("file1","file2")        auxout=("outfile1","outfile2")
This is a TAE "feature".