SURESSTAT - Surface consistent source and receiver statics calculation

   suresstat <stdin [optional parameters]                  

 Required parameters:                                      
 ssol=            output file source statics                     
 rsol=            output file receiver statics                   

 Optional parameters:                                      
 ntcc=250   number of samples in the cross-correlation window    
 ntpick=50 number of samples in the picking window              
 n_o=7      near-offset position relative to the shot      
 niter=5    number of iterations                           
 ns=240     number of shots                                
 nr=335     number of receivers                            
 nc=574     number of cmp's                                
 sfold=96   shot gather fold                         
 rfold=96   receiver gather fold                           
 cfold=48   cmp gather fold                                
 sub=0      subtract super trace 1 from super trace 2 (=1)       
 mode=0     use global maximum in cross-correllation window      
            =1 choose the peak perc=percent smaller than the global max.
 perc=10.   percent of global max (used only for mode=1)         
 icmpshift=9      shift applied to icmp index                    

 Notes:                                              
 Estimates surface-consistent source and receiver statics, meaning that
 there is one static correction value estimated for each shot and receiver
 position.                                           

 The method employed here is based on the method of Ronen and Claerbout:
 Geophysics 50, 2759-2767 (1985).                          

 The input consists of moveout-corrected SU data sorted in shot gathers.
 The output files are ascii files containing the source and receiver   
 statics, as a function of surface position sx and gx, respectively.   

 The code builds a supertrace1 and supertrace2, which are subsequently 
 cross-correllated. The program then picks the time lag associated with
 the largest peak in the cross-correllation according to two possible  
 criteria set by the parameter "mode". If mode=0, the maximum of the   
 cross-correllation window is chosen. If mode=1, the program will pick
 a peak which is up to perc=percent smaller than the global maximum, but
 closer to zero lag than the global maximum.    (Choosing mode=0 is    
 recommended.)                                             

 Caveat: This program does not really work for general datasets. What  
 is needed is for some person who understands residual statics to fix 
 the code, and email the fixed version to CWP so we can have a working 
 version.                                            

 Reference:

  Ronen, J. and Claerbout, J., 1985, Surface-consistent residual statics
      estimation  by stack-power maximization: Geophysics, vol. 50,
      2759-2767.

 Credits:
      CWP: Timo Tjan, 4 October 1994

 Trace header fields accessed: ns, dt