Level 2 Help for FFT2

INP

A VICAR labelled image file


OUT

OUT specifies the output transform dataset name for a forward transform,
or the output image dataset name for an inverse transform.

The output FFT of an image with NL lines and NS samples will be of
COMPLEX format, with NS lines and NL samples, i.e., it is transposed
with respect to the input.  This is done to speed up processing.
(The output of the inverse tranform is transposed a second time, hence
has the same orientation as the original image.)

In order to process an FFT with Vicar programs, one generally must
first separate it into its REAL components using program CCOMP (q.v.),
as most Vicar programs do not handle complex format.


SIZE

The standard size field defining the area of the input picture that is to
be transformed.

SIZE = (SL, SS, NL, NS).


SL

Starting line of the area to be transformed.


SS

Starting sample of the area to be transformed


NL

Number of lines in the area to be transformed.


NS

Number of samples in the area to be transformed.


MODE

FORWARD specifies that the fourier transform is to be from image space
to the conjugate dimension (frequency or wavelength).  This is the default
if the input data format is not complex.

INVERSE indicates that the fourier transformation is to be from frequency
(or wavelength) space, back to image space.  This is the default if the
input data format is complex.

Note that it is permissible to specify FORWARD for complex input data, but
not INVERSE with non-complex data:  the FFT must always be in complex
format.


FORMAT

This keyword specifies the data format of the image file, which is the
input file in the FORWARD mode and the output file in the INVERSE mode.
(The FFT file always has COMPLEX format.)

Currently, this keyword is ignored in FORWARD mode, since Vicar2 convention
is not to override input file formats.

Valid values are: BYTE, HALF, FULL, REAL, COMP.

Default is BYTE.


SCRATCH

This specifies a scratch directory that is used by the program to store
one or two intermediate files which may be required.  The two possible
scratch files are:

 1) If TRANSPOS was specified, a file containing the FT after transposition
  (INVERSE mode) or before transposition (if REVERSE mode).

 2) A scratch file required by the FFT program itself during intermediate
   steps of the processing.  It is only required when both of the following
   conditions are met:
 
   (a) the image buffer required by the program is larger than
      the buffer size specified by the BUFPOW parameter. The image
      buffer size required is N*N complex numbers, where N is the
      smallest power of 2 that equals or exceeds both NL and NS,
      i.e., 8*N*N bytes; and,

   (b) the output file is not large enough to be used for scratch
      storage.  This will be true if its format is not complex, and
      also if the number of lines of the output is not equal to the
      number of samples.

   The default BUFPOW (18) is sufficient to contain a 128*128 image.
   However, note that a 64*256 image, say, requires a scratch file,
   since it is the larger of NL and NS that determines the buffer size.

The second scratch file will be deleted at the end of the execution of 
FFT2 by the program, but the first will remain.

The default for this parameter is the local directory.  
The user may specify a different location for any reason (e.g., if that 
disk is full, or not available).  If this parameter is specified for a 
case in which it is not required, it is ignored.


BUFPOW

This determines the size of the buffer that the program uses to 
transpose the FFT.  Since this buffer size (in bytes) is always a power
of 2, this parameter specifies the power of 2 which equals the buffer
size:  BUF_SIZE = 2 ** BUFPOW.

Since the FFT will be transposed, this buffer must be able to hold
at least two lines of N complex numbers, where N is the larger of NS
and NL, hence:
                BUF_SIZE >= 2 * 8 * N,
 or:
                               2
                BUFPOW >= 4 + log(N).

The above conditions must be met for the program to run at all.
Furthermore, the entire transposition can be done in memory if
BUF_SIZE >= 8*N*N, or BUFPOW >= 3+logN.  This will speed processing,
assuming that the memory is available and that paging is not a problem.
The user will not in general need to specify this parameter, but it
is provided for the following contingencies:

 (a) to allow improved performance, since increasing the buffer size
    will cut down on the amount of I/O done in the program, but can
    increase paging if a large working set is not available;
 
 (b) to obviate the need for a scratch file (see parameter SCRATCH);


TRANSPOS

This keyword gives the user the option to transpose the FT before
processing it (if MODE=INVERSE was specified) or after generating it 
(if MODE=FORWARD was specified).  Default is not to transpose the FT.

The reason for this option is that the standard FT format used by this
procedure is the transpose of the normal standard (which follows from
direct application of the FT formula).  The reason for this is to
save compute time;  further ramifications of this fact are discussed 
in the HELP text for program FFT22, q.v..  If the user wishes to have
the FT in "normal" format (at the expense of some extra CPU time),
then keyword TRANSPOS should be specified.

Bear in mind that if a forward transform is taken using TRANSPOS, then
a subsequent inverse transform should also use this keyword!