Go to the list of seismic processes.      Go to SIOSEIS introduction.
                       PROCESSES DESPIKE AND TREDIT
                       --------- -------     ------

Parameters, alphabetically:
addwb    alpha    endmute   fac       fno       ftr
hcycle   hdr      ihdr      kill      lhdr      limits
lno      lprint   ltr       median    maxval    maxtype
minval   mintype  pass      quart     sel       ses
sets     set      thres     type      vel       winlen

Document date: 9 August 2012
Modifications:
 19 Jul. 10 - Check every sample on every trace for NaN and zero it.
            - remove requirement of giving parameters, so NaN check is
              automatic.
  5 Nov. 09 - Add parameter pass for offline filtering
  1 Sep. 05 - Add KILL FLAGONLY
 31 Aug. 05 - Add parameter ENDMUTE
 August 2012 - Add parameter MINTYPE and kill by SDEV, VAR, SKEW, KURT
             - Add parameters MAXVAL and MAXTYPE.
             

    Processes DESPIKE and TREDIT are identical, yet both may be in
the same PROCS LIST.   Processes DESPIKE and TREDIT are trace 
editing processes that remove spikes or kill traces that are "bad".
   Every sample is checked for being NaN (not-a-number) and is replaced
with a zero if it is.

There are several different detection algorithms:

1)  Spike replacement.  Amplitudes less than thres(1) or greater than
    thres(2) are replaced by linear interpolation of the adjacent "good"
    amplitudes unless KILL YES is given, in which case the entire trace
    is killed.  Both THRES values must be given.  Parameters ALPHA,
    SETS, VEL, ADDWB, and KILL may be used in conjunction with this
    method.

2)  The Trehu/Sutton method described in Marine Gephysical Researches 
    16: 91-103, 1994.  The algorithm is based on a five point moving
    window that compares the difference of the outer points with the
    inner points.  spike = (ABS(a(3)-a(2)) + ABS(a(3)-a(4) 
                         > fac * (ABS(a(1)-a(2)) + ABS(a(4)-a(5)) 
    Spikes are replaced by linearly interpolating the adjacent
    "good" amplitudes or the entire trace may be killed if parameter
    KILL YES is given.  Parameter FAC must be given.  Parameters SETS,
    VEL, KILL, ALPHA, and ADDWB are honored.

3)  A method that detects when amplitudes exceed the given quartile.
    Amplitudes that exceed QUART are clipped (replaced by the QUART
    amplitude).  Parameter QUART must be given.  Parameters SETS, VEL,
    ADDWB, ALPHA, and KILL are honored.

4)  A window ratio algorithm where the trace is "bad" if the average
    amplitude of a "short" window over a "long" window exceeds the
    user given factor.  Parameters SES, SEL, and FAC must be given.  
    Parameters SETS, VEL, KILL, ALPHA, and ADDWB are honored.

5)  The trace is "bad" and killed if the average absolute value of
    the windows described by SETS exceeds the given threshold.
    Parameters SETS and THRES must be given; Two windows may be defined,
    but only 1 threshold may be given.  Parameters ADDWB, VEL, KILL,
    and ALPHA are also honored.

6)  The MEDIAN value is calculated for each time point within a gather.
    The trace set must be indicated by the "end-of-gather" flag of -1
    (set by process gather or by diskin parameter ntrgat).  This is NOT
    a median stack; see PROCESS STK for a median stack.  The 
    DESPIKE/TREDIT MEDIAN parameter simply returns the median value of
    all traces within a gather for each time point.  While a gather
    goes into computing the median, only a single trace is output for
    each gather set.

7.1  MINTYPE ABSVAL with parameter MINVAL kills a trace if no absolute
    trace value exceeds MINVAL.  Useful for detecting "dead" traces
    created during acquisition or padding in FK and DMO processes.
7.2  MAXTYPE ABSVAL with parameter MAXVAL kills a trace when any
    absolute trace value exceeds MAXVAL.
7.3  MINTYPE SDEV with parameter MINVAL kills a trace if the standard
    deviation of the trace does not exceed MINVAL.  
    Process PROUT parameter INFO 5 prints the statistics of the trace.
7.4  MAXTYPE SDEV with parameter MAXVAL kills a trace when any the
    stardard deviation of the trace exceeds MAXVAL.  
7.5  MINTYPE VAR with parameter MINVAL kills a trace if the variance
    of the trace does not exceed MINVAL.  
7.6  MAXTYPE VAR with parameter MAXVAL kills a trace when the
    variance of the trace exceeds MAXVAL.  
7.7  MINTYPE SKEW with parameter MINVAL kills a trace if the skew
    of the trace does not exceed MINVAL.  
