NAME

     trched  - module to list/manipulate SIS trace headers


SYNOPSIS

     trched [ -Nntap ] [ -Ootap ] [ -eendsam ] [ -nsns ] [  -nene
     ]  [ -rsnrs ] [ -reendrec ] [ -rinri ] [ -logilog ] [ -schar
     ] [ -a:codes  ] [ -b:codes  ] [ -d:codes  ] [ -e:codes  ]  [
     -K  ]


DESCRIPTION

     trched allows listing and manipulation of  named  SIS  trace
     header  values.   Specifically,  it  is possible to printout
     specific values under various conditions and to perform sim-
     ple  arithmetic  operations  including  if tests on selected
     trace header values.  Header values are referenced using the
     mnemonic  system  described  at the back of the manual pages
     for scan

     trched gets processing controls from the command line.  Rea-
     sonable defaults are set up. In addition, if no file name is
     given, the binary trace data are expected to be on the stan-
     dard input.


OPTIONS

  Command line arguments
     -N ntap
          Enter the full path of the file containing the data set
          after typing -N. If not specified, input is expected on
          the standard input.

     -O otap
          Enter the output data  set  name  or  file  immediately
          after  typing -O. This output file is not required when
          piping the output to another process.  The output  data
          set requires the full path name.  Use /dev/null to dis-
          card the output.

     -e endsam
          End time (ms) of output traces (default =  input  trace
          length)

     -ns ns
          First trace in record to process (default = 1)

     -ne ne
          Last trace in record to process (default = all)

     -rs nrs
          (integer) First record to process (default = 1)

     -re endrec
          (integer) Last record to process (default = all)

     -ri nri
          (integer) Process every nri records (default = 1)

     -log ilog
          (integer) Detailed printout every ilog traces  (default
          = none)

     -a: codes
          (text) Mneumonic1,Mneumonic2,...,Mneumonicn Each  Mneu-
          monic  is  the  name  of an SIS header (integer) value.
          Values are printed out after any manipulation (if any)

     -b: codes
          (text) Mneumonic1,Mneumonic2,...,Mneumonicn Each  Mneu-
          monic  is  the  name  of an SIS header (integer) value.
          Values are printed out before any manipulation (if any)

     -d: codes
          (text) Mneumonic Mneumonic is the name of an SIS header
          (integer)  value.   Log whenever this value changes (i.
          e. skip duplicates )

     -e: codes
          (text) Evaluate SIS trace header  words.   This  option
          provides  the  ability to evaluate and change SIS trace
          header words from the UNIX command line.

     -s char
          (text) Set delimitor for e:  option.  Note:  quote  for
          space  and  other special characters.  Available: ",","
          ",";" (comma,space,semicolon) or any other non-reserved
          character. (default = ",")

     -K   Enter the command line argument '-K' to output the same
          number  of  records  as input data but apply the header
          operations to every nri record.


