; MODSP
;---------------------------------------------------------------
;! adds images of model objects to image cubes in I/V polarization
;# TASK ANALYSIS MODELING POLARIZATION
;-----------------------------------------------------------------------
;;  Copyright (C) 2014
;;  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
;-----------------------------------------------------------------------
MODSP     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
MODSP     Task to alter I/V or RR/LL images adding models
INNAME                             Input I image name (name).
INCLASS                            Input I image name (class).
INSEQ             0.0     9999.0   Input I image name (seq. #).
INDISK            0.0        9.0   Input I image disk unit #.
IN2NAME                            Input V image name (name).
IN2CLASS                           Input V image name (class).
IN2SEQ            0.0     9999.0   Input V image name (seq. #).
IN2DISK           0.0        9.0   Input V image disk unit #.
OUTNAME                            Output image name (name).
OUTSEQ           -1.0     9999.0   Output image name (seq. #).
OUTDISK           0.0        9.0   Output image disk unit #.
BLC                                Bottom left corner of input.
TRC                                Top right corner of input.
FLUX                               Noise level to add
FACTOR                             Multiplication factor.
INLIST                             List of sources up to 9999
                New image parameters:
COORDINA                           Ra, Dec coordinates
IMSIZE                             Ra, Dec number of pixels
CELLSIZE                           Ra, Dec increments in asec
APARM                              (1) Frequency (GHz) plane 1
                                   (2) increment (GHz)
                                   (3) number channels
----------------------------------------------------------------
MODSP
Type: TASK
Use: This task can be used to modify a pair of existing image cubes of
     either I/V or RR/LL polarization or create new ones.  The idea is
     to make spectral-line image cubes with or without RR/LL
     differences.
Adverbs:
  INNAME.....Input I or RR image name (name).     No default.
  INCLASS....Input I or RR image name (class).    Standard defaults.
  INSEQ......Input I or RR image name (seq. #).   0 => highest.
  INDISK.....Disk drive # of input I or RR image. 0 => any.
  IN2NAME....Input V or LL image name (name).     No default.
  IN2CLASS...Input V or LL image name (class).    Standard defaults.
  IN2SEQ.....Input V or LL image name (seq. #).   0 => highest.
  IN3DISK....Disk drive # of input Q image. 0 => any.
  OUTNAME....Output image name (name).    Standard defaults.
             Outclasses are IMODEL, QMODEL, and UMODEL
  OUTSEQ.....Output image name (seq. #).  0 => highest unique.
  OUTDISK....Disk drive # of output image.  0 => highest
             number with sufficient space.
  BLC........Bottom right corner in input image of desired
             subimage.  Default is entire image.
  TRC........Top right corner in input image of desired
             subimage.  Default is entire image.
  FLUX.......Noise level to be added (in the units of the image)
  FACTOR.....Factor by which the original data is multiplied
             before it is added to the model.  0 => drop original
             data.
  INLIST.....Text file containing one line per source, giving

             RR, LL, X, Y, Maj, Min, PA, type, line center, width,
             Dlc/Dx, Dlc/Dy, Dw/Dx, Dw/Dy

             blank separated free format and trailing zeros FOLLOWING
             WIDTH may be omitted.  The resulting NGAUS will be the
             number of non-comment lines in INLIST.  Limit 9999.

             (1) The RR and LL brightness is in Jy/beam;
             (2) The component coordinates and size are X, Y, Maj
                 and Min are in pixels, PA in degrees;
             (3) Types are point, Gaussian, uniform disk, uniform
                 rectangle, optically thin sphere, and exponential for
                 code numbers 1 through 6.  Other values -> 2.
             (4) line center and width of line (FWHM) are in channels
             (5) line center and width may vary linearly in x and y
                 away from the stated values away from the component
                 center in channels/pixel

             Blank lines and lines beginning with # or ; (semi-colon)
             are taken as comments

        If making a new image (INNAME blank with I polarization or
        INNAME and/or IN2NAME and/or IN3NAME blank with I, Q, U) use
  COORDINA...RA (hours minutes seconds of time), declination (degrees,
             minutes, seconds of arc) for reference pixel (at image
             center).
  IMSIZE.....X, Y image size in pixels
  CELLSIZE...X, Y image spacing in arc sec
  APARM......(1) Reference frequency at first output plane in GHz
             (2) Increment in frequency in GHz
             (3) Number of frequency pixels
----------------------------------------------------------------
