; IM2PARM
;---------------------------------------------------------------
;! Specifes enhancement parameters for OOP-based imaging: 2nd set
;# ADVERB IMAGING OOP
;-----------------------------------------------------------------------
;;  Copyright (C) 2009, 2012, 2020
;;  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
;-----------------------------------------------------------------------
IM2PARM   LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
----------------------------------------------------------------
IM2PARM
Type: Adverb  (array(40))
Use:  To specify additional correction and other "enhancement"
      parameters to IMAGR above and beyond those in IMAGRPRM.  See
      EXPLAIN IMAGR for further discussion.

IM2PARM(1)-(7) Auto-boxing during Clean controls

       (1) IMAGR can create Clean boxes automatically.  In OVERLAP 2
     mode it will do this only in the facet about to be Cleaned.  In
     OVERLAP < 2, it looks at every facet at each major cycle.  It
     will find no more than the strongest IM2PARM(1) boxes each time
     it looks.  <= 0 => don't do auto-boxing.  Limit 50.

       (2) The auto-boxing starts by finding islands of emission >
     IM2PARM(2) * rms in the residual image.  This defines the size of
     the box if it is accepted.  (0 -> 3.0)

       (3) A box can only be accepted if its peak brightness is >
     IM2PARM(3) * rms in the residual.  A box is also accepted only if
     the peak in it is not already in a Clean box.
     < IM2PARM(2) -> IM2PARM(2) + 2.0

       (4) A box is also only accepted if its peak brightness is >
     IM2PARM(4) * maximum residual in the whole image.  < 0.01 OR >
     0.9 -> 0.1

       (5) The box determined by the island may be extended outward in
     all directions by IM2PARM(5) pixels.  < -1 => +1.  Note that -1
     means contract in all directions by 1 pixel.

       (6) The residual image is examined only in an ellipse (circle
     if IMSIZE(1) = IMSIZE(2)) of radius in X of IMSIZE(1)/2 -
     IM2PARM(6) and in Y of IMSIZE(2)/2 - IM2PARM(6).  <= 0 -> 5

       (7) When imaging an output cube, should spectral channel N+1
     begin with the boxes of channel N or only with those set up by
     BOXFILE, CLBOX, etc.?
           > 0 - begin with initial boxes in each channel
           < 0 - pass boxes along to next channel
           = 0 => +1 when auto-boxing, -1 when not doing auto-boxing

       (8) The first TV display resumes Cleaning after IM2PARM(8)
     seconds.  0 -> 600.

       (9) After the first display, the TV display times out and
     resumes Cleaning after IM2PARM(9) seconds.  0 -> 30.

IM2PARM(10) Future expansion

IM2PARM(11)-(13) Baseline-length dependent time and frequency averaging:

       (11) The maximum elapsed time over which averaging of data may
     be done in seconds.  0 -> infinite
       (12) The desired field of view radius in arc minutes which is
     not to be distorted by time averaging in a baseline-dependent
     fashion and in frequency averaging.  <= 0 -> infinite or no
     averaging.  The field of view is the region in which averaging is
     not to reduce the amplitude by more than 1% on any baseline.  No
     data separated by more than 268.5 wavelengths divided by
     IM2PARM(12) are averaged together.  It might be wise to make this
     parameter larger than the field of view about which you care.
       (13) Average IM2PARM(13) channels together in the on-the-fly
     averaging when IM2PARM(12) > 0.  Note that you can get channel
     averaging without time averaging by setting IM2PARM(11) to a
     small enough (but > 0) value while setting IM2pARM(12) to an
     appropriate value.  If IM2PARM(13) is 1, IMAGR will compute the
     number of channels based on the maximum possible baseline and the
     value of IM2PARM(12).  This parameter must be <= NCHAVG and both
     NCHAVG and CHINC should be integer multiples of IM2PARM(13).

IM2PARM(16)-(18) If IM2PARM(16) > 0, use an inverse taper with weight
     IM2PARM(16) at 0 and U and V radii in klambda in IM2PARM(17) and
     IM2PARM(18), resp.

IM2PARM(19)-(40) Future expansion

Tasks:
    FILIT.....Interactive BOXFILE editing with facet images.  Uses
              the auto-boxing parts of IM2PARM.
    IMAGR.....Wide-field and/or wide-frequency Cleaning / imaging
              task.
    SCIMG.....Full-featured imaging plus self-calibration loop with
              editing.  Uses auto-boxing parts from IM2PARM.
    SCMAP.....Imaging plus self-calibration loop with editing.  Uses
              auto-boxing parts of IM2PARM.
Procedures:
    LINIMAGE..Build image cube from multi-IF data set.  Passes
              IM2PARM to IMAGR.
    TD_STEP3..Time-dependent imaging procedure "step 3".  IM2PARM
              passed to IMAGR.
    TD_STEP5..Time-dependent imaging procedure sequence: later steps.
              IM2PARM simply passed to IMAGR.
"Verbs":
    OBITIMAG..Access to OBIT task Imager without self-cal or peeling
              IM2PARM has different meanings: (1) do autoboxing,
              (2)-(4) outlier parameters, (5)-(6) baseline length
              averaging.
    OBITMAP...Simplified access to OBIT task Imager.  IM2PARM(1)
              turns on autoboxing.
    OBITPEEL..Access to OBIT task Imager with self-cal and peeling.
              IM2PARM as OBITIMAGE plus (11)-(29) self-cal and
              peeling parameters
    OBITSCAL..Access to OBIT task Imager with self-cal, NOT peeling.
              IM2PARM as OBITIMAG plus (11)-(20) self-cal parameters
----------------------------------------------------------------