7.8  MAXTYPE SKEW with parameter MAXVAL kills a trace when the
    skew of the trace exceeds MAXVAL.  
7.9  MINTYPE KURT with parameter MINVAL kills a trace if the kurtosis
    of the trace does not exceed MINVAL.  
7.10  MAXTYPE KURT with parameter MAXVAL kills a trace when the
    kurtosis of the trace exceeds MAXVAL.  

8)  Traces are killed when SEG-Y header values lie within user given
    LIMITS when KILL INSIDE is used or when the header values are
    outside LIMITS when KILL OUTSIDE is used.  This is an easy way
    to eliminate traces based on a SEG-Y header value such as the
    streamer depth.  The shallow or floating portion of the streamer
    can be excluded.

9)  "Local Trace Zeroing" or LTZ zeroes a portion of the trace if
    there are no zero crossing in a specified length of time.  This
    method was described by Stanghelli and Bonazzi in Geophysics 
    Vol 67, No.1 (Jan/Feb 2002), pg 188-196.  Parameter WINLEN is
    a sliding window for the sum of amplitudes used in determining
    when zero crossings occur.  Parameter HCYCLE (half cycle) is the
    maximum time permitted between zero crossings.  If the time
    between zero crossings exceeds HCYCLE, the trace between the
    zero crossings is zeroed.
        Marine data shot is rough seas often has long period streamer
    noise that overwhelms the signal.  The noise is not periodic
    and can not be removed by a frequency filter.  LTZ zeroes the
    portion of the trace when the low frequency noise is greater
    than the higher frequency signal.
    
    
    Only one fno/lno parameter list may be given.

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

PASS   - The passband of a 55 point time domain convolutional
         zero phase bandpass filter to apply before picking.
         The filtered data are NOT passed to the next seismic
         process, thus the filter is applied "offline".  The
         low and high "corners" of the filter must be given.
         Preset = none      e.g.  pass 100 200
         
MINTYPE - Allowable values are: ABSVAL, SDEV, VAR, SKEW, KURT
MAXTYPE - Allowable values are: ABSVAL, SDEV, VAR, SKEW, KURT
         Use process PROUT parameter INFO 5 to print the statistics.
MINVAL - The minimum value of type MINTYPE each trace must have to be
         considered a good trace.  When there is no value of type MINTYPE
         that exceeds MINVAL within the SET window, the trace is killed
         by setting all amplitudes to zero and setting the SEG-Y trace id
         to 2, indicating a dead trace to other SIOSEIS processes.
MAXVAL - The maximum value of type MAXTYPE allowable to be considered
         a good trace.  If any value of MAXTYPE exceeds MAXVAL, the trace
         will be set to zero and the SEGY dead trace flag will be set.

MEDIAN - When set to YES, the median sample for each time sample is
         computed.  The input trace set (gather) is replaced by a
         single trace which is the so called "median trace".
         Preset = NO

THRES  - Threshold for algorithms 1 and 5 described above.  Algorithm
         1 requires two threshold values, a minimum and a maximum,
         so that any amplitude less than thres(1) or greater than
         thres(2) is considered a spike.  If only one thres is given,
         then any trace with an average amplitude greater than the
         threshold is considered a spikey or wild trace and is 
         killed if KILL YES is given.
         Preset = 0 0    e.g.   thres -1.e6 1.e6

FAC    - The tolerance factor used in:
        1)  The Trehu/Sutton method described in Marine Gephysical
         Researches 16: 91-103, 1994.  The algorithm is based on a
         five point moving window.
        2)  The SES/SEL method described below.
         Preset = 0.   e.g. fac 5.

QUART  - Quartile, amplitudes above this quartile are replaced by
         the signed quartile value. ( QUART must be between 1 and
         100).  This algorithm came from CWP/SU.
         Preset = 0   e.g. quart 99.

SES    - Start and End times of the Short window when using the
         "short over long average" method.  SEL and FAC must be
         given also when using this method.  The trace is auto-
         matically killed (zeroed) when the ratio of the average
         absolute value of the samples in the SES window exceeds
         the average absolute value of the sample in the SEL
         window by a factor of FAC.  The average absolute value
         may be printed by using LPRINT 4.
         Preset = none.     
         e.g.  ses 0 .5 sel 1 2 fac .5     will cause the trace to be
         killed if SES / SEL exceeds .5

SEL    - Start and End times of the Long window when using the
         "short over long average" method.  SES and FAC must be
         given also when using this method.
         Preset = none.

ALPHA  - The trace is raised to the ALPHA power before detection is
         performed.  i.e. t(i) = t(i) ** alpha is done first.
         Preset = 1.       e.g.   alpha 2.

