; CHKFC
;---------------------------------------------------------------
;! makes images of Clean boxes from Boxfile
;# Task Imaging
;-----------------------------------------------------------------------
;;  Copyright (C) 2001-2002, 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
;-----------------------------------------------------------------------
CHKFC     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CHKFC:  Makes images showing the fields and boxes in BOXFILE
OUTNAME                            Output Image name (name)
OUTSEQ            0.0    9999.0    Output Image name (seq. #)
OUTDISK           0.0       9.0    Disk drive #
BOXFILE                            disk file to read field locs
                                   and Clean boxes
COORDINA                           Center RA, Dec
CELLSIZE        0.0                (X,Y) size of grid in asec
IMSIZE          0.0      16384     field size
NFIELD          0.0       4096.    Number facets
RASHIFT                            New facet RA shift (asec)
DECSHIFT                           New facet Dec shift (asec)
NBOXES          0.0        50.0    Number Clean boxes
CLBOX          -2.0                Clean boxes: facet #1
DOBLANK        -1.0         1.0    > 0 Use blanks for unCleaned
DOWEDGE        -1.0         2.0    > 0 Add field number in boxes
----------------------------------------------------------------
CHKFC
Type:  Task
Use:   CHKFC reads an input BOXFILE which defines the fields for
       IMAGR.  It makes a set of images with 1's in the Clean windows
       and blanks or 0's outside the Clean windows.  It can take its
       inputs from adverbs instead of or in addition to the BOXFILE.
Adverbs:
  OUTNAME.....The output image name (name).    Standard defaults.
  OUTSEQ......The output image name (seq. #).  0 => highest.
  OUTDISK.....The output disk drive #.         0 => any.
  BOXFILE.....Input text file containing lines which specify the fields
              for the multi-field imaging.  This file should then be
              specified as the BOXFILE for IMAGR.
              ' ' => take all inputs from adverbs.
              Leading and trailing blanks from all lines in the text
              file are discarded, so "column 1" below means the first
              non-blank column in the card.
              This option is used to specify field parameters for
              fields 1 through NFIELD which are then copied to the
              fields used for additional resolutions (if any).  To
              specify a field's parameters, put the letter F or f in
              column 1 followed by the field number, the X and Y FLDSIZE
              values, the RASHIFT amd the DECSHIFT for the field
              (separated by blanks).  Any field specified in this way
              overrides the corresponding parameters given in the
              adverbs.  Thus,
              F  2  450 450 -25.5 6.7
              specifies that field 2 is to have a FLDSIZE of 450x450 with
              an RASHIFT of -25.6 and a DECSHIFT of 6.7 arcsec.  If this
              is the only F card in the file, then fields 1 and 3 through
              NFIELD are set by the adverb values.  As an alternative, a
              field may also be specified with a "coordinates" card
              having a C or c in column one.  After the C, give the field
              number, the X and Y FLDSIZE values and the center Right
              Ascension (HH MM SS.S) and Declination (signDD MM SS.S)
              separated by blanks.  Thus
              C  2  450 450  11 34 45.67 -00 14 23.1
              specifies that field 2 is to have a FLDSIZE of 450x450 with
              a center RA of 173.6902917 degrees and a center Declination
              of -0.23975 degrees.  All 9 numbers must be given; the sign
              is optional for positive declinations and is given only on
              the degrees term.

              To set Clean boxes, specify one box per line, as field
              blc-x blc-y trc-x trc-y (5 integers) e.g.
              1 200 205 220 222
              1 230 232 240 241
              2 100 100 130 121
              ...
              or circular "boxes" as
              field -1 radius center-x center-y  (5 ints) e.g.
              001  -1  10 210 214
              001  -1   5 235 237
             ....
              Column 1 must contain a numeric character (part of the
              field number); otherwise the line is treated as a some
              other sort of line.  Fields with no boxes specified
              default to the size specified by IMSIZE and FLDSIZE (see
              above and including FLDSIZEs read from this file).
  COORDINA....Center RA and Dec as HH, MM, SS.S, DD, MM, SS.S.  This
              is used only if the BOXFILE contains F cards which
              define fields by a shift from the reference COORDINA.
              There is no default in this case.  BOXFILEs that use C
              cards which define fields by their center coordinate do
              not use the value of this adverb.
  CELLSIZE....Pixel size for the fields in IMAGR in arc seconds.
  IMSIZE......Size of each field.
              If CELLSIZE and/or IMSIZE are zero, the data are read to
              find the maximum baseline and maximum W in order to
              estimate these parameters.
  NFIELD......The number of fields to map in the antenna beam. Up
              to 4096 are allowed.   Number used will be the max of
              NFIELD and the max field number in BOXFILE.
  RASHIFT.....New RA shift of the phase center of each field from the
              tangent point of the uv data in asec.  Map center =
              tangent point + shift. If X>0 shifts map center to east.
              NOTE: RASHIFT is a shift in RA scaled by cos (Dec_0) as
                  Ra_new(i) = RA_0 + RASHIFT(i) / cos (Dec_0)
              where _0 => the tangent point in the uv data.  This is a
              change for 15OCT99 from shifts in -SIN projection (which
              do not work for -NCP data and large angles).  If the UV
              data have been rotated then RASHIFT and DECSHIFT refer
              to X and Y in the new coordinate system.
              NFIELD values of RASHIFT will be used as initial values
              before BOXFILE is read - field centers in the file will
              override the RASHIFT values.
  DECSHIFT....Declination shift of map center from tangent point of
              each field in asec.  Map center = tangent point + shift.
              If Y>0 shifts map center to north.
              NFIELD values of DECSHIFT will be used as initial values
              before BOXFILE is read - field centers in the file will
              override the DECSHIFT values.
  NBOXES......Number (<=50) of rectangular or circular search boxes to
              search on the first field; the Clean windows in all
              other fields are given in BOXFILE.  If any boxes for
              field 1 appear in BOXFILE, NBOXES and CLBOX are ignored.
  CLBOX.......A 4x50 array with the parameters of each box.
              0 => use window specified in FLDSIZE.
              CLBOX(1,i)=-1 indicates a circle of radius CLBOX(2,i)
                 pixels centered on (CLBOX(3,i), CLBOX(4,i)).
              CLBOX(1,i) >= 0 indicates a rectangular box.
  DOBLANK.....True (> 0) => pixels outside Clean boxes are represented
              with magic-value blanks; otherwise 0's are used.  When
              FLATN is run, 0's are interpolated and averaged causing
              interesting but sometimes odd effects.  Blanks are
              usually better.
  DOWEDGE.....True (> 0) => insert the field number in all Clean
              windows that are large enough.  Image intensity 2 is
              used for window boundaries, 1 for Clean windows outside
              the numbers and 3 times this for numbers.  DOWEDGE 2
              telss the task to make the numbers rather larger (for
              TVLODs with TXINC and TYINC > 1).  Again FLATN's
              interpolation can do some odd things.
----------------------------------------------------------------
