; ISPEC
;---------------------------------------------------------------
;! Plots and prints spectrum of region of a cube
;# TASK PLOT SPECTRAL HARDCOPY
;-----------------------------------------------------------------------
;;  Copyright (C) 1995-1996, 1999-2000, 2004, 2009-2012
;;  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
;-----------------------------------------------------------------------
ISPEC     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
ISPEC : Task to plot spectrum of a specified portion of an image
USERID      -32000.0      32000.0  User ID.  ignored
INNAME                             Image name (name)
INCLASS                            Image name (class)
INSEQ            0.0       9999.0  Image name (seq. #)
INDISK           0.0          9.0  Disk drive #
BLC              0.0       4096.0  Bottom left corner of image
                                     0=>entire image
TRC              0.0       4096.0  Top right corner of image
                                     0=>entire image
OPTYPE                             'FLUX','LGFL','LNFL', 'FDER'
                                   'AVER','LGAV','LNAV', 'ADER'
PIXRANGE                           Range of intensities to plot
ZINC         -8192.0       8192.0  Increment on freq axis.
                                   < 0 => invert Z axis in plot
SMOOTH                             Frequency smoothing function
LTYPE         -10.0        10.0    Type of labeling: 1 border,
                                   2 no ticks, 3 standard, 4 rel
                                   to center, 5 rel to subim cen
                                   6 pixels, 7-10 as 3-6 with
                                   only tick labels
                                   <0 -> no date/time
DOCENTER        -1.0          1.0  > 0 => plot with box-like
                                   lines, else plot line to
                                   points
DOTV           -1.0         1.0    > 0 Do plot on the TV, else
                                   make a plot file
GRCHAN          0.0         8.0    Graphics channel 0 => 1.
DOPRINT        -3.0       132.0    > 0 => use the terminal, 0 =>
                                   no output, < 0 => printer or
                                   file, > 72 => terminal width
OUTPRINT
                                   Printer disk file to save
DOSLICE        -1.0         2.0    > 0 => save as SLice file
XYRATIO         0.0                Stretch the X axis wrt Y axis
                                   0 -> 1.33
FACTOR                             Scale xDER plots; 0 -> 1
----------------------------------------------------------------
ISPEC
Type: Task
Use : Task to plot and print the average brightness or flux of an area
      in the first two axes of an image as a function of location on the
      third axis of an image.  For example, this is a quick way to
      display a single spectrum per point or area and avoids the use of
      TRANS.  The user can determine the area for which he wishes to
      know the spectrum by using the verb TVWIN followed by GO ISPEC.
      The spectrum will be placed in a plot file and can be displayed
      with the display task of the user's choice.  To obtain spectra for
      each pixel over a given area the user should use TRANS and PLCUB.
      Note that the third axis does not have to be a spectral-line axis
      - all standard axis types are allowed.  (If the first 2 axes are
      not celestial coordinates, then the conversion from Jy/beam to Jy
      for OPTYPE 'FLUX' cannot be done, however.)

      If the third axis is FQID, the plots made will be adjusted to a
      frequency axis with points placed appropriately.  Slices made
      will be interpolated onto a regular frequency grid.

      For plots over irregular regions, specified using a "botch"
      image, see task BLSUM.
Adverbs:
  USERID......User ID of owner of image.  Ignored.
  INNAME......Image name(name).  blank => any
  INCLASS.....Image name(class).  blank => any
  INSEQ.......Image name(seq. #).  0 => any
  INDISK......Disk drive # of image.  0 => any
  BLC.........The Bottom Left-hand pixel of the subarray of the image to
              be plotted. The value (0,0,...) means (1,1,1,1,1,1,1).
  TRC.........The Top Right-hand pixel of the subarray of the image to
              be plotted.  The value (0,0,...) means the top right hand
              corner of the entire image.
  OPTYPE......'FLUX' => plot and print the sum of the valid intensities
                        in the subarray, converted to Jy from Jy/beam
                        in Clean images.
              'LGFL' => like FLUX but vertical scale in log base 10
              'LNFL' => like FLUX but vertical scale in log base e
              'AVER' => plot and print the average intensity.
              'LGAV' => like AVER but vertical scale in log base 10
              'LNAV' => like AVER but vertical scale in log base e
              'FDER' => like FLUX but output is derivative out(i) =
                        (flux(i+1)-flux(i)) * FACTOR
              'ADER' => like AVER but output is derivative out(i) =
                        (aver(i+1)-aver(i)) * FACTOR
              otherwise => AVER
  PIXRANGE....Range of pixel values to plot; values below PIXR(1) are
              set to PIXR(1), values above PIXR(2) are set to PIXR(2).
              PIXR(1) >= PIXR(2) implies use the full range of pixel
              values in the image.
  ZINC........Increment between plotted pixels on 3rd axis.
              If < 0, abs(ZINC) is used and the Z axis is inverted
              when listing and plotting.
  SMOOTH......Specifies the type of spectral smoothing to be applied to
              a uv database . The default is not to apply any smoothing.
              The elements of SMOOTH are as follows:
              SMOOTH(1) = type of smoothing to apply: 0 => no smoothing
              To smooth:
                 1 => Hanning, 2 => Gaussian, 3 => Boxcar, 4 => Sinc
                 5 => Hanning, 6 => Gaussian, 7 => Boxcar, 8 => Sinc
              SMOOTH(2) = the "diameter" of the function, i.e. width
                 between first nulls of Hanning triangle and sinc
                 function, FWHM of Gaussian, width of Boxcar. Defaults
                 (if < 0.1) are 4, 2, 2 and 3 channels for SMOOTH(1) =
                 1 - 4 and 5 - 8, resp.
              SMOOTH(3) = the diameter over which the convolving
                 function has value - in channels.  Defaults: 1,3,1,4
                 times SMOOTH(2) used when input SMOOTH(3) < net
                 SMOOTH(2).
  LTYPE.......Labelling type: 1 = border, 2 = no ticks, 3 or 7 =
              standard, 4 or 8 = relative to ref. pixel, 5 or 9 =
              relative to subimage (BLC, TRC) center, 6 or 10 = pixels.
              7-10 all labels other than tick numbers and axis type are
              omitted.  Less than 0 is the same except that the plot
              file version number and create time are omitted.
  DOCENTER....False (<= 0) means to draw plot lines between the data
              points of the "spectrum" producing a jagged looking plot.
              True (> 0) means to plot 1-channel horizontal lines
              centered on each data point and connected to adjacent
              points by vertical lines producing a histogram-like plot.
  DOTV........> 0 => plot directly on the TV device, otherwise make a
              plot file for later display on one or more devices
              (including the TV if desired).
  GRCHAN......Graphics channel (1 - 7) to use for line drawing. 0 => 1.
  DOPRINT.....False (<= 0) use the line printer if OUTPRINT = ' '
                 else write named OUTPRINT file only.
                 When OUTPRINT is not blank, DOPRINT=-2 suppresses the
                 page-feed character on page headers and DOPRINT=-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 < DOPRINT < width.  In that case, the display
                   limit will be DOPRINT 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.
  DOSLICE.....> 0 => save the spectrum as a SLice file suitable for
              the usual plotting and fitting done on slices.
  XYRATIO.....The ratio of the axes X to Y in the plot.  1.0 makes a
              square plot.  0 -> 1.3 (about the usual ratio of X to Y
              on the TV screen or A format paper).
  FACTOR......Scale factor for ADER and FDER plots only; 0.0 -> 1.0.
              Used to adjust units from Jy/channel to Jy/(km/s) or
              other things as needed.  Can reverse sign.
----------------------------------------------------------------
