; PADIM
;---------------------------------------------------------------
;! Task to increase image size by padding with some value
;# TASK IMAGING
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 2009
;;  Associated Universities, Inc. Washington DC, USA.
;;
;;  This program is free software; you can redistribute it and/or
;;  modify it under the terms of the GNU General Public License as
;;  published by the Free Software Foundation; either version 2 of
;;  the License, or (at your option) any later version.
;;
;;  This program is distributed in the hope that it will be useful,
;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;  GNU General Public License for more details.
;;
;;  You should have received a copy of the GNU General Public
;;  License along with this program; if not, write to the Free
;;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
;;  MA 02139, USA.
;;
;;  Correspondence concerning AIPS should be addressed as follows:
;;         Internet email: aipsmail@nrao.edu.
;;         Postal address: AIPS Project Office
;;                         National Radio Astronomy Observatory
;;                         520 Edgemont Road
;;                         Charlottesville, VA 22903-2475 USA
;-----------------------------------------------------------------------
PADIM     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
PADIM: Task to increase image size by padding with some value
INNAME                             Input image name
INCLASS                            Input image class
INSEQ           0.0      9999.0    Input image seq. no.
INDISK          0.0         9.0    Input image disk no.
OUTNAME                            Output image name
OUTCLASS                           Output image class
OUTSEQ          0.0      9999.0    Output image seq. #
OUTDISK         0.0         9.0    Output image disk drive
IMSIZE          1.0      4096.0    Output image size
CPARM                              CPARM(1) = Padding value
                                   CPARM(2) > 0 -> pad with
                                   magic blanks [ignore C(1)]
---------------------------------------------------------------
PADIM
Type: Task
Use:  It may be useful to increase the size of your image by
      surrounding it with some constant value, zero say. For
      example, suppose you have an image that you wish to convolve
      by a gaussian (with CONVL), but the image has very sharp edges
      because it has been blanked (zeroed) outside of some region.
      In order to adequately represent the high spatial frequencies
      necessary to describe the sharp edges, you may need to make
      your image bigger.  CONVL will in fact internally pad with zeroes
      to the nearest powerof 2 (200 -> 256 etc.), but this may not be
      enough.  PADIM will simply enable this operation.   LGEOM can
      do this too, but it invariably still does as interpolation of
      your data, which in this case in particular, because of the sharp
      edges, is undesirable.  PADIM does absolutely nothing to the input
      image data values, it just adds some surrounding points to it.

      The reference pixel is shifted as follows.   Let the input
      image size be XIN by YIN, and the output be XOUT by YOUT. The
      image is padded on the left by XLEFT = (XOUT - XIN) / 2  (integer
      arithmetic), and on the bottom by YBOTT = (YOUT - YIN) / 2. The
      right and top are naturally padded by enough to make the size up
      to XOUT and YOUT.   The reference pixel becomes:
                       XREF = XREF + XLEFT
                       YREF = YREF + YBOTT

      Example:  XIN = 10, YIN = 15, XOUT = 30, YOUT = 40

                XLEFT  = (30-10)/2  = 10, YBOTT = (40-15)/2  = 12
                XRIGHT = (30-10-10) = 10, YTOP  = (40-15-12) = 13
                XREF = XREF + 10,  YREF = YREF + 12

      You can of course pad one axis and not the other by specifying
      an output image size equal to the input image size for that axis.

Adverbs:
   INNAME........Input image name
   INCLASS.......Input image class
   INSEQ.........Input image seq. #
   INDISK........Input image disk drive #
   OUTNAME.......Output image name
   OUTCLASS......Output image class
   OUTSEQ........Output image seq. #
   OUTDISK.......Output image disk drive #
   IMSIZE........Output image size, no defaults
   CPARM.........C(1) = value to pad with
                 C(2) > 0 -> use magic blanks to pad image and
                             ignore C(1)
----------------------------------------------------------------
