Go to the list of seismic processes.      Go to SIOSEIS introduction.
                               PROCESS SORT

Parameters, alphabetically:
flag51    ipath      ikey1     ikey2     ipath     limit1    limit2
lkey1     lkey2      opath     rev1      rev2

Document date: 14 November 2000

PROCESS SORT creates a disk file containing a list of traces ordered 
differently from the input SEG-Y disk file.  PROCESS DISKIN can read the
traces from the SEG-Y file in the order contained in the output of this
process.  The sort is done so that the values being sorted are
increasing.  PROCESS DISKOX can "de-sort" the sorted SEG-Y file using
this same "sort" file.

The following example sorts and desorts disk file data:
          procs sort diskin diskoa end
          sort
             lkey2 3 limit1 2 3 ipath data opath test lkey1 4 end end
          diskin
             spath test ipath data end end
          diskoa
             opath junk spath test end end
          end

LIMITATIONS:

1)   Only 1 input diskin file may be used at a time.
2)   A maximum of 500,000 traces may be sorted at a time.


PARAMETER DICTIONARY
--------- ----------

IPATH   - The input SEG-Y pathname.
          REQUIRED.      e.g.  ipath /usr/seismic/line1

OPATH   - The output pathname of the file that will contain the ordered
          list of traces.
          REQUIRED.      e.g.  opath sort1.line1

LKEY1   - The index to the SEG-Y trace header of the primary key to use
          in sorting.  The index is of the 32 bit integer or long
          integer variables of the header.
          REQUIRED       e.g.  lkey1 4

IKEY1   - The index to the SEG-Y trace header of the primary key to use
          in sorting.  The index is of the 16 bit integer or short
          integer variables of the header.
          PRESET = NONE  e.g.  ikey 83

LKEY2   - The index to the SEG-Y trace header of the secondary key to
          use in sorting.  The index is of the 32 bit integer or long
          integer variables of the header.
          PRESET = NONE  e.g.   lkey2 3

IKEY2   - The index to the SEG-Y trace header of the secondary key to
          use in sorting.  The index is of the 16 bit integer or long
          integer variables of the header.
          PRESET = NONE

LIMIT1  - The limits of the primary sort.  Traces outside the limits are
          not read by process diskin.  The limit values MUST be
          increasing in value.  
          PRESET = NONE  e.g. limit1 2 3

LIMIT2  - The limits of the secondary sort.  Traces outside the limits
          are not read by process diskin.  The limit values MUST be
          increasing in value.
          PRESET = NONE   e.g. limit2 -500 -200

FLAG51  - The value to place in 32 bit integer header word 51 whenever
          the value of the primary key changes.  Word 51 is the 
          "end-of-sort" flag for many SIOSEIS process (e.g. stack),
          where a -1 is used to indicate the end of "gather".  Word 51
          will be set to zero if it is not the "end-of-sort".  SORT will
          not modify word 51 unless FLAG51 is given.
          PRESET = NONE  e.g.  flag51 -1

REV1    - A YES/NO switch indicating that the sort of the primary key
          is to be done in reverse or in decreasing order.  This is
          done by negating the header value associated with KEY1.
          PRESET = NO  e.g.     rev1 yes

REV2    - A YES/NO switch indicating that the sort of the secondary key
          is to be done in reverse or in decreasing order.  This is
          done by negating the header value associated with KEY2.
          PRESET = NO  e.g.     rev2 yes


Copyright (C) 1991 The Regents of the University of California.
ALL RIGHTS RESERVED.
Written by Paul Henkart, Scripps Institution of Oceanography, 
     La Jolla, CA 92093-0225
Go to the list of seismic processes.      Go to SIOSEIS introduction.