Go to the list of seismic processes.      Go to SIOSEIS introduction.      Go to SIOSEIS examples.
               PROCESS HEADER, HEADER2, HEADER3
               ------- ------  -------  -------

Parameters, alphabetically:
bhdr      clean     cxx       fno       ftr       hdr
header    ihdr      interp    itype     lhdr      lno
ltr       ltype     noinc     rev1      swap      trinc
type      xn


Document Date:  4 June 2014
Modifications:
    Add B (byte) and D (double) to equation.
    LNO preset documentation was wrong.
    Add parameters NOINC and TRINC, Nov. 2008
    Add parameter SWAP, Feb. 2007
    Add explanation and example of using the same header word multiple
        times.  June 2003
    Add parameter REV1 PATHNAME, May 2003
    Add parameter INTERP, March 2003

Process HEADER modifies the SEG-Y trace headers by specifying the header
word number (index) and the value.  The SEG-Y EBCDIC header may be 
modified also.  There are two methods for indexing the SEG-Y header, one
by using the name of the variable within the header and then by knowing
the SEG-Y header indices.

PROCESSES HEADER2 and HEADER3 are identical to HEADER and enable three
unique HEADER processes to be given in a single SIOSEIS job.

When using the index to the SEG-Y trace header structure, consult the 
SIOSEIS document segy.header, since the trace header is composed of 16
bit integers, 32 bit integers, and floating point words.  The SEG-Y trace
header values are changed by specifying the index of the value and the
new value.  16 bit header words are specified using the IHDR parameter,
32 bit words are specified via the LHDR parameter, and floating point 
words are specified via HDR.  These parameters are lists of indices and
values.  HDR, LHDR, and IHDR may be given on each control point. 

Spatial variation between control points is available.   The SIOSEIS 
document SYNTAX discusses control point usage, however a control point
is an fno/lno list of parameters.  Spatial interpolation is different
from the interpolation/extrapolation of values on traces within a
shot/rp.  Interpolation of values between traces is NOT available.

Consult the document segy.header for a partial list of header word
meanings and a list of header words used by SIOSEIS.  Various SIOSEIS
processes use the unassigned traces header words; process diskin
uses long words 46 and 49 to store the floating point values of the
deep water delay and the sample interval.

The order the HEADER parameters are done is: IHDR, LHDR, HDR, NX, CLEAN

Example 1:     Change the range (header word 10) on two shots:
using the SEG-Y variable name scheme:
     header FNO 796 LNO 796 header range 415 interp no  end
                FNO 797 LNO 797 header range 120 end
     end
or using the SEG-Y index approach:
     header FNO 796 LNO 796 lhdr 10 415 interp no  end
                FNO 797 LNO 797 lhdr 10 120 end
     end

Example 2:  show the effects of spatial variation:
     header
     lhdr 10 10 16 16 FNO 4 LNO 5 end
     lhdr 10 12 16 20 FNO 7 LNO 8 end
     end
With spatial variation (the preset);
     shots 1 - 5 32 bit header 10 = 10, and 16 = 16,
     shot 6 32 bit header word 10 = 11, and 16 = 18,
     shots 7 - end 32 bit header word 10 = 12, and 16 = 20.
Without spatial variation( interp no );
     shots 1 - 3, no change
     shots 4 - 5 32 bit header 10 = 10, and 16 = 16,
     shot 6 no change
     shots 7 - 8 32 bit header word 10 = 12, and 16 = 20.
     shots 9 - end no change

Example 1, suppose the rp number (32 bit word 6) for rp 1-10 should be 
changed to 1001-1010 and the year the data was recorded (16 bit word 79)
should be 1991.
     header 
          FNO   1 lhdr 6 1001 ihdr 79 1991 end
          FNO 10 lhdr 6 1010 ihdr 79 1991 end
     end
 

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

BHDR   - Binary header modification.  Pairs of numbers, the first of
         the pair is the index of the SEGY binary header word to be
         replaced by the value of the second number.  There is no
         limit to the number of pairs given.
         Preset = none.  e.g. bhdr 5 3   indicates that word 5 will
         become 3.

CXX    - Comment card images to replace in the SEG-Y EBCDIC header.  XX
         is the 2 digit number of the card image to replace.   The
         comment itself must be enclosed in quotes and must be less than
         76 characters long.
         Preset = none   e.g. c09 'this comment replaces card image 9.'

CLEAN  - Sets the SEGY trace header and/or binary header to zero.
       =1, Cleans the unused (by sioseis) portion of the SEG-Y binary
           header.  See the document segy.header for the list of
           words used by sioseis.
       =2, Mildly cleans the unused (by sioseis) portion of each
           trace header.
       =3, Cleans the binary header and mildly cleans every trace
           header to zero (1+2 = 3)
       =4, Harshly cleans every trace header.  Only the shot number,
           shot trace number, sample interval and number of samples
           are spared.
       =5, Cleans the binary header and harshly cleans the trace
           headers (1+4 = 5).
         Preset = 0  e.g. clean 3

FNO    - The first shot/rp number defining a control point.  Shot/rp 
         numbers MUST be strictly monotonically increasing.  If all
         shots are to receive the same parameters, use:
         fno 0 lno 9999999
         Preset = 1

LNO    - The last shot/rp number defining a control point.  Shot/rp 
         numbers MUST be strictly monotonically increasing.  LNO is
         reset (default) to FNO on every fno/lno/end list.
         Default = FNO

NOINC  - The increment between FNO and LNO.  Only shots/rps which
         match  DO  fno, lno, noinc  are modified by process header.
         Preset = noinc ignored

FTR    - The first trace of FNO/LNO to modify.  Traces numbers smaller
         than FTR will not be modified.
         Preset = 1

