; COWINDOW
;---------------------------------------------------------------
;! Set a window based on coordinates
;# VERB COORDINATES
;-----------------------------------------------------------------------
;;  Copyright (C) 1997, 2000, 2003
;;  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
;-----------------------------------------------------------------------
COWINDOW  LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
COWINDOW:  Verb to set window centered on a coordinate
          Input adverbs
USERID     -32000.0     32000.0    User ID. 0=>current user
                                     32000=>all users
INNAME                             Image name(name).
INCLASS                            Image name(class).
INSEQ           0.0      9999.0    Image name(seq. #). 0=>high
INDISK          0.0         9.0    Disk drive #. 0=>any
COORDINA                           Coordinate in image
IMSIZE          0.0      8192.0    X,Y size to include
                                     0=>entire centered image
         @Output adverbs
BLC      @    0.0         4096.0   Pixel location (X,Y,...) in
         @                         image of lower left corner.
TRC      @    0.0         4096.0   Pixel location (X,Y,...) in
         @                         image of upper right corner.
----------------------------------------------------------------
COWINDOW
Type:  verb
Use:   To set values in the adverbs BLC and TRC so that a subarray of an
       image centered on a particular X,Y coordinate will be selected.
Input adverbs:
  USERID.....User ID of owner of image.  0 => current user,
                32000 => any user.
  INNAME.....Image name(name).   Standard defaults.
  INCLASS....Image name(class).  Standard defaults.
  INSEQ......Image name(seq. #).  0 => highest.
  INDISK.....Disk drive # of image.  0 => any.
  COORDINA...The X and Y coordinates are found as:
             Xpos = abs(CO(1)) + abs(CO(2))/60 + abs(CO(3))/3600
                if any of CO(1), CO(2), CO(3) < 0: Xpos = -Xpos
             Ypos = abs(CO(4)) + abs(CO(5))/60 + abs(CO(6))/3600
                if any of CO(4), CO(5), CO(6) < 0: Ypos = -Ypos
             Note that, although these are most suited to RA, Dec in
             sexagesimal notation, they can be used for any type of
             coordinate.  The units are standard FITS units (e.g
             degrees, m/sec, Hz, sec, etc.) except that right
             ascensions are in hours of time.
  IMSIZE.....Maximum size of image to select in X and Y.  The image will
             be centered on the coordinate so the actual IMSIZE(i) used
             will be the lesser of IMSIZE(i) and the distance in the
             i'th coordinate to the nearer edge of the image.  Note
             that an even value of IMSIZE(i) cannot be centered upon a
             pixel, so IMSIZE(i)+1 is used.
             0 -> 16384 (i.e. use the nearest edge size).
Input/Output adverbs
  BLC........Bottom left corner of set window in pixel coordinates; only
             the first two values are changed.  BLC(3)-BLC(7) are used
             to set the depth into the image which may  affect the
             first two coordinate values.
Output adverbs:
  TRC........Upper right corner of set window in pixel coordinates; only
             the first two values are changed.
----------------------------------------------------------------
