@@
Slice files:               SLrsssvv


A. Overview

Function: Slice files are usually extension files associated with
a map file.  The slice file contains interpolated data points
that lie along a vector from one map pixel to another.  End points
may be fractions of a pixel.  The slice file may also contain the
parameters for a number of models of the slice file.  Each model
may contain up to 4 gaussian components.

Details: SL files use a modified EXTINI-EXTIO file structure.
The logical record length is 256 words.
The number of data points in the slice is determined by the
following algorithm:
   If the length of the vector is greater than 1024 then 4096.
   If the length of the vector is greater than 512 then 2048.
   If the length of the vector is greater than 256 then 1024.
   otherwise the no. of points is 512.


Names: The system name for a slice file is SLrsssvv where r is
the release code, sss is the catalog slot number of the associated
map file, and vv is ther version number (starting at 1) of the slice
file.


B. Record formats

   Slice files are sequential files consisting of 256 word records.
The first record in the file is of the type created by EXTINI and
contains useful miscellaneous information.  The 2nd record contains
the inputs the user specified when creating the slice file.  The
slice data points start in record three and continue for as many
records as necessary to use up the data.  Models, if extant,
immediately follow the data using one record per model.

 WORD   TYPE     DESCRIPTION
   1     I       # 512-byte records in the existing file
   2     I       # logical records to extend the file when req.
   3     I       max. # of logical records
   4     I       current number of logical records
   6     I       # values per logical record.
   7     I       # of logical records per physical record, if neg then
                 the # of physical records per logical record.
   8     H*6     Creation task name
  11     I(6)    Creation date, time
  17     H*48    File name
  29     I       Volume number on which file resides.
  30     H*6     Last write-access task
  33     I(6)    Last write-access time,date
  39     I(18)   reserved. (53-56 used by EXTIO.
  57     I       Number of slice data points.
  58     I       Number of model records currently in the file.
  59     I       The record that may contain the first slice model.
                 Includes header record and numbers from one.

(1) The second physical record

    All default values for the fields have been filled in.

 WORD   TYPE     DESCRIPTION
   1     H*6     Program name (slice).
   4     I(3)    Date (year, month, day).
   7     I(3)    Time (hour, min, sec).
  10     I       Number of words in the following inputs
                 section of the record (25 at this time).
  11     R       User number of the map file.
  12     H*12    Name of the associated map file.
  15     H*6     Class of the associated map file.
  17     R       Sequence number of the associated map file.
  18     R       Disk volume number of slice and map files.
  19     R(7)    Starting pixel of the slice vector.
  26     R(7)    Ending pixel of the slice vector.
  33     H       'FLUX' => sum over area
                 'AVER' => brightness
                 'LGFL', 'LNFL' => log10, ln of flux
                 'LGAV', 'LNAV' => log10, ln of brightness
                 'ADER', 'FDER' => derivative of AVER or FLUX
                                   along slice.
  34     R       Minimum value of slice pixels.
  35     R       Maximum value of slice pixels.
  36     R       Frequency increment in slice if FQID axis
  37-38  D       Frequency of first slice point from FQID axis

(1) Slice data points

 WORD   TYPE     DESCRIPTION
   1     R(256)  Slice data points in floating point.

(2) Slice models.

 WORD   TYPE     DESCRIPTION
   1     R(12)   Parameters for up to 4 gaussian components in the order
                 maximum amplitude (physical units), position (slice
                 point), half width (slice points), maximum amplitude ...
  12     R(12)   Errors for corresponding parameters.
  25     I       Slice points not fitted from the beginning of the slice.
  26     I       Slice points not fitted from the end of the slice.
  27     I       Number of Gaussians.
  28     I(3)    Date as year, month, day.
  31     I(3)    Time as hours, minutes, seconds.
  34     I(4)    Minus ones indicate initial guess for position of
                 corresponding gaussian component held constant.
  38     I(4)    Minus ones indicate initial guess for maximum amplitudes
                 held constant.
  42     I(4)    Minus ones indicate initial guess for half widths held
                 constant.
  46     R       RMS
  51     R(6)    1. Max, Error max, Pos, Error pos, Width, Error width
  57     R(6)    2. Max, Error max, Pos, Error pos, Width, Error width
  63     R(6)    3. Max, Error max, Pos, Error pos, Width, Error width
  69     R(6)    4. Max, Error max, Pos, Error pos, Width, Error width
  75     H*16    Units of Max
  79     H*16    Units of pos and width
  83     R(3)    fit baseline (const, slope, 2n order)  [Added 10/26/16]
  86     R(3)    uncertainties in baseline
  89     ??

C. User notes.

     When calling EXTINI use LREC=256.

     A really old format had in record 2 word 19 was map type, words 20-33
     were BLC, TRC and 33 did not have a character variable.  An older
     format changed about 1/2009 had word 33-44 INFILE except that 34
     and 35 were maxima and FQ axes were unknown.
     Model records lacked words 46 and 51-81.


D.  Routines to write SL files:
     EXTINI and ZFIO,  SL files are currently written by SLICE and SLFIT.


E.  Routines to access SL files: EXTINI and ZFIO.

