; UTESS
;---------------------------------------------------------------
;! deconvolves images by maximizing emptiness
;# TASK IMAGING
;-----------------------------------------------------------------------
;;  Copyright (C) 1995-1996, 2002-2003, 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
;-----------------------------------------------------------------------
UTESS     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
UTESS :  Task which deconvolves images by maximising emptiness
                                   Dirty image
INNAME                                Image name (name)
INCLASS                               Image name (class)
INSEQ              0.0      9999.0    Image name (seq. #)
INDISK                                Image disk drive #
                                   Beam image
IN2NAME                               Image name (name)
IN2CLASS                              Image name (class)
IN2SEQ            -1.0      9999.0    Image name (seq. #)
IN2DISK                               Image disk drive #
                                   Default level image
IN3NAME                               Image name (name)
IN3CLASS                              Image name (class)
IN3SEQ            -1.0      9999.0    Image name (seq. #)
IN3DISK                               Image disk drive #
                                   Output UTESS image
OUTNAME                               Image name (name)
OUTCLASS                              Image name (class)
OUTSEQ            -1.0      9999.0    Image name (seq. #)
OUTDISK                               Image disk drive #
                                   Restored image
OUT2NAME                              Image name (name)
OUT2CLAS                              Image name (class)
OUT2SEQ           -1.0      9999.0    Image name (seq. #)
OUT2DISK                              Image disk drive #

NMAPS              1.0      4087.0 Number of maps to deconvolve
NITER    *                         Maximum # of iterations
NOISE    *         0.0             Required residual, units are
         *                         (Jy/BEAM)
FLUX                               Zero spacing Flux (Jy)
BLC                0.0        4096 Bottom left corner of UTESS
TRC                0.0        4096 Top right corner of UTESS
DOTV     *        -1.0         2.0 TV display of UTESS image ?
PRTLEV   *        -1.0         1.0 Lots of messages ?
PBSIZE                             PB FWHM in arcseconds CHANGED
                                   < 0 - no PB correction
                                         single dish images.
                                   = 0 - use PBPARM
                                   > 0 - use Gaussian
BMAJ                               FWHM (asec) Convolving beam
BMIN                               FWHM (asec) Convolving beam
BPA                                PA (degrees) Convolving beam
PBPARM                             Beam parameters:
                                   (1) Cutoff 0 -> 0.07
                                   (2) > 0 -> Use (3)-(7)
                                   (3)-(7) Beam shape
BADDISK                            Disks to avoid for scratch.
----------------------------------------------------------------
UTESS
Type: Task
Use:  UTESS performs a non-linear deconvolution of dirty beams from
      dirty images by maximising emptiness.  It is specially designed
      for different types of images which have been interpolated to
      the same grid.  It can combine single dish and interferometer
      images ! It will also now add residuals a la CLEAN. Unlike
      VTESS, UTESS does not constrain the image to be positive and
      can, therefore be used to deconvolve polarization maps or
      spectral-line absorbtion maps.
Adverbs:
  INNAME......The dirty image name.      Standard defaults.
  INCLASS.....The dirty image class.     Standard defaults.
  INSEQ.......The dirty image seq. #.    0 => highest.
                 If NMAPS > 1 then images having sequence
                 numbers INSEQ,INSEQ+1,...,INSEQ+NMAPS-1 are
                 operated on.
  INDISK......The dirty image disk drive #. 0 => any.
  IN2NAME.....The beam image name.  blank => INNAME,
              otherwise standard behavior.
  IN2CLASS....The beam image class.      Standard behavior
              except blank => 'RBEAM' if INCLASS = 'RMAP'
                              'LBEAM' if INCLASS = 'LMAP'
                              'IBEAM' if INCLASS = anything
                                 else
  IN2SEQ......The beam image seq . #.       0 => INSEQ,
              use -1 to get highest.
                 If NMAPS > 1 then images having sequence
                 numbers INSEQ,INSEQ+1,...,INSEQ+NMAPS-1 are
                 operated on.
  IN2DISK.....The beam image disk drive #.  0 => any.
  ******** If a default image is not specified completely, then
           a flat default will be used. Usually the flat
           default will work satisfactorily. *********
  IN3NAME.....The default image name.       Standard defaults.
              except blank => use flat default.
  IN3CLASS....The default image class.      Standard defaults.
              except blank => use flat default.
  IN3SEQ......The default image seq. #.     0 => use flat
              default, set IN3SEQ to -1 to get highest.
  IN3DISK.....The default image disk drive #.  0 => use flat
              default.
  OUTNAME.....The UTESS image name.   Standard defaults.
  OUTCLASS....The UTESS image class.  Standard behavior with
              default = 'xUT' if INCLASS = 'xMAP', where x is
                           any character
                        'UT' if INCLASS = anything else
  OUTSEQ......The UTESS image seq. #.  0 => highest unique.
              If >0; image will be created if new,
              overwritten if image name exists.
  OUTDISK.....The UTESS disk drive no. 0 => highest with space
  OUT2NAME....The convolved image name.       Standard defaults.
  OUT2CLAS....The convolved image class.  Standard behavior with
              default = 'xUTC' if INCLASS = 'xMAP'
                        'UTC' if INCLASS = anything else
  OUT2SEQ.....The convolved image seq. #.  0 => highest unique.
              If >0; image will be created if new,
              overwritten if image name exists.
  OUT2DISK....The UTESS disk drive no. 0 => highest with space
  NMAPS.......Number of maps to be deconvolved. Must be in
              sequence starting at INSEQ.
  NITER.......UTESS iteration limit.  0 => 5. If less than
              Zero then will go to ABS(NITER) iterations
              or stop at soluton, else increase accuracy of
              solution as iteration proceeds.
              Can be changed by TELL.
  NOISE.......The target R.M.S. residuals for each image are
              ERROR (Jy/beam). Note this controls the
              quality of the final UTESS image. UTESS tries to
              get fit to be less than 1.05 SIGMA.
              Can be changed by TELL.
              NOISE(64) is used for all fields > 64.
              The first value should correspond to the only single
              dish image. Although it is put on the last (NMAPS) place
              The other values correspond to the interferometric
              images (the second=>the first image;
              the third=>the second.....
  FLUX........Zerospacing of the UTESS image. Three cases :
              a. > 0 = >UTESS tries to get within 5% of FLUX
              b. = 0 => UTESS estimates it. Often does well.
              c. < 0 => UTESS estimates it using ABS(FLUX) as
                an initial guess (better than putting zero)
  BLC.........Bottom left corner of UTESS image, BLC(3) gives
              the channel number to deconvolve.
  TRC.........Top right corner of image; both BLC and TRC
              default do that the inner quarter is chosen.
  DOTV........Display UTESS map on TV channel 1. >= 0 => yes.
              If true, you may stop the UTESSing with TV button
              D after each map is displayed. To see residual
              image set DOTV = 2.   Can be changed by TELL.
  PRTLEV......Print lots of informative messages ? > 0 => yes.
              Can be changed by TELL.
  PBSIZE......Size of primary beam in arcsec, FWHM of Gaussian model.
              One number per field.
              If = 0, use PBPARM beam with defaults suitable to the
                      VLA.
              If < 0, do no primary beam correction, e.g. for fields
                      that are not interferometer data.
              If > 0, use a Gaussian of FWHM of PBSIZE(I).
              PBSIZE(64) is used for fields > 64.
              The first value (-1) should correspond to the only
              single dish image. Although it is put on the last (NMAPS)
              place. The other values correspond to the interferometric
              images (the second=>the first image;
              the third=>the second.....
  BMAJ........FWHM in arcseconds of the restoring beam. The final
              image is convolved with this beam, and the residuals
              are added to form a pseudo-CLEAN image. If BMAJ < 0.0
              then no restoration if performed. If BMAJ = 0.0 then
              the beam is fitted to obtain BMAJ, BMIN, BPA.
  BMIN........FWHM in arcseconds of the minor axis of the
              restoring beam.
  BPA.........Position angle in degrees of the restoring beam.
  PBPARM......Primary beam parameters:
              (1) Lowest beam value to believe: 0 -> 0.07  Sources
                  outside this range are ignored.
              (2) > 0 => Use beam parameters from PBPARM(3)-PBPARM(7)
                  Otherwise use default parameters for the VLA (or
                  ATCA where appropriate)
              (3-7)..For all wavelengths, the beam is described by the
                function:
                   1.0 + X*PBPARM(3)/(10**3) + X*X*PBPARM(4)/(10**7) +
                   X*X*X*PBPARM(5)/(10**10) + X*X*X*X*PBPARM(6)/(10**13)
                   X*X*X*X*X*PBPARM(7)/(10**16)
                where X is (distance from the pointing position in arc
                minutes times the frequency in GHz)**2.  For the VLA,
                these parms are, by default, given by Perley's fits:
                      0.0738 GHz  -0.897  2.71   -0.242
                      0.3275      -0.935  3.23   -0.378
                      1.465       -1.343  6.579  -1.186
                      4.885       -1.372  6.940  -1.309
                      8.435       -1.306  6.253  -1.100
                     14.965       -1.305  6.155  -1.030
                     22.485       -1.417  7.332  -1.352
                     43.315       -1.321  6.185  -0.983
                For the ATCA, these are by default:
                  1.5 GHz  -1.049   4.238  -0.8473  0.09073  -5.004E-3
                  2.35     -0.9942  3.932  -0.7772  0.08239  -4.429E-3
                  5.5      -1.075   4.651  -1.035   0.12274  -6.125E-3
                  8.6      -0.9778  3.875  -0.8068  0.09414  -5.841E-3
                  20.5     -0.9579  3.228  -0.3807  0.0       0.0
                See explain for details
  BADDISK.....This array contains the numbers of disks on which
              it is desired that scratch files not be located.
              BADDISK has no effect on input and output maps.
----------------------------------------------------------------
UTESS :  Task which deconvolves sets of images
DOCUMENTOR: T.J.Cornwell NRAO/VLA
DATE OF DOCUMENTATION: 30 Nov 1987
RELATED PROGRAMS: UVMAP,VM,APCLN,MX,APVC,STESS,LTESS
VERSION: 15JAN88

                      PURPOSE

     UTESS is a variant of VM designed to handle the deconvolution of
different types of images. It can handle up to 4087 different dirty
images and beams which have been calculated on the same size grid.
Both interferometric and focal plane images can be treated, and for
the former, primary beam attenuation can be corrected.
     UTESS performs a deconvolution of the dirty beam from the dirty
map by the Maximum Entropy Method MEM. There are, in general, many
solutions to the deconvolution problem; of these UTESS selects the
solution having the greatest entropy:

 H = Sum over all pixels ( h(pixel Brightness))

where h has the form : - f*log(f/m) where m is the default brightness
and f is the pixel brightness. This measures the lack of dispersion in
pixel values and thus the maps tend to be smooth in this sense. Given
no data the output image is just the default image. There are other
justifications for maximising H but these are not widely accepted. The
pragmatic view is that UTESS maps of extended emission seem to be more
aesthetically pleasing than those produced by the CLEAN deconvolution
algorithm. In particular, CLEAN maps of large sources seem to show a
mottled structure, which is caused by the assumptions inherent in the
CLEAN algorithm, and which is not present on the corresponding UTESS
maps. UTESS may run faster than APCLN on images spanning many
(>100,000) resolution elements.
     There are several undesirable features of UTESS maps of which the
user should be aware. First, the response to a point source in the map
is manifestly signal-to-noise dependent, the resolution decreasing
with signal strength. To some extent this can be masked by convolving
with a beam of known resolution as is done in the CLEAN algorithm. The
consequence is that comparison with other maps is difficult. Secondly,
the map is totally positive and biased. A map will always show some
emission in nominally blank regions but this background will be very
flat if FLUX has been chosen correctly. This bias is negligible on
regions of emission which are much brighter than the noise level.
Thus, the map is mainly useful for qualitative information unless it
is convolved down to lower resolution. On the other hand, the images
may often be superior in quality to CLEAN images and may take less CPU
time to compute. This is especially true for large images where the
sidelobe level is quite low e.g. rms less than 1%. Quite often UTESS
produces the most useful image.
     UTESS actually maximises H subject to the constraints that the
r.m.s. residual be equal to one sigma ( using the Lagrange Multiplier
ALPHA ) and that the total flux be FLUX ( using the multiplier BETA ).
For the maximisation of the objective function a modified
Newton-Raphson approach is used. Non-diagonal elements of the Hessian
matrix are neglected.  For one input image, each step or iteration
requires two 2-D FFTs and so is roughly equivalent to one major cycle
of APCLN.  The cost of extra fields is roughly proportional.
     This is an experimental program and so all feedback is welcome.
Send any comments, abusive or complimentary, to Tim Cornwell at the
Array Operations Center.

                     COMMENTS

MAPUNITS :
     The final units of the map are Jansky per pixel. If you prefer
other units of brightness such as Kelvin then AXDEFINE can be used to
change the header.
     To obtain an image which can be compared with the CLEAN image set
BMAJ >= 0.0. If BMAJ = 0.0 then a fit will be made to the dirty beam
to find a suitable CLEAN beam, otherwise the specified beam will be
used. This restored image will come out as OUT2NAME.OUT2CLAS.OUT2SEQ
on dish OUT2DISK.

ALIASING :
     To overcome aliasing problems, which can be disastrous in an
algorithm which enforces positivity, only a quarter of the map is
allowed to be non-zero. BLC and TRC control the location of the
quarter within the dirty image. The default is such that the inner
quarter is choosen. If TRC is more than half an axis length from BLC
then it will be truncated.

CONVERGENCE :
     For maps of reasonable signal to noise 100 - 1000 about
15 - 30 iterations are needed.
     An automatic stopping criterion is included. It stops if:

        1. NITER < 0
        2. ABS(total flux-FLUX) < 0.05*FLUX
             *** only if FLUX > 0 ***
        3. rms residual < 1 sigma

     This criterion has developed by trial and error, and has
no real theoretical justification. It may be too optimistic in
that the image is still changing significantly. If you believe
this to be the case then restart with NITER > 0 and stop by
hand. Note however that the minimum brightness is poorly
defined and has little meaning so don't worry too much about
it.
     Some combinations of inputs parameters will not allow a
UTESS image. For example, in nearly all cases there is no
positive image  with the correct flux (FLUX) which fits the
data exactly (NOISE=0.0). However if you set FLUX too large
then an exact fit can be achieved.

DEFAULT IMAGE :
*************************************************************
     NORMALLY YOU CAN IGNORE THIS POSSIBILITY BY LEAVING
IN3NAME,IN3CLASS,IN3SEQ,IN3DISK blank.
*************************************************************
     The default image determines what the image looks like if
there is no data. Any data cause perturbations away from this
image. The default "default" image is flat and so UTESS tries
to make the output image as flat as is allowed by the data. An
non-flat default is helpful in cases where a flat
default fails. An example is the deconvolution of an image
containing a point source in rather diffuse extended emission.
Plain UTESS will usually leave the sidelobes of the point
source buried in the diffuse emission. A default level of a
point source in an extended Gaussian may well help.
Another useful mode is to use a low resolution image as the
default. Failing such an image, the following procedure gives
good results : run to convergence with a flat default, use
CONVL to smear out the resulting image (FACTOR=1 to
preserve units of Jy/Pixel), then use this smeared image as
the default and run to convergence. The resulting image has
less bias and suppresses low level noise well.
     A default image can be generated using the task IMMOD.
This is useful for planets, the Sun etc. Note that the units

are Jy/pixel.

MOSAICING or TESSELATION :
     One of the most important features of UTESS is its
ability to form mosaics of a large object spanning many
pointing centers. For example, at 20cm, this allows imaging
of objects larger than the size of the primary beam (30').
When observing, you must take data at many different
pointing centers. UTESS will then joint them smoooothly.
It knows about the VLA primary beam, and uses a model
due to Rots and Napier, truncated at the 5% level.
     Furthermore, singe dish data can be introduced to give
the short spacing information missing from the interferometer
data.
     Interferometric data can be corrected for the primary
beam pattern. At the moment, the I'th field is corrected for a
circular Gaussian of FWHM PBSIZE(I) arcsec centered on the
pointing center or, if TELESCOPE='VLA' in the
image header then a model of the VLA primary beam is used.
Use PUTH with KEYWORD='TELESCOPE', KEYSTR='VLA' to put this
in the header if necessary. If PBSIZE(I)=0.0 then
no correction is performed. If PBSIZE(I)<0.0 then that
field is assumed to refer to a focal plane image such as
that measured by an optical telescope or a single dish.
     The pointing center is specified in the header by the
Keywords 'OBSRA', 'OBSDEC'. It will only show up in
IMHEADER if it is different from the phase tracking center.
UTESS will report the values of the pointing center used
after conversion to pixels.
     The related program STESS will make an image of the
sensitivity function for a mosaic. This is the sum of
the primary beams, each weighted by the appropriate
inverse variance (i.e. NOISE(I)**-2). Once you have
set up the parameters for UTESS in mosaicing mode, it is
a good idea to run STESS and look at the sensitivity
image. It should be fairly smooth and uniform, except
for the effects of the cutoff in the primary beam model.
     Sky-curvature effects will be important in some
circumstances and will hinder the use of UTESS. For
20cm and shorter in the C and D configurations, you
can usually get away with mapping each primary beam
separately. The procedure is:
     1. Observe at the requisite number of pointing
centers, spaced every HWHM (e.g. 15 arcmin at 20cm).
     2. Calibrate, edit each field separately.
     3. Run UVMAP on each field separately WITHOUT
any phase shifts. The size of each field must be double
the full primary beam size (e.g. 512**2 with 15" cellsize
is fine for 20cm D-array).
     4. Choose one centrally-located field as the center
of the coordinate system to be used. Pad the map and beam
for this field up to twice the maximum field of view. The
task PADIM does this nicely. This resulting image is the
reference field image.
     5. Put all the other images onto the same grid.
HGEOM is very convenient for this: put the reference field
image in slot two, and the image to be converted into
slot one.
     6. Pad the beams out to the required size. Really
you should do step 5 on each beam but the shift will
come out incorrectly then.
     7. Set up the parameters for UTESS, and then
run STESS to check the sensitivity function.
     8. Run UTESS!

RESTARTING :
     UTESS can be restarted by simply filling in OUTNAME,
OUTCLASS and OUTSEQ with the parameters of a map. NITER
must, of course, be larger than the previous stopping point.
Unlike CLEAN one can start from any initial estimate, hence
it is efficient to keep iterating on the same image while
changing the input dirty map by selfcalibration or by data
editting. Similarly any of the control parameters may be
changed in flight.
     UTESS writes the current image to the output file every
iteration so that if it crashs, simply clear the write status
and start from that iteration. If it crashs while writing the
output image then tough luck, you will have to start again.
     Between iterations the values of ALPHA and BETA are
stored in REAL*4 words 127 and 128 of the Catalog header.

NOISE :
     One crucial control parameter is NOISE. This determines
the level of fit attempted. It should be comparable to the
r.m.s. noise level in a blank region of a CLEAN map thus if
the data is reasonably well-calibrated this will be close to
the theoretical noise level. Specifying too large a number
will lead to an overly smooth map. Too small a number will
prevent convergence since there will be no positive map which
fits the data to that level. A useful strategy is to initially
underestimate NOISE and then stop after a number of
iterations and reset it to the level acheived up to that
point.

FLUX :
     FLUX specifies how the zero spacing flux is to be
estimated.  There are three cases :
     a. You specify a known or guessed value which must be fit
to within 5%. Set FLUX to a positive number. This is quite
important on weak sources since after accounting for all the
power in the source UTESS will put power into the sidelobes thus
biasing the total flux by a large amount and overfitting to
the other visibility samples.
     b. If you have no idea what the zero spacing flux is
then leave FLUX = 0.0. UTESS will attempt to estimate it.
     c. If you have a rough idea (within a factor of 2 say)
then set FLUX to the negative of your guess e.g. FLUX=-2.0
UTESS will then do a reasonable job of estimating the true
value.

GENERAL TIPS :
     If the gradient starts to increase dramatically
after a number of iterations then the problem that you have
given is probably too difficult. Stop and reconsider the
input parameters; in particular, NOISE and FLUX. Usually
setting these too low will cause problems.
     Point sources often cause problems so it is a good
idea to remove them using CLEAN. If you set BMAJ to -1 and put
BOXs around the points then the output image will be the dirty
image minus the point sources. Then put this image into the
slot for the dirty image.
     Preconvolving the dirty image with a CLEAN beam will
usually improve the quality of the result and "fix" the
resolution to be that of the CLEAN beam. Convergence is also
improved.
     Over-sampling of the image plane will slow UTESS so
restrict the number of points per beam to less than about
7 or 8.

OPTICAL DATA :
     UTESS can be used to deconvolve optical images. The main
difference from interferometric images is that the noise is
independent in the image plane; it assumes that the image is
not photon limited i.e. it uses a chi-squared test between the
convolved image and the dirty map. You will need a dirty
beam to put into IN2NAME,IN2CLASS,IN2SEQ,IN2DISK. There are at
least three ways to do this :

     1. Guess a simple Gaussian form and use IMMOD to generate
an image containing it.
     2. Use IMFIT to fit an number of Gaussians to a star in the
field. Then use IMFIT as in 1.
     3. Cut a star out from the field using COMB then use GEOM
to edge it out to the full size with zeroes.

     UTESS has two different units that it works with : Jy/beam
and Jy/pixel. If the beam volume is normalised to unity then
these are the same; if the beam peak is normalised to unity
then they differ by the number of pixels per beam. In radio
interferometry the latter is the usual convention but in
optical work the former will be more convenient so I recommend
that you normalise the dirty beam by it's volume and put
NPOINTS = 1.
     For optical data, PBSIZE for that field must be set to a
negative number.

BMAJ,BMIN,BPA:
     If BMAJ > 0.0 then a CLEAN-type image is formed by convolving
the output image with an elliptical Gaussian and adding the residuals.
If the program is mosaicing then the residuals are linearly corrected
for the primary beams before this addition. The units of the final
restored image are JY/BEAM. Agreement with a CLEAN image will be
generally good, but UTESS will slightly underestimate the peaks and
will give a smoother restoration. If mosaicing, then the UTESS image
will contain significantly more extended emission.

EXECUTION TIMES :
     Typical CPU time for running UTESS in an otherwise empty
VAX 11/780 with FPS120B array processor is:

          128 x 128       0.20  min/iter/field
          256 x 256       0.53  min/iter/field
          512 x 512       1.9   min/iter/field
          1024 x 1024     7.2   min/iter/field
          2048 x 2048    28.5   min/iter/field

     Typical CPU time for running UTESS in an otherwise empty
CONVEX C-1 is:

          128 x 128       0.02  min/iter/field
          256 x 256       0.1   min/iter/field
          512 x 512       0.4   min/iter/field
          1024 x 1024     1.6   min/iter/field
          2048 x 2048     6.4   min/iter/field

Wall clock times will be at least two to three times these
numbers. If the map is mainly filled by emission then the
APCLN runtimes will be comparable to these.

DISK SPACE :
     The amount of scratch disk space allocated for the
following image sizes is :

                        Radio data       Optical data
       256 x 256       2176 blocks        5376 blocks
       512 x 512       8704 blocks       21504 blocks
       1024 x 1024    34816 blocks       86016 blocks
       2048 x 2048   139264 blocks      344064 blocks
         NX x NY    4.25*NX*NY/128     10.5*NX*NY/128

                      REFERENCES

Cornwell T.J., and Evans K.F., "A simple Maximum Entropy
deconvolution algorithm", Astronomy and Astrophysics, (1985)

Burch,S.F, Gull,S.F., and Skilling,J., "Image restoration by a
powerful Maximum Entropy method", Computer Vision, Graphics and
Image processing, 23, 113-128 (1983).

              --------------------------------

The function used to model the primary beam for normal VLA frequencies

            F(x) =  1.0
                   + parm(1) * 10E-3  * x
                   + parm(2) * 10E-7  * x*x
                   + parm(3) * 10E-10 * x*x*x
                   + parm(4) * 10E-13 * x*x*x*x
                   + parm(5) * 10E-16 * x*x*x*x*x

where x is proportional to the square of the distance from the
pointing position in units of [arcmin * freq (GHz)]**2, and F(x)
is the multiplicative factor to divide into the image intensity at the
distance parameter x.  For other antennas, the user may read
in appropraite constants in DPARM(5) through DPARM(9).  The
flag, DPARM(4) must be set to a positive number to invoke this
option and DPARM(5) must not be zero.
     This correction scales with frequency and has a cutoff
beyond which the map values are set to an undefined pixel value GIVEN
IN DPARM(1).  At the VLA frequencies the default cutoff is
                 1.485 GHz     29.8  arcmin
                 4.885 GHz      9.13 arcmin
                15     GHz      2.95 arcmin
                22.5   GHz      1.97 arcmin
and occurs at a primary beam sensitivity of 2.3% of the value at
the beam center.  Corrections factors < 1 are forced to be 1.
The estimated error of the algorithm is about 0.02 in (1/F(x))
and thus leads to very large errors for x>1500, or at areas
outside of the primary response of 20%.  The cutoff level
may be specified with DPARM(1).

                 RICK PERLEY'S REPORT

	Polynomial Coefficients from LSq Fit to VLA Primary
	Beam raster scans.

	Functional form fitted:

		1 + G1.X^2 + G2.X^4 + G3.X^6

	where X = r.F,

	and 	r = radius in arcminutes
		F = frequency in GHz.

	Fits were made to 3% cutoff in power for 24 antennas.
Poor fits, and discrepant fits were discarded, and the most
consistent subset of antennas had their fitted coefficients
averaged to produce the following 'best' coefficients.


Freq.		G1		G2		G3
----------------------------------------------------------
1.285           -1.329E-3       6.445E-7        -1.146E-10  *
1.465           -1.343          6.579           -1.186 "
4.885           -1.372          6.940           -1.309
8.435           -1.306          6.253           -1.100
14.965          -1.305          6.155           -1.030
22.485 (old)    -1.350          6.526           -1.090      *
22.485 (new)    -1.417          7.332           -1.352
43.315          -1.321          6.185           -0.983
-----------------------------------------------------------

	The estimated errors (from the scatter in the fitted
coefficients) are generally very small:

	G1: .003 at all bands except Q (.014)
	G2: .03 to .07 at all bands except Q (.15)
	G3: .01 to .02 at all bands except Q (.04)

	R. Perley  21/Nov/00

* The 1.285 and 22.485 old feed values are not used.