USAGE

     The following are some examples to demonstrate  the  utility
     of  trched.   The display codes -a:, etc will send output to
     the printout file located in the current working  directory;
     the  -e: change option will send printout only if there is a
     -log command line entry.  This printout will also go to  the
     same printout file.




     EXAMPLES for -a: and -b: options

          Example 1: Display signed distances before any changes:

               -b:DstSgn

          Example 2: Display signed distances  before  and  after
          changes; display static word:

               -b:DstSgn,StaCor  -a:DstSgn




     EXAMPLES for -e: option

          Example 1: To move (copy) the Permanent  Record  Number
          to the Line Indicator.

               -e:'<,PrRcNm,>,LinInd'

               Note the use of "'" to escape the special  charac-
               ters "<" and ">".

          Example 2: To add the constant 1 to  the  current  Line
          Indicator.

               -e:'<,LinInd,+,Constant,1,>,LinInd'

          Example 3: The previous example with the space as  del-
          imitor.

               -e:'< LinInd + Constant 1 > LinInd' -s" "

          Example 4: To number traces sequentially from,say, 44 ,
          use the first time option:

               -e:'[,<,Constant,43,>,Memory,1,]'\
               ',<,Memory,1,+,Constant,1,>,Memory,1,>,DphInd'

               Note the \ to continue a long command line.   This
               will  work  in  the  Bourne Shell, but the C Shell
               will insert a space.  Also, note the "'"  starting
               and ending each part of the expression.

          Example 5: A single trace might be flagged  dead  using
          the following test:

               -e:'{ < PrTrNm .EQ <  Constant  20  !  <  Constant
               30000 > StaCor }'

               Note the space as a delimitor In this case,  when-
               ever  the  Permanent  Trace  Number equals 20, the
               dead-trace flag (StaCor=30000) will be set.   Note
               that  the previous "sentence" takes on the form of
               a condition followed by an action,  the  separator
               being  "!"  (exclamation  point).   Also  the test
               takes the form of a "." followed by a 2  character
               code (see details in the following).

     FORMAL DESCRIPTION

          All control words  (tokens)  have  the  same  separator
          (delimitor)  (default  =  "," [comma]) which can be set
          using the -s command line argument previously described
          .

          Structures
               Trace header
                    Integer values, such as  PrTrNm  and  LinInd,
                    are referenced by name.

               Constant
                    Constants, such as the number 100, are refer-
                    enced  as  Constant,100. Note the comma (",")
                    used as a separator.

               Memory
                    A scratchpad is available for saving  values.
                    There are 10 locations referenced as Memory,1
                    Memory,2 ...

          Operations

               (*)            <
                    Get a value from one of:

                         (1) a named  SIS  seismic  trace  header
                         word e.g. LinInd
                         (2)  a  constant  (literal)  e.g.   Con-
                         stant,77
                         (3) a memory location (scratchpad)  e.g.
                         Memory,2

               (*)            >
                    Put a value to one of:

                         (1) a named SIS header word
                         (2) the scratchpad memory.

               (*)            + - * / %
                    Perform the corresponding arithmetic (  %  is
                    remainder )  on the accumulator.
                    < is  implied  after  these  operations  (see
                    Example 2).
          Control

               (*)            WAIT
                    Do not  begin  trace  processing  yet  (still
                    first time)

               (*)            KILL
                    Set the dead trace flag for this trace.

               (*)            DROP
                    Omit this trace.

               (*)            STOP
                    End trace processing

               (*)            [ ... ]
                    Perform  the  operations  enclosed  only  the
                    first time (initialize).

               (*)            { condition(s) ! action }
                    When the "condition"  is  true,  perform  the
                    "action".  A condition is of the form:

                         "Left expression" .TEST  "Right  expres-
                         sion".

                    TEST is one of LT,LE,EQ,NE,GE,GT. Note the  .
                    (period) before the TEST.

                    More  complicated  conditions  may  be  build
                    using  & | ^ ~ which are AND OR XOR NOT (and,
                    inclusive or, exclusive or, not).   NOTE  the
                    test  conditions  do  not affect other arith-
                    metic unless the > option is used.


FILES

     Sun  output is TRCHED

     Cray output is TR.NUM1.NUM2 where NUM1 is the Parent Process
          ID and NUM2 is the Process ID.


DIAGNOSTICS

          seems to work but like many new offerings  it  is  ****
          Unknown code ***


BUGS

          Because the header manipulation commands  are  reinter-
          preted for each trace there is some inefficiency in the
          evaluation option. The advantage lies in not needing to
          compile or link any new code - flexibility.


AUTHOR

     Chester  Jacewitz  (with  mods  and  suggestions   by   Paul
     Gutowski),  APR


SEE ALSO

     utop for line header changes and global trace header changes


COPYRIGHT

     copyright 2001, Amoco Production Company
               All Rights Reserved
          an affiliate of BP America Inc.














































Man(1) output converted with man2html