SUVELAN - compute stacking velocity semblance for cdp gathers

 suvelan <stdin >stdout [optional parameters]                         

 Optional Parameters:                                           
 nv=50                   number of velocities                         
 dv=50.0                 velocity sampling interval                   
 fv=1500.0               first velocity                         
 anis1=0.0               quartic term, numerator of an extended quartic term
 anis2=0.0               in denominator of an extended quartic term        
 smute=1.5               samples with NMO stretch exceeding smute are zeroed
 dtratio=5               ratio of output to input time sampling intervals  
 nsmooth=dtratio*2+1     length of semblance num and den smoothing window  
 verbose=0               =1 for diagnostic print on stderr            
 pwr=1.0                 semblance value to the power                  

 Notes:                                                   
 Velocity analysis is usually a two-dimensional screen for optimal values of the vertical two-way traveltime and stacking velocity. But if the travel- time curve is no longer close to a hyperbola, the quartic term of the traveltime series should be considered. In its easiest form (with anis2=0) the optimizion of all parameters requires a three-dimensional screen. This is done by a repetition of the conventional two-dimensional screen with a variation of the quartic term. The extended quartic term is more accurate, though the function is no more a polynomial. When screening for optimal values the theoretical dependencies between these paramters can be taken into account. The traveltime function is defined by

                1            anis1                                         
 t^2 = t_0^2 + --- x^2 + ------------- x^4                                 
               v^2       1 + anis2 x^2                                     

 The coefficients anis1, anis2 are assumed to be small, that means the non-hyperbolicity is assumed to be small. Triplications cannot be handled.    

 Semblance is defined by the following quotient:                      

                 n-1                                                   
               [ sum q(t,j) ]^2                                        
                 j=0                                                   
       s(t) = ------------------                                       
                 n-1                                                   
               n sum [q(t,j)]^2                                        
                 j=0                                                   

 where n is the number of non-zero samples after muting.              
 Smoothing (nsmooth) is applied separately to the numerator and denominator before computing this semblance quotient.                        

 Then, the semblance is set to the power of the parameter pwr. With pwr > 1 the difference between semblance values is stretched in the upper half of the range of semblance values [0,1], but compressed in the lower half of it; thus, the few large semblance values are enhanced. With pwr < 1 the many small values are enhanced, thus more discernible against background noise. Of course, always at the expanse of the respective other feature.  

 Input traces should be sorted by cdp - suvelan outputs a group of semblance traces every time cdp changes.  Therefore, the output will be useful only if cdp gathers are input.                            

 Credits:
      CWP, Colorado School of Mines:
           Dave Hale (everything except ...)
           Bjoern Rommel (... the quartic term)
      SINTEF, IKU Petroleumsforskning
           Bjoern Rommel (... the power-of-semblance function)

 Trace header fields accessed:  ns, dt, delrt, offset, cdp
 Trace header fields modified:  ns, dt, offset, cdp