SETS   - Start and End Times for the spike detection.  Only the data
         within SETS is examined.  Used in all methods except the 
         SES/SEL and MEDIAN methods.  Only type 5 detection (average
         absolute value) uses two windows.
         Preset = The entire trace         e.g. 2.2 3.0 5 6

VEL    - The velocity to use to 'move-in' each design window time.
         Move-in is useful for describing window times that need
         to vary according to the shot-receiver distance, as in
         following a reflector on a record before nmo.  Each
         design window time will be determined from the equation:
         t=sqrt(t0*t0+x*x/(vel*vel)), where t0 is the normal
         incidence two way travel time, and x is the shot to
         receiver distance of the trace described via PROCESS GEOM.
         Preset=0.        e.g.   vel 1500

ADDWB  - When given a value of YES, the water bottom time will be
         added to all window times.  (Water bottom times may be
         entered via PROCESS WBT).
         Preset=no

KILL   - A switch when set to YES indicates that the trace be
         killed rather than just the spike be replaced.  It is also
         used with parameter LIMITS to define whether the trace
         header value governing the kill is INSIDE or OUTSIDE the
         LIMITS.
       = YES, Indicates that the entire trace should be killed rather
         than just the detected spike samples replaced.  Honored
         by THRES (type 1), SES/FAC (Trehu - type 2), and QUART.
       = FLAGONLY, sets the SEG-Y trace id to "dead trace" (word
         15 is set to 2), without zeroing the trace itself.  Honored
         whenever KILL YES is honored (THRES (type1), SES/SEL 
         (type 2) and QUART).
       = NO, Indicates that just the "spikes" should be replaced.
         Honored by THRES (type 1), SES/FAC (Trehu - type 2), and 
         QUART.
       = INSIDE, The trace is killed when the SEG-Y value is within
         or equal to the LIMITS.
       = OUTSIDE; The trace is killed when the SEG-Y header value
         is outside the LIMITS.
         Preset = no      e.g.   kill yes

LIMITS - The minimum and maximum values, or limits, of the SEG-Y
         header value indicated by parameters IHDR, LHDR, or HDR.
         The trace is killed (zeroed and tagged as dead) when the
         SEG-Y header value is out of the LIMITS range when parameter
         KILL OUTSIDE is given.  The trace is killed when the SEG-Y
         header value is within LIMITS when KILL INSIDE is given.
         Preset = 0 0    e.g.    limits 0 -50 kill outside lhdr 11
         Kills traces where SEG-Y long word 11 is greater than 0 or
         less than -50.  (see document segy.header.  The streamer
         depth was in cm (word 11 scaled by word 35.  Depth is
         negative in this case.)

HDR    - Indicates the index of the floating point SEG-Y header word to
         use with the LIMITS parameter.

LHDR   - Indicates the index of the 32 bit integer SEG-Y header word to
         use with the LIMITS parameter.

IHDR   - Indicates the index of the 16 bit integer SEG-Y header word to
         use with the LIMITS parameter.

WINLEN - The window length, in seconds, used in type 9 or LTZ (Local
         Trace Zeroing) where a portion of the trace is zeroed if no
         zero crossing are found with HCYCLE time.  WINLEN is the
         length of the window used in determining when zero crossing
         occur.

HCYCLE - The length of time, in seconds, of a "half cycle" of the
         noise train to be zeroed in the LTZ method.   The data
         are zeroed if there isn't a zero crossing within
         HCYCLE seconds.
         Preset = winlen / 2.

ENDMUTE - The mute start time relative to the detected spike rather
         than killing the entire trace.  Method 1, min/max spike
         detection only (thres neg pos).
         Preset = not given.   e.g.   endmute -.01   will mute from
         10 mils before the detected spike.

FNO    - The first shot/rp number the parameter list applies to.
         ONLY ONE FNO/LNO LIST IS HONORED.
         Preset = the first shot/rp received.    e.g.   fno 101

LNO    - The last shot/rp number the parameter list applies to.
         ONLY ONE FNO/LNO LIST IS HONORED.
         Preset = the last shot/rp received.    e.g.   lno 101

FTR    - The first trace number the parameter list applies to.
         Preset = the first trace of each shot/rp.    e.g.   ftr 10

LTR    - The last trace number the parameter list applies to.
         Preset = the last trace of each shot/rp.    e.g.   ltr 10

LPRINT - The secret debug switch.
       =4, The computed window arithmetic value is printed.  e.g.
         the average absolute value of the window is printed when
         type 5 depsiking is used.
       =8, Each trace that is killed is identified.

END    - Terminates the parameter list.


  Copyright (C) 1992, The Regents of the University of California
ALL RIGHTS RESERVED.
Go to the list of seismic processes.      Go to SIOSEIS introduction.