This is the main directory devoted to illustrating selecting, windowing,
and time gating of traces.  If you are new to SU, start by reading
the tutorial document "The SU User's Manual".

This illustration is a companion to the Sort demo, if you look at one,
you should look at the other, since these operations are so interlinked.

The X and PS scripts pop up several examples of selecting.  These demo
scripts are meant to be READ.  Then you can clone what you need for
your application.  To avoid too many X windows coming up at once, the
X demo is in 3 parts: Xselect1, Xselect2, Xselect3.  The PS demo
is PSselect.

The command "zap xmovie" will destroy all the xmovie windows at once.
Similarly for xgraph and xwigb windows.

You can remove the modeldata and temporary files with the "Clean"
command.

For real examples, see Cdpsort, Cos, Cvstack, Getcdps, Nmoscan, Segyread
in the CWPROOT/src/su/examples subdirectory.

Jack--03/94

---------------------------------------------------------------
Notes:  The tutorials/demos in the Sorting_Traces directory are
	relevant to selecting as well.

	There are two basic selecting commands. suwind selects
	traces based on header key words; suresamp selects portions
	of each trace (and resamples if necessary).

---------------------------------------------------------------
Self-Docs:

 SUWIND - window traces by key word                                    
                                                                       
 suwind <stdin >stdout [options]                                       
                                                                       
 Required Parameters:                                                  
        none                                                           
                                                                       
 Optional Parameters:                                                  
        verbose=0       =1 for verbose                                  
        key=tracl       Key header word to window on (see segy.h)       
        min=LONG_MIN    min value of key header word to pass            
        max=LONG_MAX    max value of key header word to pass            
        abs=0           =1 to take absolute value of key header word    
        j=1             Pass every j-th trace ...                       
        s=0             ... based at s  (if ((key - s)%j) == 0)         
        count=ULONG_MAX ... up to count traces                          
        reject=none     Skip traces with specified key values           
        accept=none     Pass traces with specified key values           
 Notes:                                                         
        On large data sets, the count parameter should be set if        
        possible.  Otherwise, every trace in the data set will be       
        examined.  However, the count parameter over-rides the accept   
        parameter, so you can't specify count if you want true          
        unconditional acceptance.                                       
                                                                        
        On most 32 bit machines, LONG_MIN, LONG_MAX and ULONG_MAX are   
        about -2E9,+2E9 and 4E9, they are defined in limits.h.          
                                                                        
        Older versions of suwind also did time gating.  Timegating is   
        now handled by the program suresamp.                            

---------------------------------------------------------------
 SURESAMP - Resample in time                                    
                                                                
 suresamp <stdin >stdout  [optional parameters]         
                                                                
 Required parameters:                                           
        none                                                    
                                                                
 Optional Parameters:                                           
        nt=tr.ns            number of time samples on output    
        dt=tr.dt/10^6       time sampling interval on output    
        tmin=tr.delrt/10^3  first time sample on output         
                                                                
 Example 1: (assume original data had dt=.004 nt=256)           
        sufilter <data f=40,50 amps=1.,0. |                     
        suresamp nt=128 dt=.008 | ...                           
 Note the typical anti-alias filtering before sub-sampling.     
 Example 2: (assume original data had dt=.004 nt=256)           
        suresamp <data nt=512 dt=.002 | ...                     
                                                                
 Trace header fields accessed:  ns, dt, delrt                   
 Trace header fields modified:  ns, dt, delrt                   

---------------------------------------------------------------
 SUFILTER - applies a zero-phase, sine-squared tapered filter           
                                                                        
 sufilter <stdin >stdout [optional parameters]                  
                                                                        
 Required parameters:                                                   
       if dt is not set in header, then dt is mandatory         
                                                                        
 Optional parameters:                                                   
       f=f1,f2,...             array of filter frequencies(HZ)  
       amps=a1,a2,...          array of filter amplitudes               
       dt = (from header)      time sampling rate (sec)         
                                                                        
 Defaults:f=.10*(nyquist),.15*(nyquist),.45*(nyquist),.50*(nyquist)     
                        (nyquist calculated internally)         
          amps=0.,1.,...,1.,0.  trapezoid-like bandpass filter          
                                                                        
 Examples of filters:                                                   
 Bandpass:   sufilter <data f=10,20,40,50 | ...                 
 Bandreject: sufilter <data f=10,20,30,40 amps=1.,0.,0.,1. | .. 
 Lowpass:    sufilter <data f=10,20,40,50 amps=1.,1.,0.,0. | ...        
 Highpass:   sufilter <data f=10,20,40,50 amps=0.,0.,1.,1. | ...        
 Notch:      sufilter <data f=10,12.5,35,50,60 amps=1.,.5,0.,.5,1. |..  

--------
 SUSYNLV - SYNthetic seismograms for Linear Velocity function           
                                                                        
 susynlv >outfile [optional parameters]                         
                                                                        
 Optional Parameters:                                                   
 nt=101                 number of time samples                          
 dt=0.04                time sampling interval (sec)                    
 ft=0.0                 first time (sec)                                
 nxo=1                  number of source-receiver offsets               
 dxo=0.05               offset sampling interval (km)                   
 fxo=0.0                first offset (km, see notes below)              
 xo=fxo,fxo+dxo,...     array of offsets (use only for non-uniform offsets)
 nxm=101                number of midpoints (see notes below)           
 dxm=0.05               midpoint sampling interval (km)         
 fxm=0.0                first midpoint (km)                             
 nxs=101                number of shotpoints (see notes below)          
 dxs=0.05               shotpoint sampling interval (km)                
 fxs=0.0                first shotpoint (km)                            
 x0=0.0                 distance x at which v00 is specified            
 z0=0.0                 depth z at which v00 is specified               
 v00=2.0                velocity at x0,z0 (km/sec)                      
 dvdx=0.0               derivative of velocity with distance x (dv/dx)  
 dvdz=0.0               derivative of velocity with depth z (dv/dz)     
 fpeak=0.2/dt           peak frequency of symmetric Ricker wavelet (Hz)
 ref="1:1,2;4,2"        reflector(s):  "amplitude:x1,z1;x2,z2;x3,z3;..."
 smooth=0               =1 for smooth (piecewise cubic spline) reflectors
 er=0                   =1 for exploding reflector amplitudes           
 ls=0                   =1 for line source; default is point source     
 ob=1                   =1 to include obliquity factors         
 tmin=10.0*dt           minimum time of interest (sec)                  
 ndpfz=5                number of diffractors per Fresnel zone          
 verbose=1              =1 to print some useful information             
                                                                        
Notes:                                                          
Offsets are signed - may be positive or negative.  Receiver locations   
are computed by adding the signed offset to the source location.        
                                                                        
Specify either midpoint sampling or shotpoint sampling, but not both.   
If neither is specified, the default is the midpoint sampling above.    
                                                                        
More than one ref (reflector) may be specified.  When obliquity factors
are included, then only the left side of each reflector (as the x,z     
reflector coordinates are traversed) is reflecting.  For example, if x  
coordinates increase, then the top side of a reflector is reflecting.   
Note that reflectors are encoded as quoted strings, with an optional    
reflector amplitude: preceding the x,z coordinates of each reflector.   
Default amplitude is 1.0 if amplitude: part of the string is omitted.   
