; LAYER
;---------------------------------------------------------------
;! Task to create an RGB image from multiple images
;# TASK PLOT ANALYSIS
;-----------------------------------------------------------------------
;;  Copyright (C) 2003
;;  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
;-----------------------------------------------------------------------
LAYER     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
LAYER:  Task to create an RGB image from multiple images
OUTNAME                            Output name(name).
OUTCLASS                           Output name(class).
OUTSEQ         -1.0      9999.0    Output name(seq. #).
                                     0 => highest unique
OUTDISK         0.0         9.0    Output image disk drive #
                                     0 => highest with space
BLC                                Bottom left corner of input
TRC                                Top right corner of input
APARM           0.0                Disk numbers for <= 10 images
BPARM           0.0                Catalog #'s for <= 10 images
CPARM           0.0                Absorption optical depth
                                   factor for images
DPARM           0.0                Emission optical depth factor
                                   for images
ARRAY1          0.0                Scale factor for emission
PLCOLORS        0.0         1.0    Colors of <= 10 images
DOCOLOR        -1.0         1.0    > 0 => absorption colored
DOWEIGHT       -1.0         1.0    Emission scaled by brightness
----------------------------------------------------------------
LAYER
Type: Task
Use:  LAYER will create a new cube with 3 planes from the weighted
      planes of up to 10 images.  The images are assumed to be fully
      aligned.  They will often be the output of SCLIM which may be
      used to clip and scale, linearly or non-linearly, the original
      images.  The 3 planes can then be used to display the 3rd
      dimension as color on the TV or with display tasks such as
      GREYS, PCNTR, and KNTR.

      LAYER assigns a basic optical depth to each input pixel and then
      scales that optical depth to "absorb" the current RGB sums and
      separately scales the optical depth to add to the absorbed.  The
      basic optical depth tau of a pixel in image i is
          tau = (Bi(x,y) - MINi) / (MAXi - MINi)
      where Bi(x,y) is the input image brightness at pixel (x,y), MAXi
      is the max(Bi) over all (x,y) and MINi is the min(Bi).  The
      emission due to this pixel in color c is
        Ii(c,x,y) = ARRAY1(i)*F*[1 - exp (DPARM(i)*PLCOLORS(c,i)*tau)]
      where F is either 1.0 or tau depending on DOWEIGHT (<= or > 0,
      resp).  The absorption optical depth of this pixel is
          TAUabs(all c) = CPARM(i) * tau
      if DOCOLOR <= 0, or
          TAUabs(c) = CPARM(i) * tau * PLCOLORS(c,i)
      if DOCOLR > 0.

      Clearly this is an experimental task which will take a lot of
      fiddling to get the good results that are possible,  As
      experience is gained, suggestions will be added.
Adverbs:
  OUTNAME.....Output name of image(name).    No good default.
  OUTCLASS....Output name of image(class).   Standard defaults.
  OUTSEQ......Output name of image(seq. #).  0 => highest unique
  OUTDISK.....Disk drive # of Output image.  0 => highest with
              space.
  BLC.........The bottom left-hand pixel of the input image
              which becomes the bottom left corner of the
              new image.  The value (0,0) means (1,1).
  TRC.........The top right-hand pixel of the input image
              which becomes the top right corner of the
              new image.  The value (0,0) means take the top
              right hand corner of the image.
  APARM.......Disk number for image i, i = 1 to 10.  No default,
              0 => no image i.
  BPARM.......Catalog number for image i, no default:
              0 => no image i.
  CPARM.......Absorption optical depth factor for image i.  No
              default; 0 => no absorption by image i.
  DPARM.......Emission optical depth factor for image i.  No default.
              0 => no emission by image i.
  ARRAY1......Scale emission of image i by ARRAY1(i).  <= 0 -> 1.
  PLCOLORS....RGB Colors of image i as array (3,10).  No default.
              PLCOLORS(c,i) = 0 => no contribution of image i to color
              c.
  DOCOLOR.....> 0 => absorption is colored by PLCOLORS; <= 0 =>
              absorption is equal in all colors.
  DOWEIGHT....> 0 => emission is weighted by brightness at pixel as
              well as the (1 - exp(t)) function.  <= 0 => weight = 1.
----------------------------------------------------------------

