; OGEOM
;---------------------------------------------------------------
;! Simple image rotation, scaling, and translation
;# Task IMAGE-UTIL OOP
;-----------------------------------------------------------------------
;;  Copyright (C) 1996, 2005
;;  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
;-----------------------------------------------------------------------
OGEOM     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
OGEOM: Interpolate an image to the geometry of another.
                                   Input image
INNAME                                Image name (name)
INCLASS                               Image name (class)
INSEQ              0.0      9999.0    Image name (seq. #)
INDISK             0.0         9.0    Image disk drive #
                                   Output image
OUTNAME                               Image name (name)
OUTCLASS                              Image name (class)
OUTSEQ            -1.0      9999.0    Image name (seq. #)
OUTDISK            0.0         9.0    Image disk drive #
BLC             0.0      4096.0    Bottom left corner of image
                                     0=>entire image
TRC             0.0      4096.0    Top right corner of image
                                     0=>entire image
IMSIZE          0.0      4096.0    Output image size in pixels
REWEIGHT        0.0         4.0    (1) Interpolation halfwidth
                                   (2) Minimum fraction of good
                                       pixels required (0->1/3)
APARM                              (1)=Delta X in pixels
                                   (2)=Delta Y in pixels
                                   (3)=rotate(deg)
                                   (4)=scale,
                                   (5)=diff.scale
                                   (6)=shift X coordinates : ???
                                   (7)=shift Y coordinates : ???
----------------------------------------------------------------
OGEOM
Type: Task
Use: OGEOM does an interpolation of an image to a rotated, shifted, and
     scaled output image.  It is assumed that the image geometry is
     linear for these purposes.  Use OHGEO for larger fields.

     Interpolation is done only in the first 2 dimensions.  Unlike
     LGEOM, OGEOM will interpolate over blanked pixels so that it can
     fill in small blanked regions and handle edges without having to
     discard image area.
     NOTE: the input subimage is read into dynamically allocated memory.
     Very large input arrays may cause swapping on your computer.

     This task does a straightforward interpolation from the input to
     the output image grid.  This process cannot be completely
     accurate if, for example, one shifts and scales an image and
     then reverses that process.  Greater accuracy will be achieved on
     images with more points per beam and with larger support sizes
     for the interpolator.
Adverbs:
  INNAME......The input image name.   Standard defaults.
  INCLASS.....The input image class.  Standard defaults.
  INSEQ.......The input image sequence number. 0 => high
  INDISK......The input image disk drive no. 0 => any
  OUTNAME.....The output image name.  blank => Standard
              defaults based on INNAME.
  OUTCLASS....The output image class.  Standard behavior.
  OUTSEQ......The output image seq. no., 0=> highest unique
              If >0; image will be created if new, overwritten if image
              name exists.
  OUTDISK.....Output disk drive no., 0=> highest with space
  BLC.........The bottom left-hand pixel of the input image which
              becomes the bottom left corner of the input subimage.  The
              value (0,0) means (1,1).
  TRC.........The top right-hand pixel of the input image which becomes
              the top right corner of the subimage.  The value (0,0)
              means take the top right hand corner of the image.
  IMSIZE......Output image size in pixels [1=columns, 2=rows].  Default
              is the input image size.
  REWEIGHT....Interpolation kernal parameters:
              (1) Half width of the interpolating kernel
                  (1 - 4).  Default = 1
                  Larger support sizes should produce more accurate
                  results at the cost of increased computation.
              (2) Minimum fraction of pixels in interpolation kernal
                  area required for non-blanked output.
                  <= 0 or >= 1  => 0.333
  APARM.......Transformation parameters:
              1 & 2 = shift of coordinate reference point, expressed in
                  output pixels, for x & y relative to the center of the
                  subimage.  Positive moves objects to the right and up
                  relative to center pixel.
              3 = rotation in degrees (positive moves objects
                  counterclockwise relative to the image center as they
                  map from input image to output image).
              4 = scale factor (greater than one moves objects outward
                  from the image center as they map from input to
                  output).
              5 = 'differential scale'; this is an extra scale factor
                  applied to the y-axis AFTER the main transformation
                  has been done. This is useful to make spiral galaxies
                  appear face-on. Also, if it is negated the result is a
                  mirror-reflection in the y-axis.
              6 & 7 = Coordinate shift in X and Y in arc seconds.  The
                  measured right ascension and declination of objects
                  will change.  Positive increases the RA and Dec. if
                  the image has the normal orientation (RA increasing to
                  the left, Dec. increasing upwards, no rotation).  Note
                  that this option corrects the shift for the cos of the
                  latitude which only works correctly when there are no
                  rotations.  THIS OPTION DESTROYS THE COORDINATES YOU
                  WENT TO A LOT OF TROUBLE TO MEASURE.  Use it only in
                  dire straights.
----------------------------------------------------------------
