; MFPRT
;---------------------------------------------------------------
;! prints MF tables in a format needed by modelling software
;# Task Table MODELING ANALYSIS
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 1999, 2002, 2004, 2008
;;  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
;-----------------------------------------------------------------------
MFPRT     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
MFPRT:  Task to print MF tables in modelling software format.
USERID      -32000.      32000.    Image owner ID number
INNAME                             Image name (name)
INCLASS                            Image name (class)
INSEQ             0.0    9999.0    Image name (seq. #)
INDISK            0.0       9.0    Disk drive #
INVERS            0.0              Start MF extension to list
IN2VER            0.0              Final MF extension to list
XINC              0.0   32767.     Increment between extensions
DOCRT            -3.0     132.0    If > 0, write to CRT
                                   > 72 => CRT line width
OUTPRINT
                                   Printer disk file to save
FLUX                               Flux level below which to
                                   ignore components.
                                   0 => accept all cpts
IMSIZE          0.0                Min, max allowed component
                                   size (asec.)
SORT                               Sort order: ' ' => '-F'
OPTYPE                             ' ' => basic list format
                                   'USER' => BOX sets cols
                                   'LIST' => source list format
                                   as for BOXES, SETFC, FACES
                                   'STAR' => STARS format
                                   'STDE' => STARS w deconvolved
DOHMS           -1.0         1.0   > 0 => coordinates displayed
                                   in sexagesimal
FORMAT          -1.0         3.0   = -1 => omit row numbers
CLEV                               STARS: >0 scale by flux/CLEV
SYMBOL                             STARS: symbol type
                                   < 0 => function of flux
BOX                                List of columns to be printed
                                   0 -> all.
----------------------------------------------------------------
MFPRT
Type:  Task
Use:   MFPRT prints on the line printer or terminal the rows of an MF
       extension file.  If the line width is too small to hold all
       columns, it will print as many as it can and then loop back to
       the beginning to print the next set of columns.  OPTYPE='STAR'
       and OPTYPE='STDE' print in the format used by task STARS to
       make an ST file to appear on image plots.  OPTYPE='LIST' allows
       you to print an MF table in the special format used for source
       lists by such tasks as SETFC, FACES, and BOXES.  The angular
       units are degrees, arc seconds, or milli arc seconds, depending
       on the cell size.  The flux scale is Jy or millJy in general.
Adverbs:
  USERID.....The user ID of the owner of the 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.
  INVERS.....First MF extension to list.  0 => 1.
             Enables the user to run through all available MF tables
             attached to a given file and list the values in one output
             file.
  IN2VER.....Last MF extension to list    < INVERS => to end.
  XINC.......Increment between MF extension files.     <= 0 => 1.
  DOCRT......False (<= 0) use the line printer if OUTPRINT = ' '
                   else write named OUTPRINT file only.
                   When OUTPRINT is not blank, DOCRT=-2 suppresses the
                   page-feed character on page headers and DOCRT=-3
                   suppresses page headers and most other header
                   information.
             True  (> 0) use the terminal interactively.  The task will
                   use the actual terminal width as a display limit
                   unless 72 < DOCRT < width.  In that case, the display
                   limit will be DOCRT characters.
  OUTPRINT...Disk file name in which to save the line printer output.
             ' ' => use scratch and print immediately for interactive
             jobs - batch jobs use OUTPRINT = 'PRTFIL:BATCHjjj.nnn'
             (jjj= job #, nnn = user #).  When OUTPRINT is not blank,
             multiple outputs are concatenated, and the file is not
             actually printed.
  FLUX.......Flux level below which to ignore components.  The column
             used is the total flux in I polarization, column 3.
             0 => accept all components.
  IMSIZE.....Minumum and maximum size allowed for components in arc
             seconds.  IMSIZE(2) <= 0 => accept all components.  If not
             given, then large, non-physical components may slip
             through.  The columns tested are the fit major and minor
             axis sizes, columns, 6 and 7.
  SORT.......Sort order to use: 'C', 'F', 'T', 'X', 'Y', 'J', 'N', 'P'
             for channel, peak flux, total flux, X position, Y
             position, major axis, minor axis, position angle.  Use
             '-C' etc for inverse order.  ' ' => '-F'
  OPTYPE.....'    ' yields two different outputs depending on whether
                the data have multiple spectral channels.  The multi-
                channel one may be forced with OPTYPE='LINE' and the
                continuum one may be forced with OPTYPE='CONT'.
             'USER' prints the columns specified in BOX like PRTAB but
                with more appropriate units.  See EXPLAIN for details.
             'LIST' causes the output to be in the format used by
                SETFC, BOXES and other tasks reading source lists.
                These tasks expect the flux column to be in milliJy
                but MFPRT may use microJy if the source total fluxes
                are all less than 1 Jy and the lowest included flux is
                less than 1 milliJy.  The source diameter column is
                the sqrt(Bmaj*Bmin) in arc sec and the format is
                RA,Dec,Flux,Width as F9.5,1X,F9.5,I7,F10.4.
             'STAR' causes the output to be in the format used by
                STARS: Ra, Dec (in sexagesimal), Major, Minor, PA,
                Type, label.  Size is fit size.
             'STDE' causes the output to be in the format used by
                STARS: Ra, Dec (in sexagesimal), Major, Minor, PA,
                Type, label.  Size is deconvolved size.
  DOHMS......> 0 => give full source positions in sexaigesimal format
                    (OPTYPE not LIST or STAR)
             <=0 => give source positions as offsets from the
                    reference in arc seconds (not LIST or STAR)
  FORMAT.....= -1 => omit row numbers.  Otherwise all OPTYPEs except
             'LIST', 'STAR', and 'STDE' will print the (sorted) row
             number with each row.
  CLEV.......> 0 => ('STAR', 'STDE' only) scale source sizes by total
                    flux divided by CLEV.
             <=0 => ('STAR', 'STDE' only) no scaling of source size
  SYMBOL.....Symbol type used for sources ('STAR' only)
             1: Plus sign           12: Five pointed star
             2: Cross (X)           13: Star of David
             3: Circle              14: Seven-pointed star
             4: Box                 15: Eight-pointed star
             5: Triangle            16: Nine-pointed star
             6: Diamond             17: Ten-pointed star
             7: Pentagon            18: 11-pointed star
             8: Hexagon             19: 12-pointed star
             9: Septagon            20: 13-pointed star
             10: Octagon            21: 14-pointed star
             11: Nine-gon           22: Cross (X) with gap
                                     23: Vertical line
             If SYMBOL < 0, then the symbol used is
                 flux/(-SYMBOL) + 1
  BOX........To select the column numbers to be printed including their
             order.  Up to 40 may be selected.  0 => all columns in
             basic order.
----------------------------------------------------------------
The MF table has a great many columns.  They are
   1. Plane                            integer
   2. Peak intensity                   Jy or milli-Jy / beam
   3. Integrated I flux                Jy or milli-Jy
   4. X offset of center               degrees or sexagesimal
   5. Y offset of center               degrees or sexagesimal
   6. Major axis                       angle
   7. Minor axis                       angle
   8. position angle                   degrees
   9. Integrated Q flux                Jy or milli-Jy
  10. Integrated U flux                Jy or milli-Jy
  11. Integrated V flux                Jy or milli-Jy
  12. Error in peak intensity          Jy or milli-Jy / beam
  13. Error in I flux                  Jy or milli-Jy
  14. Error in X offset                angle
  15. Error in Y offset                angle
  16. Error in major axis              angle
  17. Error in minor axis              angle
  18. Error in position angle          degrees
  19. Error in Q flux                  Jy or milli-Jy
  20. Error in U flux                  Jy or milli-Jy
  21. Error in V flux                  Jy or milli-Jy
  22. Type of model                    integer
  23. Deconvolved major axis           angle
  24. Deconvolved minor axis           angle
  25. Deconvolved position angle       degrees
  26. Deconvolved major axis lower limit       angle
  27. Deconvolved minor axis lower limit       angle
  28. Deconvolved position angle lower limit   degrees
  29. Deconvolved major axis upper limit       angle
  30. Deconvolved minor axis upper limit       angle
  31. Deconvolved position angle upper limit   degrees
  32. Residual image rms                Jy or milli-Jy / beam
  33. Residual image peak               Jy or milli-Jy / beam
  34. Residual image flux               Jy or milli-Jy
  35. X pixel of center                 pixels
  36. Y pixel of center                 pixels
  37. Major axis in pixels              pixels
  38. Minor axis in pixels              pixels
  39. Position angle in pixel space     degrees
  40. Computed velocity (from column 1 actually)    km/s


OPTYPE 'LINE' displays independent of number spectral channels and
OPTYPE other displays for multi-channel images
   columns 1, 2, 4, 5, 6, 7, 8, 23, 24, 25 1
   with columns 4, 5, 6, 7, 23, and 24 scaled by the angular scale
   appropriate to the image: degrees, arc seconds, milli-arcseconds,
   columns 4 and 5 are in hexidecimal if requested, column 2 may be in
   Jy or milli-Jy depending on the peak values, and column 1 will be
   listed normally and in velocity if possible.

OPTYPE 'CONT' displays independent of number spectral channels and
OPTYPE other displays for single-channel images
   columns 2, 3, 4, 5, 6, 7, 8, 23, 24, 25
   with columns 4, 5, 6, 7, 23, and 24 scaled by the angular scale
   appropriate to the image: degrees, arc seconds, milli-arcseconds,
   columns 4 and 5 are in hexidecimal if requested, and column 2 and 3
   may be in Jy or milli-Jy depending on the peak values.

OPTYPE 'USER' displays
   columns as set by BOX in the order set by BOX.  The units are as
   listed above for each column with "angle" meaning degrees,
   arc-seconds, or milli-arcsec depending on the scale of the image.

OPTYPE 'LIST' displays
   columns 35, 36, 3, 6, 7
   with columns 35 and 36 converted to center coordinate in degrees,
   column 3 in milli-Jy (or perhaps micro-Jy), and columns 6 and 7
   combined into a size parameter [sqrt(bmaj*bmin)] in arcsec.  The
   output form,at is suitable for input to SETFC, BOXES, and other
   source-list using tasks.

OPTYPE 'STAR' displays
   columns 3, 4, 5, 6, 7, 8
   with columns 4,5 converted into a sexagesimal coordinate pair,
   column 3 used to set the symbol and potentially to scale the
   component size initially set by columns 6 and 7.  The printed
   display is suitable for STARS an gives RA, Dec, Major, Minor, PA,
   type, and label with Major ind Minor in arcsec.

OPTYPE 'STDE' displays
   columns 3, 4, 5, 23, 24, 25
   with columns 4,5 converted into a sexagesimal coordinate pair,
   column 3 used to set the symbol and potentially to scale the
   component size initially set by columns 23 and 24.  The printed
   display is suitable for STARS an gives RA, Dec, Major, Minor, PA,
   type, and label with Major ind Minor in arcsec.
