SYNOPSIS

PERL PROGRAM NAME:

AUTHOR: Juan Lorenzo (Perl module only)

DATE:

DESCRIPTION:

Version:

USE

NOTES

Examples

SYNOPSIS

SEISMIC UNIX NOTES SUSTATICRRS - Elevation STATIC corrections, apply corrections from

	      headers or from a source and receiver statics file,	

	      includes application of Residual Refraction Statics	



     sustaticrrs <stdin >stdout  [optional parameters]	 		



 Required parameters:							

	none								

 Optional Parameters:							

	v0=v1 or user-defined	or from header, weathering velocity	

	v1=user-defined		or from header, subweathering velocity	

	hdrs=0			=1 to read statics from headers		

 				=2 to read statics from files		

	sign=1			=-1 to subtract statics from traces(up shift)

 Options when hdrs=2:							

	sou_file=		input file for source statics (ms) 	

	rec_file=		input file for receiver statics (ms) 	

	ns=240 			number of sources 			

	nr=335 			number of receivers 			

	no=96 			number of offsets			



 Options when hdrs=3:                                                  

       blvl_file=              base of the near-surface model file (sampled

                                  at CMP locations)                    

       refr_file=              horizontal reference datum file (sampled at

                                  CMP locations)                       

       nsamp=                  number of midpoints on line             

       fx=                     first x location in velocity model      

       dx=                     midpoint interval                       

       V_r=                    replacement velocity                    

       mx=                     number of velocity model samples in     

                                  lateral direction                    

       mz=                     number of velocity model samples in     

                                  vertical direction                   

       dzv=                    velocity model depth interval           

       vfile=                  near-surface velocity model             



 Options when hdrs=4:                                                  

       nsamp=                  number of midpoints on line             

       fx=                     first x location in velocity model      ", 

       dx=                     midpoint interval                       ", 



 Options when hdrs=5:                                                  

       none                                                            



 Notes:								

 For hdrs=1, statics calculation is not performed, statics correction  

 is applied to the data by reading statics (in ms) from the header.	



 For hdrs=0, field statics are calculated, and				

 	input field sut is assumed measured in ms.			

 	output field sstat equals 10^scalel*(sdel - selev + sdepth)/swevel	

 	output field gstat equals sstat - sut/1000.				

 	output field tstat equals sstat + gstat + 10^scalel*(selev - gelev)/wevel



 For hdrs=2, statics are surface consistently obtained from the 	

 statics files. The geometry should be regular.			

 The source- and receiver-statics files should be unformated C binary 	

 floats and contain the statics (in ms) as a function of surface location.



 For hdrs=3, residual refraction statics and average refraction statics

 are computed.  For hdrs=4, residual refraction statics are applied,   

 and for hdrs=5, average refraction statics are applied (Cox, 1999).   

 These three options are coupled in many data processing sequences:    

 before stack residual and average refraction statics are computed but 

 only residual refractions statics are applied, and after stack average

 refraction statics are applied.  Refraction statics are often split   

 like this to avoid biasing stacking velocities.  The files blvl_file  

 and refr_file are the base of the velocity model defined in vfile and 

 the final reference datum, as described by Cox (1999), respectively.  

 Residual refraction statics are stored in the header field gstat, and 

 the average statics are stored in the header field tstat.  V_r is the 

 replacement velocity as described by Cox (1999).  The velocity file,  

 vfile, is designed to work with a horizontal upper surface defined in 

 refr_file.  If the survey has irregular topography, the horizontal    

 upper surface should be above the highest topographic point on the    

 line, and the velocity between this horizontal surface and topography 

 should be some very large value, such as 999999999, so that the       

 traveltimes through that region are inconsequential.                  



 Credits:

	CWP: Jamie Burns



	CWP: Modified by Mohammed Alfaraj, 11/10/1992, for reading

	     statics from headers and including sign (+-) option



      CWP: Modified by Timo Tjan, 29 June 1995, to include input of

           source and receiver statics from files. 



      CWP: Modified by Chris Robinson, 11/2000, to include the splitting

           of refraction statics into residuals and averages



 Trace header fields accessed:  ns, dt, delrt, gelev, selev,

	sdepth, gdel, sdel, swevel, sut, scalel

 Trace header fields modified:  sstat, gstat, tstat



 References:



 Cox, M., 1999, Static corrections for seismic reflection surveys:

    Soc. Expl. Geophys.

User's notes (Juan Lorenzo) untested

CHANGES and their DATES

Import packages

instantiation of packages

Encapsulated hash of private variables

sub Step

collects switches and assembles bash instructions by adding the program name

sub note

collects switches and assembles bash instructions by adding the program name

sub clear

sub V_r

sub blvl_file

sub dx

sub dzv

sub fx

sub hdrs

sub mx

sub mz

sub no

sub nr

sub ns

sub nsamp

sub rec_file

sub refr_file

sub sign

sub sou_file

sub v0

sub v1

sub vfile

sub get_max_index

max index = number of input variables -1