LTR    - The last trace of FNO/LNO to modify.  Traces numbers larger 
         than LTR will not be modified.
         Preset = 9999987

TRINC  - The increment between FTR and LTR.  Only traces which
         match  DO  ftr, ltr, trinc  are modified by process header.
         Preset = trinc ignored

REV1   - The contents of the file specified will be "appended" to any
         existing SEG-Y Rev 1 Textual Extension Records.  Process
         HEADER inserts the contents before the "((EndText))" record,
         so it should not be included in the file.  The contents
         are written in sets of 40 ASCII lines.  HEADER will blank
         fill each line to be 80 characters and HEADER will write
         the required cr/lf in columns 79 & 80.
         If the specified file does not exist, HEADER will create
         a "(( SIOSEIS SEG-Y ))" along with the "((EndText))" stanza.
         Preset = none,    e.g.   rev1 junk

Trace Header Modification with Spatial Variation
------------------------------------------------
INTERP - A YES/NO switch to indicate spatial variation between control
         points.
       =YES, Spatial variation will be done.
       =NO, Spatial variation will NOT be done.
         Preset = YES, except with XN

HEADER - A list of header variable names and values.  The permissible 
         header variable names are:
       = SHOTNO,  The shot number is used. (third long integer)
       = SHOTTR,  The shot trace number is used. (fourth long integer)
       = RPNO,    The rp number is used. (sixth long integer)
       = RPTR,    The rp trace number is used. (seventh long integer)
       = RANGE,   The range or shot-receiver distance. (tenth long integer)
       = FOLD,    The CDP fold or CDP coverage.
       = DELAY,   The deep water delay time in seconds.
       = SI,      The sample interval in seconds.
       = WBT,     The water bottom time in mils.
       = WBD,     The water bottom depth in meters.
         Preset = none.   e.g. header delay 1.   # delay in seconds

IHDR   - A list of indices and values for the 16 bit integer SEG-Y trace
         header.  Up to 60 index-value pairs may be given.  Used with ITYPE.
         An index may be repeated, but only the last one will count.
         e.g. ihdr 15 1   sets the SEG-Y header word for trace id to 1
         Default = none

LHDR   - A list of indices and values for the 32 bit integer SEG-Y trace
         header.  Up to 60 index-value pairs may be given. Used with LTYPE.
         An index may be repeated, but only the last one will count.
         e.g.   ltype multiply lhdr 10 -1
         e.g.  lhdr 7 0 51 0    sets long integer words 7 and 51 to 0
         Default = none

HDR    - A list of indices and values for the floating point SEG-Y trace
         header.  Up to 60 index-value pairs may be given.  Used with TYPE.
         An index may be repeated, but only the last one will count.
         Default = none

ITYPE  - The type of 16 bit integer trace header modifications.
         Used with parameter IHDR.
       = REPLACE, The user given values replace the SEG-Y header values.
       = ADD, User given values are added to the SEG-Y header values.
       = MULTIPLY, User given values multiply the SEG-Y header values.
         Preset = replace      e.g.  itype multiply

LTYPE  - The type of 32 bit integer trace header modifications.
         Used with parameter LHDR.
       = REPLACE, The user given values replace the SEG-Y header values.
       = ADD, User given values are added to the SEG-Y header values.
       = MULTIPLY, User given values multiply the SEG-Y header values.
         Preset = replace      e.g.  ltype multiply

TYPE   - The type of floating point trace header modifications.
         Used with parameter HDR.
       = REPLACE, The user given values replace the SEG-Y header values.
       = ADD, User given values are added to the SEG-Y header values.
       = MULTIPLY, User given values multiply the SEG-Y header values.
         Preset = replace      e.g.  type multiply


Trace Header Modification by Equation, without spatial variation.
All indices start with 1.
-----------------------------------------------------------------
XN  =  XN/C op XN/C, or
XN     XN/C op XN/C, where;
       X = I, means short integer (16 bit integer trace header)
         = L, means long integer (32 bit integer trace header)
         = R, means real word (host floating point)
         = B, means byte
         = D, means double precision real (64 bit floating point)
       N = the index with the SEGY trace header.
       C = a constant. (Either XN or C may be given).
       OP is an operator of +, -, *, /, **

       A maximum of 10 XNs may be given in a parameter list.  HEADER
       does the operations in the same order in which they are given.

       Example 1: l1 0, means long integer word 1 is 0.
       Example 2: i59  i59 * 1000   Means multiply short word by 1000
       Example 3: r49  i48 / 100000.  means real word 49 = short
                                    integer word 48 divided by 100000.
       Example 4: save the shot and shottrace number in header 
       words 1 and 2.
             header
                   fno 0 lno 99999 ftr 1 ltr 9999
                   l1 = l3 l2 = l4   # same as l1 l3 l2 l4
             end
       Example 5: Do multiple operations on the same header word.
                   l19 = -1900 l21 = 2100 l57 = 1000
                   l19 = l19 * -2
                   L19 = L19 - L57
                   L21 = L21 + L57
                   l57 = 0
       results in word 19 conatins 2800,  word 21 contains 3100,
                  word 57 contains 0

       Default = none

SWAP XN - A list of up to 50 trace header entries to byte swap.  Byte
         swapping is done before any other HEADER operations.
       X = I, means 16 bit word (2 bytes).
         = L, means 32 bit word (4 bytes - long integer or real).
       N = the index with the SEGY trace header.
         Preset = none.    e.g.  swap i45 l19 l20

Copyright (C) The Regents of the University of California
Written by:  Paul Henkart, Scripps Institution of Oceanography
ALL RIGHTS RESERVED.
Go to the list of seismic processes.      Go to SIOSEIS introduction.