Selfdocs 600dpi A4
Selfdocs 600dpi A4
Selfdocs 600dpi A4
Program Self-Documentations
generated by GENDOCS,
a shell script by John Stockwell
Center for Wave Phenomena
Colorado School of Mines
Mains:
In CWPROOT/src/cwp/main:
* CTRLSTRIP - Strip non-graphic characters
* DOWNFORT - change Fortran programs to lower case, preserving strings
* FCAT - fast cat with 1 read per file
* ISATTY - pass on return from isatty(2)
* MAXINTS - Compute maximum and minimum sizes for integer types
* PAUSE - prompt and wait for user signal to continue
* T - time and date for non-military types
* UPFORT - change Fortran programs to upper case, preserving strings
In CWPROOT/src/par/main:
A2B - convert ascii floats to binary
B2A - convert binary floats to ascii
CSHOTPLOT - convert CSHOT data to files for CWP graphers
DZDV - determine depth derivative with respect to the velocity ",
FARITH - File ARITHmetic -- perform simple arithmetic with binary files
FTNSTRIP - convert a file of binary data plus record delimiters created
FTNUNSTRIP - convert C binary floats to Fortran style floats
GRM - Generalized Reciprocal refraction analysis for a single layer
H2B - convert 8 bit hexidecimal floats to binary
HTI2STIFF - convert HTI parameters alpha, beta, d(V), e(V), gamma
HUDSON - compute effective parameters of anisotropic solids
KAPERTURE - generate the k domain of a line scatterer for a seismic array
LINRORT - linearized P-P, P-S1 and P-S2 reflection coefficients
1
SMOOTH2 --- SMOOTH a uniformly sampled 2d array of data, within a user-
SMOOTH3D - 3D grid velocity SMOOTHing by the damped least squares
SMOOTHINT2 --- SMOOTH non-uniformly sampled INTerfaces, via the damped
STIFF2VEL - Transforms 2D elastic stiffnesses to (vp,vs,epsilon,delta)
SUBSET - select a SUBSET of the samples from a 3-dimensional file
SWAPBYTES - SWAP the BYTES of various data types
THOM2HTI - Convert Thompson parameters V_p0, V_s0, eps, gamma,
THOM2STIFF - convert Thomsen’s parameters into (density normalized)
TRANSP - TRANSPose an n1 by n2 element matrix
TVNMOQC - Check tnmo-vnmo pairs; create t-v column files
UNIF2ANISO - generate a 2-D UNIFormly sampled profile of elastic
UNIF2 - generate a 2-D UNIFormly sampled velocity profile from a layered
UNISAM2 - UNIformly SAMple a 2-D function f(x1,x2)
UNISAM - UNIformly SAMple a function y(x) specified as x,y pairs
UTMCONV - CONVert longitude and latitude to UTM, and vice versa
VEL2STIFF - Transforms VELocities, densities, and Thomsen or Sayers
VELCONV - VELocity CONVersion
VELPERTAN - Velocity PERTerbation analysis in ANisotropic media to
VELPERT - estimate velocity parameter perturbation from covariance
VTLVZ -- Velocity as function of Time for Linear V(Z);
WKBJ - Compute WKBJ ray theoretic parameters, via finite differencing
XY2Z - converts (X,Y)-pairs to spike Z values on a uniform grid
Z2XYZ - convert binary floats representing Z-values to ascii
In CWPROOT/src/psplot/main:
PSBBOX - change BoundingBOX of existing PostScript file
PSCONTOUR - PostScript CONTOURing of a two-dimensional function f(x1,x2)
PSCUBE - PostScript image plot with Legend of a data CUBE
PSCCONTOUR - PostScript Contour plot of a data CUBE
PSEPSI - add an EPSI formatted preview bitmap to an EPS file
PSGRAPH - PostScript GRAPHer
PSIMAGE - PostScript IMAGE plot of a uniformly-sampled function f(x1,x2)
PSLABEL - output PostScript file consisting of a single TEXT string
PSMANAGER - printer MANAGER for HP 4MV and HP 5Si Mx Laserjet
PSMERGE - MERGE PostScript files
PSMOVIE - PostScript MOVIE plot of a uniformly-sampled function f(x1,x2,x3)
PSWIGB - PostScript WIGgle-trace plot of f(x1,x2) via Bitmap
PSWIGP - PostScript WIGgle-trace plot of f(x1,x2) via Polygons
In CWPROOT/src/xplot/main:
* LCMAP - List Color Map of root window of default screen
* LPROP - List PROPerties of root window of default screen of display
* SCMAP - set default standard color map (RGB_DEFAULT_MAP)
2
XCONTOUR - X CONTOUR plot of f(x1,x2) via vector plot call
* XESPB - X windows display of Encapsulated PostScript as a single Bitmap
* XEPSP - X windows display of Encapsulated PostScript
XIMAGE - X IMAGE plot of a uniformly-sampled function f(x1,x2)
XPICKER - X wiggle-trace plot of f(x1,x2) via Bitmap with PICKing
* XPSP - Display conforming PostScript in an X-window
XWIGB - X WIGgle-trace plot of f(x1,x2) via Bitmap
In CWPROOT/src/Xtcwp/main:
XGRAPH - X GRAPHer
XMOVIE - image one or more frames of a uniformly sampled function f(x1,x2)
XRECTS - plot rectangles on a two-dimensional grid
In CWPROOT/src/Xmcwp/main:
* FFTLAB - Motif-X based graphical 1D Fourier Transform
In CWPROOT/src/su/graphics/psplot:
SUPSCONTOUR - PostScript CONTOUR plot of a segy data set
SUPSCUBE - PostScript CUBE plot of a segy data set
SUPSCUBECONTOUR - PostScript CUBE plot of a segy data set
SUPSGRAPH - PostScript GRAPH plot of a segy data set
SUPSIMAGE - PostScript IMAGE plot of a segy data set
SUPSMAX - PostScript of the MAX, min, or absolute max value on each trace
SUPSMOVIE - PostScript MOVIE plot of a segy data set
SUPSWIGB - PostScript Bit-mapped WIGgle plot of a segy data set
SUPSWIGP - PostScript Polygon-filled WIGgle plot of a segy data set
In CWPROOT/src/su/main:
BHEDTOPAR - convert a Binary tape HEaDer file to PAR file format
DT1TOSU - Convert ground-penetrating radar data in the Sensors & Software
LAS2SU - convert las2 format well log curves to su traces
SEGYCLEAN - zero out unassigned portion of header
char* sdoc[] = {
SEGYHDRS - make SEG-Y ascii and binary headers for segywrite
SEGYREAD - read an SEG-Y tape
SEGYWRITE - write an SEG-Y tape
SETBHED - SET the fields in a SEGY Binary tape HEaDer file, as would be
SU3DCHART - plot x-midpoints vs. y-midpoints for 3-D data
SUABSHW - replace header key word by its absolute value
SUACOR - auto-correlation
char* sdoc[] = {
SUADDNOISE - add noise to traces
3
SUADDSTATICS - ADD random STATICS on seismic data
SUALFORD - trace by trace Alford Rotation of shear wave data volumes
SUAMP - output amp, phase, real or imag trace from
SUASCII - print non zero header values and data in various formats
SUATTRIBUTES - instantaneous trace ATTRIBUTES
SUAZIMUTH - compute trace AZIMUTH, offset, and midpoint coordinates
SUBFILT - apply Butterworth bandpass filter
SUCCWT - Complex continuous wavelet transform of seismic traces
SUCDDECON - DECONvolution with user-supplied filter by straightforward
SUCENTSAMP - CENTRoid SAMPle seismic traces
SUCHART - prepare data for x vs. y plot
SUCHW - Change Header Word using one or two header word fields
SUCLIPHEAD - Clip header values
char* sdoc[] = {
SUCOMMAND - pipe traces having the same key header word to command
SUCONV - convolution with user-supplied filter
SUCOUNTKEY - COUNT the number of unique values for a given KEYword.
SUCWT - generates Continous Wavelet Transform amplitude, regularity
SUDATUMFD - 2D zero-offset Finite Difference acoustic wave-equation
SUDATUMK2DR - Kirchhoff datuming of receivers for 2D prestack data
SUDATUMK2DS - Kirchhoff datuming of sources for 2D prestack data
SUDIPDIVCOR - Dip-dependent Divergence (spreading) correction
SUDIPFILT - DIP--or better--SLOPE Filter in f-k domain
SUDIVCOR - Divergence (spreading) correction
SUDIVSTACK - Diversity Stacking using either average power or peak
SUDMOFK - DMO via F-K domain (log-stretch) method for common-offset gathers
SUDMOFKCW - converted-wave DMO via F-K domain (log-stretch) method for
SUDMOTIVZ - DMO for Transeversely Isotropic V(Z) media for common-offset
SUDMOTX - DMO via T-X domain (Kirchhoff) method for common-offset gathers
SUDMOVZ - DMO for V(Z) media for common-offset gathers
SUDUMPTRACE - print selected header values and data.
SUEA2DF - SU version of (an)elastic anisotropic 2D finite difference
char* sdoc[] = {
SUEIPOFI - EIgenimage (SVD) based POlarization FIlter for
SUFCTANISMOD - Flux-Corrected Transport correction applied to the 2D
SUFDMOD1 - Finite difference modelling (1-D 1rst order) for the
SUFDMOD2 - Finite-Difference MODeling (2nd order) for acoustic wave equation
SUFDMOD2_PML - Finite-Difference MODeling (2nd order) for acoustic wave
SUFFT - fft real time traces to complex frequency traces
SUFILTER - applies a zero-phase, sine-squared tapered filter
SUFLIP - flip a data set in various ways
SUFNZERO - get Time of First Non-ZERO sample by trace
SUFRAC -- take general (fractional) time derivative or integral of
4
SUFXDECON - random noise attenuation by FX-DECONvolution
SUGABOR - Outputs a time-frequency representation of seismic data via
SUGAIN - apply various types of gain to display traces
SUGAUSSTAPER - Multiply traces with gaussian taper
SUGAZMIGQ - SU version of Jeno GAZDAG’s phase-shift migration
SUGET - Connect SU program to file descriptor for input stream.
SUGETHW - sugethw writes the values of the selected key words
SUGOUPILLAUD - calculate 1D impulse response of
SUGOUPILLAUDPO - calculate Primaries-Only impulse response of a lossless
SUHARLAN - signal-noise separation by the invertible linear
SUHILB - Hilbert transform
char *sdoc[] = {
SUHROT - Horizontal ROTation of three-component data
SUHTMATH - do unary arithmetic operation on segy traces with
SUIFFT - fft complex frequency traces to real time traces
SUILOG -- time axis inverse log-stretch of seismic traces
SUIMP2D - generate shot records for a line scatterer
SUIMP3D - generate inplane shot records for a point
SUIMPEDANCE - Convert reflection coefficients to impedances.
SUINTERP - interpolate traces using automatic event picking
SUINTVEL - convert stacking velocity model to interval velocity model
SUINVXZCO - Seismic INVersion of Common Offset data for a smooth
SUINVZCO3D - Seismic INVersion of Common Offset data with V(Z) velocity
SUK1K2FILTER - symmetric box-like K-domain filter defined by the
SUKDMIG2D - Kirchhoff Depth Migration of 2D poststack/prestack data
SUKDMIG3D - Kirchhoff Depth Migration of 3D poststack/prestack data
SUKDSYN2D - Kirchhoff Depth SYNthesis of 2D seismic data from a
SUKEYCOUNT - sukeycount writes a count of a selected key
SUKFILTER - radially symmetric K-domain, sin^2-tapered, polygonal
SUKFRAC - apply FRACtional powers of i|k| to data, with phase shift
SUKILL - zero out traces
SULOG -- time axis log-stretch of seismic traces
char *sdoc[] = {
SUMEAN - get the mean values of data traces ",
SUMEDIAN - MEDIAN filter about a user-defined polygonal curve with
SUMIGFD - 45-90 degree Finite difference depth migration for
SUMIGFFD - Fourier finite difference depth migration for
SUMIGGBZOAN - MIGration via Gaussian beams ANisotropic media (P-wave)
SUMIGGBZO - MIGration via Gaussian Beams of Zero-Offset SU data
SUMIGPREFD --- The 2-D prestack common-shot 45-90 degree
SUMIGPREFFD - The 2-D prestack common-shot Fourier finite-difference
SUMIGPREPSPI --- The 2-D PREstack commom-shot Phase-Shift-Plus
SUMIGPRESP - The 2-D prestack common-shot split-step Fourier ",
5
SUMIGPS - MIGration by Phase Shift with turning rays
SUMIGPSPI - Gazdag’s phase-shift plus interpolation depth migration
SUMIGPSTI - MIGration by Phase Shift for TI media with turning rays
SUMIGSPLIT - Split-step depth migration for zero-offset data.
SUMIGTK - MIGration via T-K domain method for common-midpoint stacked data
SUMIGTOPO2D - Kirchhoff Depth Migration of 2D postack/prestack data
SUMIX - compute weighted moving average (trace MIX) on a panel
SUMIXGATHERS - mix two gathers
SUMUTE - mute above (or below) a user-defined polygonal curve with ",
SUNAN - remove NaNs & Infs from the input stream
SUNHMOSPIKE - generates SPIKE test data set with a choice of several
SUNMO - NMO for an arbitrary velocity function of time and CDP
SUNORMALIZE - Trace balancing by rms, max, or median ",
SUNULL - create null (all zeroes) traces
SUOCEXT - smaller Offset EXTrapolation via Offset Continuation
SUOLDTONEW - convert existing su data to xdr format
SUOP2 - do a binary operation on two data sets
SUOP - do unary arithmetic operation on segys
SUPACK1 - pack segy trace data into chars
SUPACK2 - pack segy trace data into 2 byte shorts
SUPASTE - paste existing SEGY headers on existing data
SUPEF - Wiener predictive error filtering
SUPERMUTE - permute or transpose a 3d datacube
SUPGC - Programmed Gain Control--apply agc like function
SUPICKAMP - pick amplitudes within user defined and resampled window
SUPLANE - create common offset data file with up to 3 planes
SUPOFILT - POlarization FILTer for three-component data
SUPOLAR - POLarization analysis of three-component data
SUPUT - Connect SU program to file descriptor for output stream.
SUPWS - Phase stack or phase-weighted stack (PWS) of adjacent traces
SUQUANTILE - display some quantiles or ranks of a data set
SURADON - compute forward or reverse Radon transform or remove multiples
SURAMP - Linearly taper the start and/or end of traces to zero.
SURANDSPIKE - make a small data set of RANDom SPIKEs
SURANDSTAT - Add RANDom time shifts STATIC errors to seismic traces
SURANGE - get max and min values for non-zero header entries
SURECIP - sum opposing offsets in prepared data (see below)
SUREDUCE - convert traces to display in reduced time ",
SUREFCON - Convolution of user-supplied Forward and Reverse
SURELANAN - REsiduaL-moveout semblance ANalysis for ANisotropic media
SURELAN - compute residual-moveout semblance for cdp gathers based
SURESAMP - Resample in time
SURESSTAT - Surface consistent source and receiver statics calculation
6
SUSHAPE - Wiener shaping filter
SUSHIFT - shifted/windowed traces in time
SUSHW - Set one or more Header Words using trace number, mod and
SUSORT - sort on any segy header keywords
SUSORTY - make a small 2-D common shot off-end
SUSPECFK - F-K Fourier SPECtrum of data set
SUSPECFX - Fourier SPECtrum (T -> F) of traces
SUSPECK1K2 - 2D (K1,K2) Fourier SPECtrum of (x1,x2) data set
SUSPIKE - make a small spike data set
SUSPLIT - Split traces into different output files by keyword value
SUSTACK - stack adjacent traces having the same key header word
SUSTATIC - Elevation static corrections, apply corrections from
SUSTATICRRS - Elevation STATIC corrections, apply corrections from
SUSTKVEL - convert constant dip layer interval velocity model to the
SUSTOLT - Stolt migration for stacked data or common-offset gathers
SUSTRIP - remove the SEGY headers from the traces
SUSWAPBYTES - SWAP the BYTES in SU data to convert data from big endian
SUSYNCZ - SYNthetic seismograms for piecewise constant V(Z) function
SUSYNLV - SYNthetic seismograms for Linear Velocity function
SUSYNLVCW - SYNthetic seismograms for Linear Velocity function
SUSYNLVFTI - SYNthetic seismograms for Linear Velocity function in a
SUSYNVXZ - SYNthetic seismograms of common offset V(X,Z) media via
SUSYNVXZCS - SYNthetic seismograms of common shot in V(X,Z) media via
SUTAB - print non zero header values and data for non-graphic terminals
SUTAPER - Taper the edge traces of a data panel to zero.
SUTAUP - forwared and inverse T-X and F-K global slant stacks
SUTIFOWLER VTI constant velocity prestack time migration
SUTIHALEDMO - TI Hale Dip MoveOut (based on Hale’s PhD thesis)
SUTIVEL - SU Transversely Isotropic velocity table builder
SUTSQ -- time axis time-squared stretch of seismic traces
SUTTOZ - resample from time to depth
SUTVBAND - time-variant bandpass filter (sine-squared taper)
SUTXTAPER - TAPER in (X,T) the edges of a data panel to zero.
SUUNPACK1 - unpack segy trace data from chars to floats
SUUNPACK2 - unpack segy trace data from shorts to floats
SUUTM - UTM projection of longitude and latitude in SU trace headers
SUVCAT - append one data set to another, with or without an ",
SUVEL2DF - compute stacking VELocity semblance for a single time in
SUVELAN - compute stacking velocity semblance for cdp gathers
SUVELAN_NCCS - compute stacking VELocity panel for cdp gathers
SUVELAN_NSEL - compute stacking VELocity panel for cdp gathers
SUVELAN_UCCS - compute stacking VELocity panel for cdp gathers
SUVELAN_USEL - compute stacking velocity panel for cdp gathers
7
SUVIBRO - Generates a Vibroseis sweep (linear, linear-segment,
SUVLENGTH - Adjust variable length traces to common length
SUWAVEFORM - generate a seismic wavelet
SUWEIGHT - weight traces by header parameter, such as offset
SUWELLRF - convert WELL log depth, velocity, density data into a
SUWIND - window traces by key word
SUXCOR - correlation with user-supplied filter
SUXEDIT - examine segy diskfiles and edit headers
SUZERO -- zero-out (or set constant) data within a time window
SUZTOT - resample from depth to time
In CWPROOT/src/su/graphics/psplot:
SUPSCONTOUR - PostScript CONTOUR plot of a segy data set
SUPSCUBE - PostScript CUBE plot of a segy data set
SUPSCUBECONTOUR - PostScript CUBE plot of a segy data set
SUPSGRAPH - PostScript GRAPH plot of a segy data set
SUPSIMAGE - PostScript IMAGE plot of a segy data set
SUPSMAX - PostScript of the MAX, min, or absolute max value on each trace
SUPSMOVIE - PostScript MOVIE plot of a segy data set
SUPSWIGB - PostScript Bit-mapped WIGgle plot of a segy data set
SUPSWIGP - PostScript Polygon-filled WIGgle plot of a segy data set
In CWPROOT/src/su/graphics/xplot:
SUXCONTOUR - X CONTOUR plot of Seismic UNIX tracefile via vector plot call
SUXGRAPH - X-windows GRAPH plot of a segy data set
SUXIMAGE - X-windows IMAGE plot of a segy data set
SUXMAX - X-windows graph of the MAX, min, or absolute max value on
SUXMOVIE - X MOVIE plot of a 2D or 3D segy data set
SUXPICKER - X-windows WIGgle plot PICKER of a segy data set
SUXWIGB - X-windows Bit-mapped WIGgle plot of a segy data set
In CWPROOT/src/tri/main:
GBBEAM - Gaussian beam synthetic seismograms for a sloth model
NORMRAY - dynamic ray tracing for normal incidence rays in a sloth model
TRI2UNI - convert a TRIangulated model to UNIformly sampled model
TRIMODEL - make a triangulated sloth (1/velocity^2) model
TRIRAY - dynamic RAY tracing for a TRIangulated sloth model
TRISEIS - Gaussian beam synthetic seismograms for a sloth model
UNI2TRI - convert UNIformly sampled model to a TRIangulated model
In CWPROOT/src/xtri:
SXPLOT - X Window plot a triangulated sloth function s(x1,x2)
8
In CWPROOT/src/tri/graphics/psplot:
SPSPLOT - plot a triangulated sloth function s(x,z) via PostScript
In CWPROOT/src/comp/dct/main:
DCTCOMP - Compression by Discrete Cosine Transform
DCTUNCOMP - Discrete Cosine Transform Uncompression
ENTROPY - compute the ENTROPY of a signal
WPTCOMP - Compression by Wavelet Packet Compression
WPTUNCOMP - Uncompress WPT compressed data
WTCOMP - Compression by Wavelet Transform
WTUNCOMP - UNCOMPression of WT compressed data
In CWPROOT/src/comp/dwpt/1d/main:
WPC1COMP2 --- COMPress a 2D seismic section trace-by-trace using
WPC1UNCOMP2 --- UNCOMPRESS a 2D seismic section, which has been
In CWPROOT/src/comp/dwpt/2d/main:
WPCCOMPRESS --- COMPRESS a 2D section using Wavelet Packets
WPCUNCOMPRESS --- UNCOMPRESS a 2D section
Shells:
In CWPROOT/src/cwp/shell:
# ARGV - give examples of dereferencing char **argv
# COPYRIGHT - insert CSM COPYRIGHT lines at top of files in working directory
# CPALL , RCPALL - for local and remote directory tree/file transfer
# CWPFIND - look for files with patterns in CWPROOT/src/cwp/lib
# DIRTREE - show DIRectory TREE
# FILETYPE - list all files of given type
# Grep - recursively call egrep in pwd
# NEWCASE - Changes the case of all the filenames in a directory, dir
# OVERWRITE - copy stdin to stdout after EOF
# PRECEDENCE - give table of C precedences from Kernighan and Ritchie
# REPLACE - REPLACE string1 with string2 in files
# THIS_YEAR - print the current year
# TIME_NOW - prints time in ZULU format with no spaces
# TODAYS_DATE - prints today’s date in ZULU format with no spaces
# USERNAMES - get list of all login names
# VARLIST - list variables used in a Fortran program
# WEEKDAY - prints today’s WEEKDAY designation
# ZAP - kill processes by name
In CWPROOT/src/par/shell:
9
# GENDOCS - generate complete list of selfdocs in latex form
# STRIPTOTXT - put files from $CWPROOT/src/doc/Stripped into a new
# UPDATEDOCALL - put self-docs in ../doc/Stripped
# UPDATEDOC - put self-docs in ../doc/Stripped and ../doc/Headers
# UPDATEHEAD - update ../doc/Headers/Headers.all
In CWPROOT/src/psplot/shell:
# MERGE2 - put 2 standard size PostScript figures on one page
# MERGE4 - put 4 standard size PostScript plots on one page
In CWPROOT/src/su/shell:
# LOOKPAR - show getpar lines in SU code with defines evaluated
# MAXDIFF - find absolute maximum difference in two segy data sets
# RECIP - sum opposing (reciprocal) offsets in cdp sorted data
# RMAXDIFF - find percentage maximum difference in two segy data sets
# SUAGC - perform agc on SU data
# SUBAND - Trapezoid-like Sin squared tapered Bandpass filter via SUFILTER
# SUDIFF, SUSUM, SUPROD, SUQUO, SUPTDIFF, SUPTSUM,
# SUDOC - get DOC listing for code
# SUENV - Instantaneous amplitude, frequency, and phase via: SUATTRIBUTES
# SUFIND - get info from self-docs
# SUFIND - get info from self-docs
# SUGENDOCS - generate complete list of selfdocs in latex form
# SUHELP - list the CWP/SU programs and shells
# SUKEYWORD -- guide to SU keywords in segy.h
# SUNAME - get name line from self-docs
# UNGLITCH - zonk outliers in data
Libs:
In CWPROOT/src/cwp/lib:
ABEL - Functions to compute the discrete ABEL transform:
AIRY - Approximate the Airy functions Ai(x), Bi(x) and their respective
ALLOC - Allocate and free multi-dimensional arrays
ANTIALIAS - Butterworth anti-aliasing filter
AXB - Functions to solve a linear system of equations Ax=b by LU
BIGMATRIX - Functions to manipulate 2-dimensional matrices that are too big
BUTTERWORTH - Functions to design and apply Butterworth filters:
COMPLEX - Functions to manipulate complex numbers
COMPLEXD - Functions to manipulate double-precision complex numbers
COMPLEXF - Subroutines to perform operations on complex numbers.
COMPLEXFD - Subroutines to perform operations on double complex numbers.
CONVOLUTION - Compute z = x convolved with y
10
CUBICSPLINE - Functions to compute CUBIC SPLINE interpolation coefficients
DBLAS - Double precision Basic Linear Algebra subroutines
DGE - Double precision Gaussian Elimination matrix subroutines adapted
PFAFFT - Functions to perform Prime Factor (PFA) FFT’s, in place
*CWP_Exit - exit subroutine for CWP/SU codes
FRANNOR - functions to generate a pseudo-random float normally distributed
FRANUNI - Functions to generate a pseudo-random float uniformly distributed
HANKEL - Functions to compute discrete Hankel transforms
HILBERT - Compute Hilbert transform y of x
HOLBERG1D - Compute coefficients of Holberg’s 1st derivative filter
INTCUB - evaluate y(x), y’(x), y’’(x), ... via piecewise cubic interpolation
INTL2B - bilinear interpolation of a 2-D array of bytes
INTLIN - evaluate y(x) via linear interpolation of y(x[0]), y(x[1]), ...
INTLINC - evaluate complex y(x) via linear interpolation of y(x[0]), y(x[1]), ...
INTSINC8 - Functions to interpolate uniformly-sampled data via 8-coeff. sinc
INTTABLE8 - Interpolation of a uniformly-sampled complex function y(x)
LINEAR_REGRESSION - Compute linear regression of (y1,y2,...,yn) against
MKDIFF - Make an n-th order DIFFerentiator via Taylor’s series method.
MKHDIFF - Compute filter approximating the bandlimited HalF-DIFFerentiator.
MKSINC - Compute least-squares optimal sinc interpolation coefficients.
MNEWT - Solve non-linear system of equations f(x) = 0 via Newton’s method
PFAFFT - Functions to perform Prime Factor (PFA) FFT’s, in place
POLAR - Functions to map data in rectangular coordinates to polar and vise versa
PRINTERPLOT - Functions to make a printer plot of a 1-dimensional array
QUEST - Functions to ESTimate Quantiles:
RESSINC8 - Functions to resample uniformly-sampled data via 8-coefficient sinc
RFWTVA - Rasterize a Float array as Wiggle-Trace-Variable-Area.
RFWTVAINT - Rasterize a Float array as Wiggle-Trace-Variable-Area, with
SBLAS - Single precision Basic Linear Algebra Subroutines
SCAXIS - compute a readable scale for use in plotting axes
SGA - Single precision general matrix functions adapted from LINPACK FORTRAN:
SHFS8R - Shift a uniformly-sampled real-valued function y(x) via
SINC - Return SINC(x) for as floats or as doubles
SORT - Functions to sort arrays of data or arrays of indices
SQR - Single precision QR decomposition functions adapted from LINPACK FORTRAN:
STOEP - Functions to solve a symmetric Toeplitz linear system of equations
STRSTUFF -- STRing manuplation subs
SWAPBYTE - Functions to SWAP the BYTE order of binary data
SYMMEIGEN - Functions solving the eigenvalue problem for symmetric matrices
TEMPORARY_FILENAME - Creates a file name in a user-specified directory.
TRIDIAGONAL - Functions to solve tridiagonal systems of equations Tu=r for u.
VANDERMONDE - Functions to solve Vandermonde system of equations Vx=b
WAVEFORMS Subroutines to define some wavelets for modeling of seismic
11
XCOR - Compute z = x cross-correlated with y
XINDEX - determine index of x with respect to an array of x values
YCLIP - Clip a function y(x) defined by linear interpolation of the
YXTOXY - Compute a regularly-sampled, monotonically increasing function x(y)
ZASC - routine to translate ncharacters from ebcdic to ascii
ZEBC - routine to translate ncharacters from ascii to ebcdic
In CWPROOT/src/par/lib:
ATOPKGE - convert ascii to arithmetic and with error checking
DOCPKGE - Function to implement the CWP self-documentation facility
EALLOC - Allocate and free multi-dimensional arrays with error reports.
ERRPKGE - routines for reporting errors
FILESTAT - Functions to determine and output the type of a file from file
GETPARS - Functions to GET PARameterS from the command line. Numeric
LINCOEFF - subroutines to create linearized reflection coefficients
MINFUNC - routines to MINimize FUNCtions
MODELING - Seismic Modeling Subroutines for SUSYNLV and clones
REFANISO - Reflection coefficients for Anisotropic media
RKE - integrate a system of n-first order ordinary differential equations
SMOOTH - Functions to compute smoothing of 1-D or 2-D input data
SUBCALLS - routines for system functions with error checking
SYSCALLS - routines for SYSTEM CALLs with error checking
TAUP - Functions to perform forward and inverse taup transforms (radon or
UPWEIK - Upwind Finite Difference Eikonal Solver
VND - large out-of-core multidimensional block matrix transpose
WTLIB - Functions for wavelet transforms
In CWPROOT/src/su/lib:
fgethdr - get segy tape identification headers from the file by file pointer
FGETTR - Routines to get an SU trace from a file
FPUTTR - Routines to put an SU trace to a file
HDRPKGE - routines to access the SEGY header via the hdr structure.
TABPLOT - TABPLOT selected sample points on selected trace
VALPKGE - routines to handle variables of type Value
In CWPROOT/src/psplot/lib:
BASIC - Basic C function interface to PostScript
PSAXESBOX3 - Functions draw an axes box via PostScript, estimate bounding box
PSAXESBOX - Functions to draw PostScript axes and estimate bounding box
PSCAXESBOX - Draw an axes box for cube via PostScript
PSCONTOUR - draw contour of a two-dimensional array via PostScript
PSDRAWCURVE - Functions to draw a curve from a set of points
PSLEGENDBOX - Functions to draw PostScript axes and estimate bounding box
12
PSWIGGLE - draw wiggle-trace with (optional) area-fill via PostScript
In CWPROOT/src/xplot/lib:
AXESBOX - Functions to draw axes in X-windows graphics
COLORMAP - Functions to manipulate X colormaps:
DRAWCURVE - Functions to draw a curve from a set of points
IMAGE - Function for making the image in an X-windows image plot
LEGENDBOX - draw a labeled axes box for a legend (i.e. colorscale)
RUBBERBOX - Function to draw a rubberband box in X-windows plots
WINDOW - Function to create a window in X-windows graphics
XCONTOUR - draw contour of a two-dimensional array via X vectorplot calls
In CWPROOT/src/Xtcwp/lib:
AXES - the Axes Widget
COLORMAP - Functions to manipulate X colormaps:
FX - Functions to support floating point coordinates in X
MISC - Miscellaneous X-Toolkit functions
RESCONV - general purpose resource type converters
RUBBERBOX - Function to draw a rubberband box in X-windows plots
In CWPROOT/src/Xmcwp/lib:
RADIOBUTTONS - convenience functions creating and using radio buttons
SAMPLES - Motif-based Graphics Functions
In CWPROOT/src/tri/lib:
CHECK - CHECK triangulated models
CIRCUM - define CIRCUMcircles for Delaunay triangulation
COLINEAR - determine if edges or vertecies are COLINEAR in triangulated
CREATE - create model, boundary edge triangles, edge face, edge vertex, add
DELETE - DELETE vertex, model, edge, or boundary edge from triangulated model
DTE - Distance to Edge
FIXEDGES - FIX or unFIX EDGES between verticies
INSIDE - Is a vertex or point inside a circum circle, etc. of a triangulated
NEAREST - NEAREST edge or vertex in triangulated model
PROJECT - project to edge in triangulated model
READWRITE - READ or WRITE a triangulated model
In CWPROOT/src/cwputils:
CPUSEC - return cpu time (UNIX user time) in seconds
CPUTIME - return cpu time (UNIX user time) in seconds using ANSI C built-ins
WALLSEC - Functions to time processes
WALLTIME - Function to show time a process takes to run
13
In CWPROOT/src/comp/dct/lib:
DCT1 - 1D Discreet Cosine Transform Routines
DCT2 - 2D Discrete Cosine Transform Routines
DCTALLOC - ALLOCate space for transform tables for 1D DCT
GETFILTER - GET wavelet FILTER type
LCT1 - functions used to perform the 1D Local Cosine Transform (LCT)
LPRED - Lateral Prediction of Several Plane Waves
WAVEPACK1 - 1D wavelet packet transform
WAVEPACK2 - 2D Wavelet PACKet transform
WAVEPACK1 - 1D wavelet packet transform
WAVETRANS2 - 2D wavelet transform by tensor-product of two 1D transforms
In CWPROOT/src/comp/dct/libutil:
BUFFALLOC - routines to ALLOCate/initialize and free BUFFers
HUFFMAN - Routines for in memory Huffman coding/decoding
PENCODING - Routines to en/decode the quantized integers for lossless
QUANT - QUANTization routines
RLE - routines for in memory silence en/decoding
In CWPROOT/src/comp/dwpt/1d/lib:
WBUFFALLOC - routines to allocate/initialize and free buffers in wavelet
WPC1 - routines for compress a single seismic trace using wavelet packets
WPC1CODING - routines for encoding the integer symbols in 1D WPC
wpc1Quant - quantize
WPC1TRANS - routines to perform a 1D wavelet packet transform
In CWPROOT/src/comp/dwpt/2d/lib:
WPCBUFFAL - routines to allocate/initialize and free buffers
WPC - routines for compress a 2D seismic section using wavelet packets
WPCCODING - Routines for in memory coding of the quantized coeffiecients
WPCENDEC - Wavelet Packet Coding, Encoding and Decoding routines
WPCHUFF -Routines for in memory Huffman coding/decoding
WPCPACK2 - routine to perform a 2D wavelet packet transform
WPCQUANT - quantization routines for WPC
WPCSILENCE - routines for in memory silence en/decoding
14
Items labeled with a pound sign (#) are shell scripts that may,
or may not have the self documentation feature.
15
Self Documentations
Mains:
______
CTRLSTRIP - Strip non-graphic characters
______
DOWNFORT - change Fortran programs to lower case, preserving strings
Credits:
Brian Sumner c. 1984
______
FCAT - fast cat with 1 read per file
Credits:
Shuki
______
ISATTY - pass on return from isatty(2)
16
Credits:
CWP: Shuki
______
MAXINTS - Compute maximum and minimum sizes for integer types
(quick and dirty)
Usage: maxints
Credits:
CWP: Jack K. Cohen
______
PAUSE - prompt and wait for user signal to continue
Note:
Default prompt is "press return key to continue" which is *evoked
by calling pause with no arguments. The word,
"continue", is replaced by any optional arguments handed to pause.
Thus, the command "pause do plot" will evoke the prompt,
"press return key to do plot".
______
T - time and date for non-military types
17
Usage: t
Credit: Jack
______
UPFORT - change Fortran programs to upper case, preserving strings
18
A2B - convert ascii floats to binary
Required parameters:
none
Optional parameters:
n1=2 floats per line in input file
Credits:
CWP: Jack K. Cohen, Dave Hale
Hans Ecke 2002: Replaced line-wise file reading via gets() with
float-wise reading via fscanf(). This makes it
much more robust: it does not impose a specific
structure on the input file.
19
B2A - convert binary floats to ascii
Required parameters:
none
Optional parameters:
n1=2 floats per line in output file
Credits:
CWP: Jack K. Cohen
20
CSHOTPLOT - convert CSHOT data to files for CWP graphers
Required parameters:
none
Optional parameter:
outpar=/dev/tty output parameter file, contains:
number of plots (n2=)
points in each plot (n1=)
colors for plots (linecolor=)
21
DZDV - determine depth derivative with respect to the velocity ",
parameter, dz/dv, by ratios of migrated data with the primary
amplitude and those with the extra amplitude
Required Parameters:
infile= input of common image gathers with primary amplitude
afile= input of common image gathers with extra amplitude
dfile= output of imaged depths in common image gathers
outfile= output of dz/dv at the imaged points
nx= number of migrated traces
nz= number of points in migrated traces
dx= horizontal spacing of migrated trace
dz= vertical spacing of output trace
fx= x-coordinate of first migrated trace
fz= z-coordinate of first point in migrated trace
off0= first offset in common image gathers
noff= number of offsets in common image gathers
doff= offset increment in common image gathers
cip=x1,z1,r1,..., cip=xn,zn,rn description of input CIGS
x x-value of a common image point
z z-value of a common image point at zero offset
r r-parameter in a common image gather
Optional Parameters:
nxw, nzw=0 window widths along x- and z-directions in
which points are contributed in solving dz/dv.
Notes:
This program is used as part of the velocity analysis technique developed
by Zhenyue Liu, CWP:1995.
Reference:
Liu, Z. 1995, "Migration Velocity Analysis", Ph.D. Thesis, Colorado
School of Mines, CWP report #168.
22
FARITH - File ARITHmetic -- perform simple arithmetic with binary files
Optional Parameters:
in=stdin input file
out=stdout output file
in2= second input file (required for binary operations)
if it can’t be opened as a file, it might be a scalar
n=size_of_in, fastest dimension (used only for op=cartprod is set)
isig= index at which signum function acts (used only for
op=signum)
scale= value to scale in by, used only for op=scale)
bias= value to bias in by, used only for op=bias)
Notes:
op=sqrt takes sqrt(x) for x>=0 and -sqrt(ABS(x)) for x<0 (signed sqrt)
23
op=pinv takes y=1/x for x!=0, if x=0 then y=0. (punctuated inverse)
The seismic operations assume that in and in2 are wavespeed profiles.
"Slowness" is 1/wavespeed and "sloth" is 1/wavespeed^2.
Use "suop" and "suop2" to perform unary and binary operations on
data in the SU (SEGY trace) format.
The options "pinvsq" and "pinvsqrt" are also useful for seismic
computations involving converting velocity to sloth and vice versa.
The option "signum" causes a flip in sign for all values with index
greater than "isig" (really -1*signum(index)).
24
FTNSTRIP - convert a file of binary data plus record delimiters created
via Fortran to a file containing only binary values (as created via C)
Credits:
CWP: Jack K. Cohen
25
FTNUNSTRIP - convert C binary floats to Fortran style floats
Required parameters:
none
Optional parameters:
n1=1 floats per line in output file
Credits:
CWP: John Stockwell, Feb 1998,
based on ftnstrip by: Jack K. Cohen
26
GRM - Generalized Reciprocal refraction analysis for a single layer
Required parameters:
nt= Number of arrival time pairs
dx= Geophone spacing (m)
v0= Velocity in weathering layer (m/s)
abtime= If set to 0, use last time as a-b, else give time (ms)
Optional parameters:
XY= Value of XY if you want to override the optimum XY
algorithm in the program. If it is not an integer multiple of
dx, then it will be converted to the closest
one.
XYmax Maximum offset distance allowed when searching for
optimum XY (m) (Default is 2*dx*10)
depthres Size of increment in x during verical depth search(m)
(Default is 0.5m)
Input file:
4 column ASCII - x,y, forward time, reverse time
Output file:
1) XYoptimum
2) apparent refractor velcocity
3) x, y, z(x,y), y-z(x,y)
z(x,y) = calculated (GRM) depth below (x y)
y-z(x,y) = GRM depth subtracted from y - absolute depth
.............
4) x, y, d(x,y), y-d(x,y), (error)
d(x,y) = dip corrected depth estimate below (x,y)
y-d(x,y) = dip corrected absolute depth
error = estimated error in depth due only to the inexact
matching of tangents to arcs in dip estimate.
Notes:
Uses average refactor velocity along interface.
Credits:
27
CWP: Steven D. Sheaffer
28
H2B - convert 8 bit hexidecimal floats to binary
Required parameters:
none
Optional parameters:
outpar=/dev/tty output parameter file, contains the
number of lines (n=)
other choices for outpar are: /dev/tty,
/dev/stderr, or a name of a disk file
Note: this code may be used to recover binary data from PostScript
bitmaps. To do this, strip away all parts of the PSfile that
are not the actual hexidecimal bitmap and run through h2b.
29
HTI2STIFF - convert HTI parameters alpha, beta, d(V), e(V), gamma
into stiffness tensor
Optional Parameters
alpha=2 isotropy-plane p-wave velocity
beta=1 fast isotropy-plan s-wave velocity
ev=0 e(V)
dv=0 d(V)
gamma=0 shear-wave splitting parameter
rho=1 density
sign sign of c13+c55 ( for most materials sign=1)
outpar=/dev/tty output parameter file
Output:
c_ijkl stiffness components for x1=symmetry axis
x3= vertical
30
HUDSON - compute effective parameters of anisotropic solids
using Hudson’s crack theory.
Optional parameters
Notes:
The cracks are assumed to be vertically aligned, penny-shaped and the
matrix is isotropic. The resulting anisotropic solid is of HTI symmetry.
Output:
Computes(a) stiffness elements
(b) density normalized stiffness components
(c) generic Thomsen parameters (vp0,vs0,eps,delta,gamma)
(d) equivalent VTI parameters (alpha,beta,ev,dv,gv)
Additional notes:
The routine can be easily modified to allow for any
filling adding attenuation is not trivial
Technical Reference:
Hudson’s theory: Hudson, 1981: Wave speed and attenuation of elastic
waves in material containing cracks.
Geophys. J. R. astr. Soc 64, 133-150
Crampin, 1984: Effective anisotropic elastic constants
for waves propagating through cracked
solids:
31
Geophys. J. R. astr. Soc 76, 135-145
Equivalent VTI : Rueger, 1996: Reflection coefficients in transversely
isotropic media with vertical and
horizontal axis of symmetry: Geophysics
32
KAPERTURE - generate the k domain of a line scatterer for a seismic array
Optional parameters
x0=1000 point scatterer location
z0=1000 point scatterer location
nshot=1 number of shots
sxmin=0 first shot location
szmin=0 first shot location
dsx=100 x-steps in shot location
dsz=0 z-steps in shot location
ngeo=1 number of receivers
gxmin=0 first receiver location
gzmin=0 first receiver location
dgx=100 x-steps in receiver location
dgz=0 z-steps in receiver location
fnyq=125 Nyquist frequency (Hz)
fmax=125 maximum frequency (Hz)
fmin=5 minimum frequency (Hz)
nfreq=2 number of frequencies
both=0 = 1 gives negative freqs too
nstep=60 points on Nyquist circle
c=5000 speed
outpar=/dev/tty output parameter file, contains:
xmin, xmax, ymin, ymax
and npairs (needed for psgraph or xgraph)
other choices for outpar are: /dev/tty,
/dev/stderr, or a name of a disk file
Notes:
nfreq=1 produces fmin
nstep=0 suppresses the Nyquist circle
and npairs
Examples:
Other cases:
33
both=0 nfreq=NFREQ > 2
kaperture both=0 nfreq=NFREQ nshot=NSHOT ngeo=NGEO nstep=NSTEP |
psgraph n=NPAIRS,NSTEP mark=1,0 marksize=1,0 linewidth=0,1 |...
WHERE: NPAIRS=NFREQ*NSHOT*NGEO
34
LINRORT - linearized P-P, P-S1 and P-S2 reflection coefficients
for a horizontal interface separating two of any of the
following halfspaces: ISOTROPIC, VTI, HTI and ORTHORHOMBIC.
for VTI:
vp1=2 P-wave vertical velocity (V33), halfspace1
vs1=1 S-wave vertical velocity (V44=V55), halfspace1
rho1=2.7 density, halfspace1
eps1=0 Thomsen’s generic epsilon, halfspace1
delta1=0 Thomsen’s generic delta, halfspace1
gamma1=0 Thomsen’s generic gamma, halfspace1 ",
for HTI:
vp1=2 P-wave vertical velocity (V33), halfspace1
vs1=1 "fast" S-wave vertical velocity (V44), halfspace1
rho1=2.7 density, halfspace1
eps1_v=0 Tsvankin’s "vertical" epsilon, halfspace1
delta1_v=0 Tsvankin’s "vertical" delta, halfspace1
gamma1_v=0 Tsvankin’s "vertical" gamma, halfspace1 ",
for ORT:
vp1=2 P-wave vertical velocity (V33), halfspace1
vs1=1 x2-polarized S-wave vertical velocity (V44), halfspace1
rho1=2.7 density, halfspace1
eps1_1=0 Tsvankin’s epsilon in [x2,x3] plane, halfspace1
delta1_1=0 Tsvankin’s delta in [x2,x3] plane, halfspace1
gamma1_1=0 Tsvankin’s gamma in [x2,x3] plane, halfspace1
eps1_2=0 Tsvankin’s epsilon in [x1,x3] plane, halfspace1
delta1_2=0 Tsvankin’s delta in [x1,x3] plane, halfspace1
gamma1_2=0 Tsvankin’s gamma in [x1,x3] plane, halfspace1
delta1_3=0 Tsvankin’s delta in [x1,x2] plane, halfspace1
35
hspace2=ISO medium type of the reflecting halfspace (the same
convention as above)
a_file=-1 the string ’-1’ ... incidence and azimuth angles are
generated automatically using the setup values below
a_file=file_name ... incidence and azimuth angles are
read from a file "file_name"; the program expects a
file of two columns [inc. angle, azimuth]
36
Output:
out_P:
inc. phase angle, azimuth, reflection coefficient; for a_file=-1, the
inc. angle is the fast dimension
out_S:
inc. phase angle, azimuth, Rps1, Rps2, cos(PHI), sin(PHI); for
a_file=-1, the inc. angle is the fast dimension ",
out_SVSH:
inc. phase angle, azimuth, Rsv, Rsh, cos(PHI), sin(PHI); for
a_file=-1, the inc. angle is the fast dimension
out_Error:
error estimates of Rpp, Rpsv and Rpsh approximations; global error is
analysed as well as partial contributions to the error due to the
isotropic velocity contrasts, and due to anisotropic upper and lower
halfspaces. The error file is self-explanatory, see also descriptions
of subroutines P_err_2nd_order, SV_err_2nd_order and SH_err_2nd_order.
Adopted Convention:
37
counted in the positive sense from "SV" axis (PHI=0) towards the
"SH" axis (PHI=PI/2). Of course, S2 is perpendicular to S1, and
the projection of S1 and S2 polarizations onto the SV-SH plane
coincides with SV and SH directions, respectively, for PHI=0.
The units for velocities are km/s, angles I/O are in degrees
Additional Notes:
The coefficients are computed as functions of phase incidence
angle and azimuth (determined by the incidence slowness vector).
Vertical symmetry planes of the HTI and
ORTHORHOMBIC halfspaces can be arbitrarily rotated along the
x3-axis. The linearization is based on the assumption of weak ",
contrast in elastic medium parameters across the interface,
and the assumption of weak anisotropy in both halfspaces.
See the "Adopted Convention" paragraph below for a proper
input.
38
LORENZ - compute the LORENZ attractor
Examples:
lorenz stepmax=1000 mode=xy | xgraph n=1000 &
lorenz stepmax=1000 mode=yz | xgraph n=1000 &
lorenz stepmax=1000 mode=xz | xgraph n=1000 &
39
40
MAKEVEL - MAKE a VELocity function v(x,y,z)
Required Parameters:
nx= number of x samples (3rd dimension)
nz= number of z samples (1st dimension)
Optional Parameters:
ny=1 number of y samples (2nd dimension)
dx=1.0 x sampling interval
fx=0.0 first x sample
dy=1.0 y sampling interval
fy=0.0 first y sample
dz=1.0 z sampling interval
fz=0.0 first z sample
v000=2.0 velocity at (x=0,y=0,z=0)
dvdx=0.0 velocity gradient with respect to x
dvdy=0.0 velocity gradient with respect to y
dvdz=0.0 velocity gradient with respect to z
vlens=0.0 velocity perturbation in parabolic lens
tlens=0.0 thickness of parabolic lens
dlens=0.0 diameter of parabolic lens
xlens= x coordinate of center of parabolic lens
ylens= y coordinate of center of parabolic lens
zlens= z coordinate of center of parabolic lens
vran=0.0 standard deviation of random perturbation
vzfile= file containing v(z) profile
vzran=0.0 standard deviation of random perturbation to v(z)
vzc=0.0 v(z) chirp amplitude
z1c=fz z at which to begin chirp
z2c=fz+(nz-1)*dz z at which to end chirp
l1c=dz wavelength at beginning of chirp
l2c=dz wavelength at end of chirp
exc=1.0 exponent of chirp
41
MKPARFILE - convert ascii to par file format
Optional parameters:
string1="par1" first par string
string2="par2" second par string
42
MRAFXZWT - Multi-Resolution Analysis of a function F(X,Z) by Wavelet
Transform. Modified to perform different levels of resolution
analysis for each dimension and also to allow to transform
back only the lower level of resolution.
Required Parameters:
n1= size of first (fast) dimension
n2= size of second (slow) dimension
Optional Parameters:
p1= maximum integer such that 2^p1 <= n1
p2= maximum integer such that 2^p2 <= n2
order=6 order of Daubechies wavelet used (even, 4<=order<=20)
mralevel1=3 maximum multi-resolution analysis level in dimension 1
mralevel2=3 maximum multi-resolution analysis level in dimension 2
trunc=0.0 truncation level (percentage) of the reconstruction
verbose=0 =1 to print some useful information
reconfile= reconstructed data file to write
reconmrafile= reconstructed data file in MRA domain to write
dfile= difference between infile and reconfile to write
dmrafile= difference between mrafile and reconmrafile to write
dconly=0 =1 keep only dc component of MRA
verbose=0 =1 to print some useful information
if (n1 or n2 is not integer powers of 2) specify the following:
nc1=n1/2 center of trimmed image in the 1st dimension
nc2=n2/2 center of trimmed image in the 2nd dimension
trimfile= if given, output the trimmed file
Notes:
This program performs multi-resolution analysis of an input function
f(x,z) via the wavelet transform method. Daubechies’s least asymmetric
wavelets are used. The smallest wavelet coefficient retained is given
by trunc times the absolute maximum size coefficient in the MRA.
43
*
Reference: *
Daubechies, I., 1988, Orthonormal Bases of Compactly Supported *
Wavelets, Communications on Pure and Applied Mathematics, Vol. XLI, *
909-996. *
44
PRPLOT - PRinter PLOT of 1-D arrays f(x1) from a 2-D function f(x1,x2)
Optional Parameters:
n1=all number of samples in 1st dimension
d1=1.0 sampling interval in 1st dimension
f1=d1 first sample in 1st dimension
n2=all number of samples in 2nd dimension
d2=1.0 sampling interval in 2nd dimension
f2=d2 first sample in 2nd dimension
label2=Trace label for 2nd dimension
45
RANDVEL3D - Add a random velocity layer (RVL) to a gridded
v(x,y,z) velocity model
Required Parameters:
n1= number of samples along 1st dimension
n2= number of samples along 2nd dimension
Optional Parameters:
46
Notes:
1. Smoothing radii usually fall in the range of [0,20].
2. Smoothing radii can be used to set aspect ratio of random velocity
anomalies in the new layer. For example (r1=5,r2=0,r3=0) will
result in vertical vel streaks that mimick vertical fracturing.
3. Smoothing on slowness works better to preserve traveltimes relative
to the unsmoothed case.
4. Default case is a random velocity (+/-30%) near surface layer whose
thickness is 20% of the total 2D model thickness.
5. Each layer vel is a random perturbation on input model at that level.
6. The depth dimension is assumed to be along axis 1.
Example:
1. 2D RVL with no smoothing
makevel nz=250 nx=200 | randvel3d n1=250 n2=200 | ximage n1=250
2. 3D RVL with no smoothing
makevel nz=250 nx=200 ny=220 |
randvel3d n1=250 n2=200 n3=220 |
xmovie n1=250 n2=200
47
RAYT2DAN -- P- and SV-wave raytracing in 2D anisotropic media
Required Parameters:
VP0file= name of file containing VP0(x,z)
nt= number of time samples for each ray
nx= number of samples (x) for the parameter fields
nz= number of samples (z) for the parameter fields
Optional Parameters:
SV=0 for P-waves, SV=1 for Shear waves
48
a1111file name of file containing a1111(x,z)
a1133file name of file containing a1133(x,z)
VS0file name of file containing VS0(x,z)
a1113file name of file containing a1113(x,z)
a3313file name of file containing a3313(x,z)
Credits:
Debashish Sarkar
Technical Reference:
49
RAYT2D - traveltime Tables calculated by 2D paraxial RAY tracing
Required parameters:
vfile=stdin file containning velocity v[nx][nz]
tfile=stdout file containning traveltime tables
t[nxs][nxo][nzo]
Optional parameters
dt=0.008 time sample interval in ray tracing
nt=401 number of time samples in ray tracing
50
npv=0 flag of computing quantities for velocity analysis
if npv>0 specify the following three files
pvfile=pvfile input file of velocity variation pv[nxo][nzo]
tvfile=tvfile output file of traveltime variation tables
tv[nxs][nxo][nzo]
csfile=csfile output file of cosine tables cs[nxs][nxo][nzo]
Notes:
1. Each traveltime table is calculated by paraxial ray tracing; then
traveltimes in shadow zones are compensated by solving eikonal
equation.
2. Input velocity is uniformly sampled and smooth one preferred.
3. Traveltime table and source ranges must be within velocity model.
4. Ray tracing aperature can be chosen as sum of migration aperature
plus half of maximum offset.
5. Memory requirement for this program is about
[nx*nz+4*mx*nz+3*nxo*nzo+na*(nx*nz+mx*nz+3*nxo*nzo)]*4 bytes
where mx = min(nx,2*(1+aperx/dx)).
References:
Beydoun, W. B., and Keho, T. H., 1987, The paraxial ray method:
Geophysics, vol. 52, 1639-1653.
51
RECAST - RECAST data type (convert from one data type to another)
Required parameters:
none
Optional parameters:
in=float input type (float)
=double (double)
=int (int)
=char (char)
=uchar (unsigned char)
=short (short)
=long (long)
=ulong (unsigned long)
Credits:
52
REFREALAZIHTI - REAL AZImuthal REFL/transm coeff for HTI media
Optional parameters:
vp1=2 p-wave velocity medium 1 (with respect to symm.axes)
vs1=1 s-wave velocity medium 1 (with respect to symm.axes)
eps1=0 epsilon medium1
delta1=0 delta medium 1
gamma1=0 gamma medium 1
rho1=2.7 density medium 1
vp2=2 p-wave velocity medium 2 (with respect to symm.axes)
vs2=1 s-wave velocity medium 2 (with respect to symm.axes)
eps2=0 epsilon medium 2
delta2=0 delta medium 2
gamma2=0 gamma medium 2
rho2=2.7 density medium 2
modei=0 incident mode is qP
=1 incident mode is qSV
=2 incident mode is SP
modet=0 scattered mode
rort=1 reflection(1) or transmission (0)
azimuth=0 azimuth with respect to x1-axis (clockwise)
fangle=0 first incidence angle
langle=45 last incidence angle
dangle=1 angle increment
iscale=0 default: angle in degrees
=1 angle-axis in rad
=2 axis horizontal slowness
=3 sin^2 of incidence angle
ibin=1 binary output
=0 Ascci output
outparfile =outpar parameter file for plotting
coeffile =coeff.data coefficient-output file
test=1 activate testing routines in code
info=0 output intermediate results
Notes:
Axes of symmetry have to coincide in both media. This code computes
all 6 REAL reflection/transmissions coefficients on the fly. However,
the set-up is such Real reflection/transmission coefficients in
HTI-media with coinciding symmetry axes.
However, the set-up is such that currently only one coefficient is
53
dumped into the output. This is easily changed. The solution of the
scattering problem is obtained numerically and involves the Gaussian
elimination of a 6X6 matrix. ",
Technical references:
If propagation is perpendicular or
parallel to the symmetry axis, the solution is analytic (see
graebner2D.c and rtRealIso.c
54
REFREALVTI - REAL REFL/transm coeff for VTI media and symmetry-axis
planes of HTI media
Optional parameters:
vp1=2 p-wave velocity medium 1 (along symm.axes)
vs1=1 s-wave velocity medium 1 (along symm.axes)
eps1=0 Thomsen’s epsilon medium 1
delta1=0 Thomsen’s delta medium 1
rho1=2.7 density medium 1
axis1=0 medium 1 is VTI
=1 medium 1 is HTI
vp2=2.5 p-wave velocity medium 2 (along symm.axes)
vs2=1.2 s-wave velocity medium 2 (along symm.axes)
eps2=0 epsilon medium2
delta2=0 delta medium 2
rho2=3.0 density medium 2
axis2=0 medium 2 is VTI
=2 medium 2 is HTI
modei=0 incident mode is qP
=1 incident mode is qSV
modet=0 scattered mode
rort=1 reflection(1) or transmission (0)
fangle=0 first angle
langle=45 last angle
dangle=1 angle increment
iscale=0 =1 angle-axis in rad
=2 axis horizontal slowness
=3 sin^2 of incidence angle
ibin=1 binary output
=0 Ascci output
outparfile =outpar parameter file for plotting
coeffile =coeff.data coefficient-output file
Notes:
Coefficients are based on Graebner’s 1992 Geophysics paper. Note the
mistype in the equation for K1. The algorithm can be used for VTI
and HTI media on the incidence and scattering side.
55
original name of algorithm: graebner1.c
56
REGRID3 - REwrite a [ni3][ni2][ni1] GRID to a [no3][no2][no1] 3-D grid
Optional parameters:
ni1=1 fastest (3rd) dimension in input grid
ni2=1 second fastest (2nd) dimension in input grid
ni3=1 slowest (1st) dimension in input grid
no1=1 fastest (3rd) dimension in output grid
no2=1 second fastest (2nd) dimension in output grid ",
no3=1 slowest (1st) dimension in output grid
Optional Parameters:
verbose=0 =1 print some useful information
Notes:
REGRID3 can be used to span a 1-D grid to a 2-D grid, or a 2-D grid
to a 3-D grid; or to change grid parameters within the dimensions.
Together with MUL and UNIF3, most 3-D velocity model can be
Credits:
CWP: Zhaobo Meng, 1996, Colorado School of Mines
57
RESAMP - RESAMPle the 1st dimension of a 2-dimensional function f(x1,x2)
Required Parameters:
Optional Parameters:
n1=all number of samples in 1st (fast) dimension
n2=all number of samples in 2nd (slow) dimension
d1=1.0 sampling interval in 1st dimension
f1=d1 first sample in 1st dimension
n1r=n1 number of samples in 1st dimension after resampling
d1r=d1 sampling interval in 1st dimension after resampling
f1r=f1 first sample in 1st dimension after resampling
58
SMOOTH2 --- SMOOTH a uniformly sampled 2d array of data, within a user-
defined window, via a damped least squares technique
Required Parameters:
n1= number of samples in the 1st (fast) dimension
n2= number of samples in the 2nd (slow) dimension
Optional Parameters:
r1=0 smoothing parameter in the 1 direction
r2=0 smoothing parameter in the 2 direction
win=0,n1,0,n2 array for window range
rw=0 smoothing parameter for window function
efile= =efilename if set write relative error(x1) to
efilename
Notes:
Larger r1 and r2 result in a smoother data. Recommended ranges of r1 ",
and r2 are from 1 to 20.
The file verror gives the relative error between the original velocity
and the smoothed one, as a function of depth. If the error is
between 0.01 and 0.1, the smoothing parameters are suitable. Otherwise,
consider increasing or decreasing the smoothing parameter values.
Smoothing the window function (i.e. blurring the edges of the window)
may be done by setting a nonzero value for rw, otherwise the edges
of the window will be sharp.
Credits:
CWP: Zhen-yue Liu,
adapted for par/main by John Stockwell 1 Oct 92
Windowing feature added by Zliu on 16 Nov 1992
59
SMOOTH3D - 3D grid velocity SMOOTHing by the damped least squares
Required Parameters:
n1= number of samples along 1st dimension
n2= number of samples along 2nd dimension
n3= number of samples along 3rd dimension
Optional Parameters:
Sample intervals:
d1=1.0 1st dimension
d2=1.0 2nd dimension
d3=1.0 3rd dimension
iter=2 number of iteration used
time=0 which dimension the time axis is (0 = no time axis)
depth=1 which dimension the depth axis is (ignored when time>0)
mu=1 the relative weight at maximum depth (or time)
verbose=0 =1 for printing minimum wavelengths
slowness=0 =1 smoothing on slowness; =0 smoothing on velocity
vminc=0 velocity values below it are cliped before smoothing
vmaxc=99999 velocity values above it are cliped before smoothing
Notes:
1. The larger the smoothing parameters, the smoother the output velocity.
These parameters are lengths of smoothing operators in each dimension.
2. iter controls the orders of derivatives to be smoothed in the output
velocity. e.g., iter=2 means derivatives until 2nd order smoothed.
3. mu is the multipler of smoothing parameters at the bottom compared to
those at the surface.
4. Minimum wavelengths of each dimension and the total may be printed
for the resulting output velocity is. To compute these parameters for
the input velocity, use r1=r2=r3=0.
5. Smoothing directly on slowness works better to preserve traveltime.
So the program optionally converts the input velocity into slowness ",
and smooths the slowness, then converts back into velocity.
60
Author: CWP: Zhenyue Liu March 1995
Reference:
Liu, Z., 1994,"A velocity smoothing technique based on damped least squares
in Project Reveiew, May 10, 1994, Consortium Project on
Seismic Inverse Methods for Complex Stuctures.
61
SMOOTHINT2 --- SMOOTH non-uniformly sampled INTerfaces, via the damped
least-squares technique
Required Parameters:
<input file containing original interfaces
>output file containing smoothed interfaces
Optional Parameters:
ninf=5 number of interfaces
r=100 smoothing parameter
npmax=101 maximum number of points in interfaces
Notes:
The input file is an ASCII file. Each interface is represented by pairs
(non-uniform sampling) of x and z values, with one pair of values on
each line, separated by spaces or tabs. Each interface is separated with
an entry with a large negative z value for example: 1.0 -9999.
There is no entry for the surface. The surface is assumed to be flat
with z=0.
This is similar to a CSHOT model file without a surface entry and
without comments.
Credits:
CWP: Zhenyue Liu, Jan 1994
62
Reference:
Liu, Zhenyue, 1994, Velocity smoothing: theory and implementation,
Project Review, 1994, Consortium Project on Seismic Inverse Methods
for Complex Stuctures (in review)
63
STIFF2VEL - Transforms 2D elastic stiffnesses to (vp,vs,epsilon,delta)
Required parameters:
nx= number of x samples (2nd dimension)
nz= number of z samples (1st dimension)
rho_file=’rho.bin’ input file containing rho(x,z)
c11_file=’c11.bin’ input file containing c11(x,z)
c13_file=’c13.bin’ input file containing c13(x,z)
c33_file=’c33.bin’ input file containing c33(x,z)
c44_file=’c44.bin’ input file containing c44(x,z)
Optional Parameters:
vp_file=’vp.bin’ output file containing P-wave velocities
vs_file=’vs.bin’ output file containing S-wave velocities
rho_file=’rho.bin’ output file containing densities
eps_file=’eps.bin’ output file containing Thomsen epsilon
delta_file=’delta.bin’ output file containing Thomsen delta
Notes:
1. All quantities in MKS units
2. Isotropy implied by c11(x,z)=c33(x,z)=0
3. Vertical symmetry axis is assumed.
Coded:
Aramco: Chris Liner 9/25/2005
(based on vel2stiff.c)
64
SUBSET - select a SUBSET of the samples from a 3-dimensional file
Optional Parameters:
n1=nfloats number of samples in 1st dimension
n2=nfloats/n1 number of samples in 2nd dimension
n3=nfloats/(n1*n2) number of samples in 3rd dimension
id1s=1 increment in samples selected in 1st dimension
if1s=0 index of first sample selected in 1st dimension
n1s=1+(n1-if1s-1)/id1s number of samples selected in 1st dimension
ix1s=if1s,if1s+id1s,...indices of samples selected in 1st dimension
id2s=1 increment in samples selected in 2nd dimension
if2s=0 index of first sample selected in 2nd dimension
n2s=1+(n2-if2s-1)/id2s number of samples selected in 2nd dimension
ix2s=if2s,if2s+id2s,...indices of samples selected in 2nd dimension
id3s=1 increment in samples selected in 3rd dimension
if3s=0 index of first sample selected in 3rd dimension
n3s=1+(n3-if3s-1)/id3s number of samples selected in 3rd dimension
ix3s=if3s,if3s+id3s,...indices of samples selected in 3rd dimension
65
SWAPBYTES - SWAP the BYTES of various data types
Required parameters:
none
Optional parameters:
in=float input type (float)
=double (double)
=short (short)
=ushort (unsigned short)
=long (long)
=ulong (unsigned long)
=int (int)
Notes:
The byte order of the mantissa of binary data values on PC’s and DEC’s
is the reverse of so called "big endian" machines (IBM RS6000, SUN,etc.)
hence the need for byte-swapping capability. The subroutines in this code
have been tested for swapping between PCs and big endian machines, but
have not been tested for DEC products.
Caveat:
2 byte short, 4 byte long, 4 byte float, 4 byte int,
and 8 bit double assumed.
Credits:
CWP: John Stockwell (Jan 1994)
Institut fur Geophysik, Hamburg: Jens Hartmann supplied byte swapping
subroutines
66
THOM2HTI - Convert Thompson parameters V_p0, V_s0, eps, gamma,
to the HTI parameters alpha, beta, epsilon(V), delta(V),
gamma
Outputs:
alpha, beta, e(V), d(V), gamma
Notes:
Output is dumped to the screen and, if selected to outpar
67
THOM2STIFF - convert Thomsen’s parameters into (density normalized)
stiffness components for transversely isotropic
material with in-plane-tilted axis of symmetry
Output:
aijkl,cijkl (density normalized) stiffness components
68
TRANSP - TRANSPose an n1 by n2 element matrix
Required Parameters:
n1 number of elements in 1st (fast) dimension of matrix
Optional Parameters:
n2=all number of elements in 2nd (slow) dimension of matrix
nbpe=sizeof(float) number of bytes per matrix element
verbose=0 =1 for diagnostic information
69
TVNMOQC - Check tnmo-vnmo pairs; create t-v column files
Example:
tvnmoqc mode=1 \\
cdp=15,35 \\
tnmo=0.0091,0.2501,0.5001,0.7501,0.9941 \\
vnmo=1497.0,2000.0,2500.0,3000.0,3500.0 \\
tnmo=0.0082,0.2402,0.4902,0.7402,0.9842 \\
vnmo=1495.0,1900.0,2400.0,2900.0,3400.0
Required Parameter:
prefix= Prefix of output t-v file(s)
Required only for mode=2
Optional Parameter:
mode=1 1=qc: check that tnmo values increase
2=qc and output t-v files
mode=1
TVNMOQC checks that there is a tnmo and vnmo series for each CDP
and it checks that each tnmo series increases in time.
mode=2
TVNMOQC does mode=1 checking, plus ...
cdp=15,35,...,95 \\
tnmo=t151,t152,...,t15n \\
vnmo=v151,v152,...,v15n \\
tnmo=t351,t352,...,t35n \\
vnmo=v351,v352,...,v35n \\
tnmo=... \\
vnmo=... \\
tnmo=t951,t952,...,t95n \\
vnmo=v951,v952,...,v95n \\
t1 v1
t2 v2
70
...
tn vn
Credits:
MTU: David Forel (adapted from SUNMO)
71
UNIF2ANISO - generate a 2-D UNIFormly sampled profile of elastic
constants from a layered model.
Required Parameters:
none
Optional Parameters:
ninf=5 number of interfaces
nx=100 number of x samples (2nd dimension)
nz=100 number of z samples (1st dimension)
dx=10 x sampling interval
dz=10 z sampling interval
72
dddx=0.0,0.0,..., x-derivative of delta (dd/dx)
dddz=0.0,0.0,..., z-derivative of delta (dd/dz)
...output filenames
c11_file=c11_file output filename for c11 values
c13_file=c13_file output filename for c13 values
c15_file=c15_file output filename for c15 values
c33_file=c33_file output filename for c33 values
c35_file=c35_file output filename for c35 values
c44_file=c44_file output filename for c44 values
c55_file=c55_file output filename for c55 values
c66_file=c66_file output filename for c66 values
Notes:
The input file is an ASCII file containing x z values representing a
piecewise continuous velocity model with a flat surface on top.
73
number does not include the top surface of the model. The input data
format is the same as a CSHOT model file with all comments removed.
Credits:
CWP: John Stockwell, April 2005.
CWP: based on program unif2 by Zhenyue Liu, 1994
74
UNIF2 - generate a 2-D UNIFormly sampled velocity profile from a layered
model. In each layer, velocity is a linear function of position.
Required parameters:
none
Optional Parameters:
ninf=5 number of interfaces
nx=100 number of x samples (2nd dimension)
nz=100 number of z samples (1st dimension)
dx=10 x sampling interval
dz=10 z sampling interval
Notes:
The input file is an ASCII file containing x z values representing a
piecewise continuous velocity model with a flat surface on top. The surface
and each successive boundary between media are represented by a list of
selected x z pairs written column form. The first and last x values must
be the same for all boundaries. Use the entry 1.0 -99999 to separate
entries for successive boundaries. No boundary may cross another. Note
that the choice of the method of interpolation may cause boundaries
to cross that do not appear to cross in the input data file.
75
The number of interfaces is specified by the parameter "ninf". This
number does not include the top surface of the model. The input data
format is the same as a CSHOT model file with all comments removed.
Credits:
CWP: Zhenyue Liu, 1994
CWP: John Stockwell, 1994, added demonstration model stuff.
76
UNISAM2 - UNIformly SAMple a 2-D function f(x1,x2)
Required Parameters:
none
Optional Parameters:
x1= array of x1 values at which input f(x1,x2) is sampled
... Or specify a unform linear set of values for x1 via:
nx1=1 number of input samples in 1st dimension
dx1=1 input sampling interval in 1st dimension
fx1=0 first input sample in 1st dimension
...
n1=1 number of output samples in 1st dimension
d1= output sampling interval in 1st dimension
f1= first output sample in 1st dimension
x2= array of x2 values at which input f(x1,x2) is sampled
... Or specify a unform linear set of values for x2 via:
nx2=1 number of input samples in 2nd dimension
dx2=1 input sampling interval in 2nd dimension
fx2=0 first input sample in 2nd dimension
...
n2=1 number of output samples in 2nd dimension
d2= output sampling interval in 2nd dimension
f2= first output sample in 2nd dimension
...
method1=linear =linear for linear interpolation
=mono for monotonic bicubic interpolation
=akima for Akima bicubic interpolation
=spline for bicubic spline interpolation
method2=linear =linear for linear interpolation
=mono for monotonic bicubic interpolation
=akima for Akima bicubic interpolation
=spline for bicubic spline interpolation
NOTES:
The number of input samples is the number of x1 values times the
number of x2 values. The number of output samples is n1 times n2.
The output sampling intervals (d1 and d2) and first samples (f1 and f2)
default to span the range of input x1 and x2 values. In other words,
d1=(x1max-x1min)/(n1-1) and f1=x1min; likewise for d2 and f2.
77
value of x1 specified. Interpolation is then performed along the
1st dimension.
78
UNISAM - UNIformly SAMple a function y(x) specified as x,y pairs
Required Parameters:
xin=,,, array of x values (number of xin = number of yin)
yin=,,, array of y values (number of yin = number of xin)
... or
xfile= binary file of x values
yfile= binary file of y values
... or
xyfile= binary file of x,y pairs
npairs= number of pairs input (active only if xfile= and yfile=
or xyfile= are set)
Optional Parameters:
dxout=1.0 output x sampling interval
fxout=0.0 output first x
method=linear =linear for linear interpolation (continuous y)
=mono for monotonic cubic interpolation (continuous y’)
=akima for Akima’s cubic interpolation (continuous y’)
=spline for cubic spline interpolation (continuous y’’)
isint=,,, where these sine interpolations to apply
amp=,,, amplitude of sine interpolations
phase0=,,, starting phase (defaults: 0,0,0,...,0)
totalphase=,,, total phase (default pi,pi,pi,...,pi.)
nwidth=0 apply window smoothing if nwidth>0
79
function with starting phase being phase0, total phase
being totalphase (i.e. ending phase being phase0+totalphase
for each interpolation).
80
UTMCONV - CONVert longitude and latitude to UTM, and vice versa
Optional parameters:
idx=23 reference ellipsoid index (default is WGS 1984)
format=%.3f output number format (printf style for one float)
a=(from idx) user-specified semimajor axis of ellipsoid
f=(from idx) user-specified flattening of ellipsoid
letter=0 =1: use UTM letter designator for latitude/Northing
invert=0 =0: convert latitude and longitude to UTM
=1: convert UTM to latitude and longitude
verbose=0 =1: echo parameters and number of converted coords
Notes:
Universal Transverse Mercator (UTM) coordinates are defined between
latitudes 80S (-80) and 84N (84). Longitude values must be between
-180 degrees (west) and 179.999... degrees (east).
Example:
Convert 40.822N, 14.125E to UTM with zone number and letter,
output values rounded to nearest integer:
echo 14.125 40.822 | utmconv letter=1 format=%.0f
The output is "426213 4519366 33T" (Easting, Northing, UTM zone).
Reference ellipsoids:
An ellipsoid may be specified by its semimajor axis a and its
flattening f, or one of the following ellipsoids may be selected
by its index idx (semimajor axes in meters):
0 Sphere with radius of 6371000 m
81
1 Airy 1830
2 Australian National 1965
3 Bessel 1841 (Ethiopia, Indonesia, Japan, Korea)
4 Bessel 1841 (Namibia)
5 Clarke 1866
6 Clarke 1880
7 Everest (Brunei, E. Malaysia)
8 Everest (India 1830)
9 Everest (India 1956)
10 Everest (Pakistan)
11 Everest (W. Malaysia, Singapore 1948)
12 Everest (W. Malaysia 1969)
13 Geodetic Reference System 1980 (GRS 1980)
14 Helmert 1906
15 Hough 1960
16 Indonesian 1974
17 International 1924 / Hayford 1909
18 Krassovsky 1940
19 Modified Airy
20 Modified Fischer 1960
21 South American 1969
22 World Geodetic System 1972 (WGS 1972)
23 World Geodetic System 1984 (WGS 1984) / NAD 1983
UTM grid:
The Universal Transverse Mercator (UTM) system is a world wide
coordinate system defined between 80S and 84N. It divides the
Earth into 60 six-degree zones. Zone number 1 has its central
meridian at 177W (-177 degrees), and numbers increase eastward.
Author:
Nils Maercklin, RISSC, University of Naples, Italy, March 2007
82
References:
NIMA (2000). Department of Defense World Geodetic System 1984 -
its definition and relationships with local geodetic systems.
Technical Report TR8350.2. National Imagery and Mapping Agency,
Geodesy and Geophysics Department, St. Louis, MO. 3rd edition.
J. P. Snyder (1987). Map Projections - A Working Manual.
U.S. Geological Survey Professional Paper 1395, 383 pages.
U.S. Government Printing Office.
83
VEL2STIFF - Transforms VELocities, densities, and Thomsen or Sayers
parameters to elastic STIFFnesses
Required parameters:
vpfile= file with P-wave velocities
vsfile= file with S-wave velocities
rhofile= file with densities
Optional Parameters:
epsfile= file with Thomsen/Sayers epsilon
deltafile= file with Thomsen/Sayers delta
gammafile= file with Thomsen/Sayers gamma
phi_file= angle of axis of symmetry from vertical (radians)
Notes:
Transforms velocities, density and Thomsen/Sayers parameters
epsilon, delta, and gamma into elastic stiffness coefficients.
All input files vpfile, vsfile, rhofile etc. are assumed to consist
only of C style binary floating point numbers representing the
corresponding material values of vp, vs, rho etc. Similarly, the output
84
files consist of the coresponding stiffnesses as C style binary floats.
If the output files are to be used as input for a modeling program,
such as suea2df, then further, the contents are assumed be arrays of
floating point numbers of the form of Array[n2][n1], where the fast
dimension, dimension 1, represents depth.
Author:
CWP: Sverre Brandsberg-Dahl 1999
Extended:
CWP: Stig-Kyrre Foss 2001
- to include the option to use the parameters by Sayers (1995)
instead of the Thomsen parameters
Technical reference:
Sayers, C. M.: Simplified anisotropy parameters for transversely
isotropic sedimentary rocks. Geophysics 1995, pages 1933-1935.
85
VELCONV - VELocity CONVersion
Required Parameters:
intype= input data type (see valid types below)
outtype= output data type (see valid types below)
Optional Parameters:
nt=all number of time samples
dt=1.0 time sampling interval
ft=0.0 first time
nz=all number of depth samples
dz=1.0 depth sampling interval
fz=0.0 first depth
nx=all number of traces
Notes: nt, dt, and ft are used only for input and output functions
of time; you need specify these only for vintt, vrmst, orzt.
Likewise, nz, dz, and fz are used only for input and output
functions of depth.
The input and output data formats are C-style binary floats.
86
VELPERTAN - Velocity PERTerbation analysis in ANisotropic media to
determine the model update required to flatten image gathers",
Required Parameters:
refl1= file with picks on the 1st reflector
refl2= file with picks on the 2nd reflector
vfile= file defining VP0 at all grid points from prev. iter. ",
efile= file defining eps at all grid points from prev. iter. ",
dfile= file defining del at all grid points from prev. iter. ",
boundary= file defining the boundary above which
parameters are known; update is done below this ",
boundary ",
npicks1= number of picks on the 1st reflector
npicks2= number of picks on the 2nd reflector
ncdp= number of cdp’s
dcdp= cdp spacing
fcdp= first cdp
off0= first offset in common image gathers
noff= number of offsets in common image gathers
doff= offset increment in common image gathers
cip1=x1,r1,r2,..., cip=xn,r1n,r2n description of input CIGS
cip2=x2,r1,r2,..., cip=xn,r1n,r2n description of input CIGS
x x-value of a common image point
r1 hyperbolic component of the residual moveout
r2 non-hyperbolic component of residual moveout
Optional Parameters:
method=akima for linear interpolation of the interface
=mono for monotonic cubic interpolation of interface
=akima for Akima’s cubic interpolation of interface
=spline for cubic spline interpolation of interface
VP0=2000 Starting value for vertical velocity at a point in the
target layer
x00=0.0 x-coordinate at which VP0 is defined
z00=0.0 z-coordinate at which VP0 is defined
eps=0.0 Starting value for Thomsen’s parameter epsilon
del=0.0 Starting value for Thomsen’s parameter delta
kz=0.0 Starting value for the vertical gradient in VP0
kx=0.0 Starting value for the lateral gradient in VP0
nx=100 number of nodes in the horizontal direction for the
87
velocity grid
nz=100 number of nodes in the vertical direction for the
velocity grid
dx=10 horizontal grid increment
dz=10 vertical grid increment
fx=0 first horizontal grid point
fz=0 first vertical grid point
dt=0.008 traveltime increment
nt=500 no. of points on the ray
amax=360 max. angle of emergence
amin=0 min. angle of emergence
Smoothing parameters:
r1=0 smoothing parameter in the 1 direction
r2=0 smoothing parameter in the 2 direction
win=0,n1,0,n2 array for window range
rw=0 smoothing parameter for window function
nbound=2 number of points picked on the boundary
tol=0.1 tolerance in computing the offset (m)
Notes:
This program is used as part of the velocity analysis technique developed
by Debashish Sarkar, CWP:2003.
Notes:
The output par file contains the coefficients describing the residual
moveout. This program is used in conjunction with surelanan.
88
VELPERT - estimate velocity parameter perturbation from covariance
of imaged depths in common image gathers (CIGs)
Required Parameters:
dfile input of imaged depths in CIGs
dzfile=dzfile input of dz/dv at the imaged depths in CIGs
outfile output of the estimated parameter
noff number of offsets
ncip number of common image gathers
Optional Parameters:
moff=noff number of first offsets used in velocity estimation
Notes:
1. This program is part of Zhenyue Liu’s velocity analysis technique.
The input dzdv values are computed using the program dzdv.
2. For given depths, using moff smaller than noff may avoid poor
values of dz/dv at far offsets. However, a too small moff used
will the sensitivity of velocity error to the imaged depth.
3. Outfile contains three parts:
dlambda correction of the velocity paramter. dlambda plus
the initial parameter (used in migration) will be
the updated one.
deviation to measure how close imaged depths are to each other
in CIGs. Old deviation corresponds to the initial
parameter; new deviation corresponds to the updated one.
sensitivity to predict how sensitive the error in the estimated
parameter is to an error in the measurement of imaged
depths.
Reference:
Liu, Z. 1995, "Migration Velocity Analysis", Ph.D. Thesis, Colorado
School of Mines, CWP report #168.
89
VTLVZ -- Velocity as function of Time for Linear V(Z);
writes out a vector of velocity = v0 exp(a t/2)
Required parameters
nt= number of time samples
dt= time sampling interval
v0= velocity at the surface
a= velocity gradient
90
WKBJ - Compute WKBJ ray theoretic parameters, via finite differencing
Required Parameters:
<vfile file containing velocities v[nx][nz]
nx= number of x samples (2nd dimension)
nz= number of z samples (1st dimension)
xs= x coordinate of source
zs= z coordinate of source
Optional Parameters:
dx=1.0 x sampling interval
fx=0.0 first x sample
dz=1.0 z sampling interval
fz=0.0 first z sample
sfile=sfile file containing sigmas sg[nx][nz]
bfile=bfile file containing incident angles bet[nx][nz]
afile=afile file containing propagation angles a[nx][nz]
Notes:
Traveltimes, propagation angles, sigmas, and incident angles in WKBJ
by finite differences in polar coordinates. Traveltimes are calculated
by upwind scheme; sigmas and incident angles by a Crank-Nicolson scheme.
Credits:
CWP: Zhenyue Liu, Dave Hale, pre 1992.
91
XY2Z - converts (X,Y)-pairs to spike Z values on a uniform grid
Required parameter:
npairs= number of pairs input
Optional parameter:
scale=1.0 value to scale spikes by
nx1=100 dimension of first (fast) dimension of output array
nx2=100 dimension of second (slow) dimension of output array
x1pad=2 zero padding in x1 dimension
x2pad=2 zero padding in x2 dimension
yx=0 assume (x,y) pairs
=1 assume (y,x) pairs
Notes:
Converts ordered (x,y) pairs to spike x1values, of height=scale on a
uniform grid.
Credits:
CWP: John Stockwell, Nov 1995
92
Z2XYZ - convert binary floats representing Z-values to ascii
form in X Y Z ordered triples
Required parameters:
n1= number of floats in 1st (fast) dimension
Optional parameters:
Credits:
CWP: John Stockwell based on "b2a" by Jack Cohen
93
BHEDTOPAR - convert a Binary tape HEaDer file to PAR file format
Required parameter:
none
Optional parameters:
swap=0 =1 to swap bytes
outpar=/dev/tty =parfile name of output param file
Notes:
This program dumps the contents of a SEGY binary tape header file, as
would be produced by segyread and segyhdrs to a file in "parfile" format.
A "parfile" is an ASCII file containing entries of the form param=value.
Here "param" is the keyword for the binary tape header field and
"value" is the value of that field. The parfile may be edited as
any ASCII file. The edited parfile may then be made into a new binary tape
header file via the program setbhed.
Credits:
94
DT1TOSU - Convert ground-penetrating radar data in the Sensors & Software
X.dt1 GPR format to SU format.
Optional parameters:
ns=from header number of samples per trace
dt=.8 time sample interval (see below)
swap=1 perform byte swapping (big endian machines)
=0 don’t swap bytes (little endian machines)
verbose=0 silent
=1 S & S header values from first trace
sent to outpar
=2 S & S header values from all traces
sent to outpar
outpar=/dev/tty output parameter file
list=0 silent
=1 list explaining labels used in verbose
is printed to stderr
Notes:
For compatiblity with SEGY header, apparent dt is set to
.8 ms (800 microsecs). Actual dt is .8 nanosecs.
Using TRUE DISTANCES, this scales velocity
and frequency by a factor of 1 million.
Example: v_air = 9.83X10^8 ft/s (real)
v_air = 983 ft/s (apparent for su)
Example: fnyquist = 625 MHz (real)
fnyquist = 625 Hz (apparent for su)
Caveat:
This program has not been tested on DEC, some modification of the
byte swapping routines may be required.
Credits:
CWP: John Stockwell, Jan 1994 Based on a code "sugpr" by
UTULSA: Chris Liner & Bill Underwood (Dec93)
95
modifications permit S & S dt1 header information to be transferred
directly to SU header
Trace header fields set: ns, tracl, tracr, dt, delrt, trid,
hour, minute, second
96
LAS2SU - convert las2 format well log curves to su traces
Required parameters:
none
Optional parameters:
ncurve=automatic number of log curves in the las file
dz=0.5 input depth sampling (ft)
m=0 output (d1,f1) in feet
=1 output (d1,f1) in meters
ss=0 do not subsample (unless nz > 32767 )
=1 pass every other sample
verbose=0 =1 to echo las header lines to screen
outhdr=las_header.asc name of file for las headers
Notes:
1. It is recommended to run LAS_CERTIFY available from CWLS
at http://cwls.org.
2. First log curve MUST BE depth.
3. If number of depth levels > 32767 (segy NT limit)
then input is subsampled by factor of 2 or 4 as needed
4. Logs may be isolated using tracl header word (1,2,...,ncurve)
tracl=1 is depth
Credits:
* Chris Liner based on code by Ferhan Ahmed and a2b.c (June 2005)
* CWP: John Stockwell 31 Oct 2006, combining lasstrip and
* CENPET: lasstrip 2006 by Werner Heigl
*
* Ideas for improvement:
* add option to chop off part of logs (often shallow
* portions are not of interest
* cross check sampling interval from header against
* values found from first log curve (=depth)
*
97
SEGYCLEAN - zero out unassigned portion of header
Example:
segyread trmax=200 | segyclean | suximage
Credits:
CWP: Jack Cohen
98
char* sdoc[] = {
SEGYHDRMOD - replace the text header on a SEGY file
Required parameters:
====================================================================*\
\*====================================================================*/
99
SEGYHDRS - make SEG-Y ascii and binary headers for segywrite
Required parameters:
ns= if no input trace header
dt= if no input trace header
Optional parameters:
ns=tr.ns from header number of samples on input traces
dt=tr.dt from header sample rate (microseconds) from traces
bfile=binary name of file containing binary block
hfile=header name of file containing ascii block
Some binary header fields are set:
jobid=1 job id field
lino=1 line number (only one line per reel)
reno=1 reel number
format=1 data format
Caveat: This program has not been tested under XDR for machines
not having a 2 byte unsigned short integral data type.
Credits:
100
SEGYREAD - read an SEG-Y tape
or
Required parameter:
tape= input tape device or seg-y filename (see notes)
Optional parameters:
buff=1 for buffered device (9-track reel tape drive)
=0 possibly useful for 8mm EXABYTE drives
verbose=0 silent operation
=1 ; echo every ’vblock’ traces
vblock=50 echo every ’vblock’ traces under verbose option
hfile=header file to store ebcdic block (as ascii)
bfile=binary file to store binary block
over=0 quit if bhed format not equal 1, 2, 3, 5, or 8
= 1 ; override and attempt conversion
format=bh.format if over=1 try to convert assuming format value
conv=1 convert data to native format
= 0 ; assume data is in native format
ns=bh.hns number of samples (use if bhed ns wrong)
trcwt=1 apply trace weighting factor (bytes 169-170)
=0, do not apply. (Default is 0 for formats 1 and 5)
trmin=1 first trace to read
trmax=INT_MAX last trace to read
endian=1 set =0 for little-endian machines(PC’s,DEC,etc.)
errmax=0 allowable number of consecutive tape IO errors
remap=...,... remap key(s)
byte=...,... formats to use for header remapping
Notes:
Traditionally tape=/dev/rmt0. However, in the modern world tape device
names are much less uniform. The magic name can often be deduced by
"ls /dev". Likely man pages with the names of the tape devices are:
"mt", "sd" "st". Also try "man -k scsi", " man mt", etc.
Sometimes "mt status" will tell the device name.
101
Remark: a SEG-Y file is not the same as an su file. A SEG-Y file
consists of three parts: an ebcdic header, a binary reel header, and
the traces. The traces are (usually) in 32 bit IBM floating point
format. An SU file consists only of the trace portion written in the
native binary floats.
Formats supported:
1: IBM floating point, 4 byte (32 bits)
2: two’s complement integer, 4 byte (32 bits)
3: two’s complement integer, 2 byte (16 bits)
5: IEEE floating point, 4 byte (32 bits)
8: two’s complement integer, 1 byte (8 bits)
tape=- read from standard input. Caveat, under Solaris, you will
need to use the buff=1 option, as well.
Header remap:
The value of header word remap is mapped from the values of byte
Or all combined:
segyread <data >outdata remap=d1,sx,igc byte=221f,225l,229s
Segy header words are accessed as Xt where X denotes the byte number
starting at 1 in correspondance with the SEGY standard (1975)
Known types include: f float (4 bytes)
l long int (4 bytes)
s short int (2 bytes)
b byte (1 bytes)
Note:
102
If you have a tape with multiple sequences of ebcdic header,
binary header,traces, use the device that
invokes the no-rewind option and issue multiple segyread
commands (making an appropriate shell script if you
want to save all the headers). Consider using >> if
you want a single trace file in the end. Similar
considerations apply for multiple reels of tapes,
but use the standard rewind on end of file.
Note: For buff=1 (default) tape is accessed with ’read’, for buff=0
tape is accessed with fread. We suggest that you try buff=1
even with EXABYTE tapes.
Caveat: may be slow on an 8mm streaming (EXABYTE) tapedrive
Warning: segyread or segywrite to 8mm tape is fragile. Allow sufficient
time between successive reads and writes.
Warning: may return the error message "efclose: fclose failed"
intermittently when segyreading/segywriting to 8mm (EXABYTE) tape
even if actual segyread/segywrite is successful. However, this
error message may be returned if your tape drive has a fixed
block size set.
Caution: When reading or writing SEG-Y tapes, the tape
drive should be set to be able to read variable block length
tape files.
Credits:
SEP: Einar Kjartansson
CWP: Jack K. Cohen, Brian Sumner, Chris Liner
: John Stockwell (added 8mm tape stuff)
conv parameter added by:
Tony Kocurko
Department of Earth Sciences
Memorial University of Newfoundland
St. John’s, Newfoundland
read from stdin via tape=- added by Tony Kocurko
bhed format = 2,3 conversion by:
Remco Romijn (Applied Geophysics, TU Delft)
J.W. de Bruijn (Applied Geophysics, TU Delft)
bhed format = 8 conversion by: John Stockwell
header remap feature added by:
Matthias Imhof, Virginia Tech
--------------------------
Additional Notes:
103
Brian’s subroutine, ibm_to_float, which converts IBM floating
point to IEEE floating point is NOT portable and must be
altered for non-IEEE machines. See the subroutine notes below.
104
SEGYWRITE - write an SEG-Y tape
Required parameters:
tape= tape device to use (see sudoc segyread)
Optional parameter:
verbose=0 silent operation
=1 ; echo every ’vblock’ traces
vblock=50 echo every ’vblock’ traces under verbose option
buff=1 for buffered device (9-track reel tape drive)
=0 possibly useful for 8mm EXABYTE drive
conv=1 =0 don’t convert to IBM format
hfile=header ebcdic card image header file
bfile=binary binary header file
trmin=1 first trace to write
trmax=INT_MAX last trace to write
endian=1 =0 for little-endian machines (PC’s, DEC,etc...)
errmax=0 allowable number of consecutive tape IO errors
format= override value of format in binary header file
Note: For buff=1 (default) tape is accessed with ’write’, for buff=0
tape is accessed with fwrite. Try the default setting of buff=1
for all tape types.
Caveat: may be slow on an 8mm streaming (EXABYTE) tapedrive
Warning: segyread or segywrite to 8mm tape is fragile. Allow time
between successive reads and writes.
Precaution: make sure tapedrive is set to read/write variable blocksize
tapefiles.
105
or writing tapes in the SEG-Y format.
Credits:
SEP: Einar Kjartansson
CWP: Jack, Brian, Chris
: John Stockwell (added EXABYTE functionality)
Notes:
Brian’s subroutine, float_to_ibm, for converting IEEE floating
point to IBM floating point is NOT portable and must be
altered for non-IEEE machines. See the subroutine notes below.
On machines where shorts are not 2 bytes and/or ints are not
4 bytes, routines to convert SEGY 16 bit and 32 bit integers
will be required.
The program, segyhdrs, can be used to make the ascii and binary
files required by this code.
106
SETBHED - SET the fields in a SEGY Binary tape HEaDer file, as would be
produced by segyread and segyhdrs
Required parameter:
none
Optional parameters:
bfile=binary output binary tape header file
par= =parfile
Set field by field, if desired:
jobid= job id field
lino= line number (only one line per reel)
reno= reel number
format= data format
... etc....
To set any binary header field, use sukeyword to find out
the appropriate keyword, then use the getpar form:
keyword=value to set keyword to value
Notes:
As with all other programs in the CWP/SU package that use getpars,
(GET PARameters from the command line) a file filled with such
statments may be included via option par=parfile. In particular, a
parfile created by "bhedtopar" may be used as input for the program
"setbhed".
Credits:
107
SU3DCHART - plot x-midpoints vs. y-midpoints for 3-D data
Optional parameters:
outpar=null name of parameter file
degree=0 =1 convert seconds of arc to degrees
Example:
su3dchart <segy_data outpar=pfile >plot_data
psgraph <plot_data par=pfile \\
linewidth=0 marksize=2 mark=8 | ...
rm plot_data
Note: sx, etc., are declared double because float has only 7
significant numbers, that’s not enough, for example,
when tr.scalco=100 and coordinates are in second of arc
and located near 30 degree latitude and 59 degree longitude
Credits:
CWP: Shuki Ronen
Toralf Foerster
Trace header fields accessed: sx, sy, gx, gy, counit, scalco.
108
SUABSHW - replace header key word by its absolute value
Required parameters:
none
Optional parameter:
key=offset header key word
Credits:
CWP: Jack K. Cohen
109
SUACOR - auto-correlation
Optional Parameters:
ntout=101 odd number of time samples output
norm=1 if non-zero, normalize maximum absolute output to 1
sym=1 if non-zero, produce a symmetric output from
lag -(ntout-1)/2 to lag +(ntout-1)/2
Credits:
CWP: Dave Hale
110
SUADDEVENT - add a linear or hyperbolic moveout event to seismic data
Required parameters:
none
Optional parameters:
type=nmo =lmo for linear event
t0=1.0 zero-offset intercept time IN SECONDS
vel=3000. moveout velocity in m/s
amp=1. amplitude
dt= must provide if 0 in headers (seconds)
Typical usage:
sunull nt=500 dt=0.004 ntr=100 | sushw key=offset a=-1000 b=20 \\
| suaddevent v=1000 t0=0.05 type=lmo | suaddevent v=1800 t0=0.8 \
| sufilter f=8,12,75,90 | suxwigb clip=1 &
Credits:
Gary Billings, Talisman Energy, May 1996, Apr 2000, June 2001
111
char* sdoc[] = {
SUADDHEAD - put headers on bare traces and set the tracl and ns fields
Required parameter:
ns=the number of samples per trace
Optional parameter:
ifdef SU_LINE_HEADER
head= file to read headers in
not supplied -- will generate headers
given -- will read in headers and attach
floating point arrays to form
traces ",
(head can be created via sustrip program)
endif
ftn=0 Fortran flag
0 = data written unformatted from C
1 = data written unformatted from Fortran
tsort=3 trace sorting code:
1 = as recorded (no sorting)
2 = CDP ensemble
3 = single fold continuous profile
4 = horizontally stacked ",
ntrpr=1 number of data traces per record
if tsort=2, this is the number of traces per cdp",
Example:
suaddhead ns=1024 <bare_traces | sushw key=dt a=4000 >segy_traces
This command line adds headers with ns=1024 samples. The second part
of the pipe sets the trace header field dt to 4 ms.
112
SUADDNOISE - add noise to traces
Required parameters:
if any of f=f1,f2,... and amp=a1,a2,... are specified by the user
and if dt is not set in header, then dt is mandatory
Optional parameters:
sn=20 signal to noise ratio
noise=gauss noise probability distribution
=flat for uniform; default Gaussian
seed=from_clock random number seed (integer)
f=f1,f2,... array of filter frequencies (as in sufilter)
amps=a1,a2,... array of filter amplitudes
dt= (from header) time sampling interval (sec)
verbose=0 =1 for echoing useful information
Notes:
Output = Signal + scale * Noise
Credits:
CWP: Jack Cohen, Brian Sumner, Ken Larner
John Stockwell (fixed filtered noise option)
113
Notes:
At S/N = 2, the strongest reflector is well delineated, so to
see something 1/nth as strong as this dominant reflector
requires S/N = 2*n.
114
SUADDSTATICS - ADD random STATICS on seismic data
Required parameters:
shift= the static shift will be generated
randomly in the interval [+shift,-shif] (ms)
sources= number of source locations
receivers= number of receiver locations
cmps= number of common mid point locations
maxfold= maximum fold of input data
datafile= name and COMPLETE path of the input file
Optional parameters:
dt=tr.dt time sampling interval (ms)
seed=getpid() seed for random number generator
verbose=0 =1 print useful information
Notes:
SUADDSTATICS applies static time shifts in a surface consistent way on
seismic data sets. SUADDSTATICS writes the static time shifts in the
header field TSTAT. To perform the actual shifts the user should use
the program SUSTATIC after SUADDSTATICS. SUADDSTATICS outputs the
corrupted data set to stdout.
115
SUALFORD - trace by trace Alford Rotation of shear wave data volumes
Required Parameters:
inS11= input data volume for the 11 component
inS12= input data volume for the 12 component
inS21= input data volume for the 21 component
inS22= input data volume for the 22 component
outS11= output data volume for the 11 component
outS12= output data volume for the 11 component
outS21= output data volume for the 11 component
outS22= output data volume for the 11 component
Optional parameters:
angle_inc= sets the increment to the angle by which
the data sets are rotated. The minimum is
set to be 1 degree and default is 5.
Az_key= to set the header field storing the azimuths
for the fast shear wave on the output volumes
Q_key= to set the header field storing the quality
factors of performed optimum rotations
lag_key= to set the header field storing the lag in
miliseconds the fast and slow shear components
xcorr_key= to set the header field containing the maxi-
mum normalized cross-correlation between the
and slow shear waves.
taper= 2*taper+1 is the length of the sample overlap
between the unrotated data with the rotated
data on the traces. The boundary between them
is defined by time windowning.
taper = -1, for no-overlap
taper = 0, for overlap of one sample
taper =>1, for use of cosine scale to
to interpolate between the
unrotated and rotated parts
of the traces
116
can focus on a given reflector. Also given in
number of samples
Notes:
The fields in the header containing the Azimuth and Quality factor
and the sample lag between fast and slow shear are otrav, grnolf and
grnofr, respectively, by default. The values are multiplied by ten in
the case of the angles and by a thousand for quality factors. To
change this defaults use the optional parameters Az_key, Q_key and
lag_key
Credits:
CWP: Rodrigo Felicio Fuck
117
Code translated and adapted from original version in Fortran
by Ted Schuck (1993)
118
SUAMP - output amp, phase, real or imag trace from
(frequency, x) domain data
Required parameters:
none
Optional parameter:
mode=amp output flag
amp = output amplitude traces
phase = output phase traces
real = output real parts
imag = output imag parts
Note:
The trace returned is half length from 0 to Nyquist.
Example:
sufft <data | suamp >amp_traces
Example:
sufft < data > complex_traces
suamp < complex_traces mode=real > real_traces
suamp < complex_traces mode=imag > imag_traces
Credits:
CWP: Shuki, Jack
Notes:
If efficiency becomes important consider inverting main loop
and repeating extraction code within the branches of the switch.
119
SUASCII - print non zero header values and data in various formats
Optional parameter:
bare=0 print headers and data
=1 print only data
=2 print headers only
=3 print data in print data in .csv format, e.g. for Excel
=4 print data as tab delimited .txt file, e.g. for GnuPlot
=5 print data as .xyz file, e.g. for plotting with GMT
Notes:
The programs suwind and suresamp provide trace selection and
subsampling, respectively.
With bare=0 and bare=1 traces are separated by a blank line.
120
Credits:
CWP: Jack K. Cohen c. 1989
CENPET: Werner M. Heigl 2006 - bug fixes & extensions
RISSC: Nils Maercklin 2006
Trace header field accessed: ns, dt, delrt, d1, f1, trid
121
SUATTRIBUTES - instantaneous trace ATTRIBUTES
Required parameters:
none
Optional parameter:
mode=amp output flag
=amp envelope traces
=phase phase traces
=freq frequency traces
=freqw Frequency Weighted Envelope
=thin Thin-Bed (inst. freq - average freq)
=bandwith Instantaneous bandwidth
=normamp Normalized Phase (Cosine Phase)
=fdenv 1st envelope traces derivative
=sdenv 2nd envelope traces derivative
=q Ins. Q Factor
unwrap= default unwrap=0 for mode=phase
default unwrap=1 for mode=freq
dphase_min=PI/unwrap
wint= windowing for freqw
windowing for thin
default=1
o--------o--------o
data-1 data data+1
Notes:
This program performs complex trace attribute analysis. The first three
attributes, amp,phase,freq are the classical Taner, Kohler, and
Sheriff, 1979.
The unwrap parameter is active only for mode=freq and mode=phase. The
quantity dphase_min is the minimum change in the phase angle taken to be
the result of phase wrapping, rather than natural phase variation in the
data. Setting unwrap=0 turns off phase-unwrapping altogether. Choosing
unwrap > 1 makes the unwrapping function more sensitive to phase changes.
Setting unwrap > 1 may be necessary to resolve higher frequencies in
data (or sample data more finely). The phase unwrapping is crude. The
differentiation needed to compute the instantaneous frequency
122
freq(t)= d(phase)/dt is a simple centered difference.
Examples:
suvibro f1=10 f2=50 t1=0 t2=0 tv=1 | suattributes2 mode=amp | ...
suvibro f1=10 f2=50 t1=0 t2=0 tv=1 | suattributes2 mode=phase | ...
suvibro f1=10 f2=50 t1=0 t2=0 tv=1 | suattributes2 mode=freq | ...
suplane | suattributes mode=... | supswigb |...
Credits:
CWP: Jack Cohen
CWP: John Stockwell (added freq and unwrap features)
UGM (Geophysics Students): Agung Wiyono
email:[email protected] (others)
Algorithm:
c(t) = hilbert_tranform_kernel(t) convolved with data(t)
123
SUAZIMUTH - compute trace AZIMUTH, offset, and midpoint coordinates
and set user-specified header fields to these values
Required parameters:
none
Optional parameters:
key=otrav header field to store computed azimuths in
scale=1.0 value(key) = scale * azimuth
az=0 azimuth convention flag
0: 0-179.999 deg, reciprocity assumed
1: 0-359.999 deg, points from receiver to source
-1: 0-359.999 deg, points from source to receiver
sector=1.0 if set, defines output in sectors of size
sector=degrees_per_sector, the default mode is
the full range of angles specified by az
Notes:
All values are computed from the values in the coordinate fields
sx,sy (source) and gx,gy (receiver).
The output field "otrav" for the azimuth was chosen arbitrarily as
an example of a little-used header field, however, the user may
choose any field that is convenient for his or her application.
For az=0, azimuths are measured from the North, however, reciprocity
is assumed, so azimuths go from 0 to 179.9999 degrees. If sector
option is set, then the range is from 0 to 180/sector.
For az=1, azimuths are measured from the North, with the assumption
that the direction vector points from the receiver to the source.
124
For az=-1, the direction vector points from the source to the
receiver. No reciprocity is assumed in these cases, so the angles go
from 0 to 359.999 degrees.
If the sector option is set, then the range is from 0 to 360/sector.
Caveat:
This program honors the value of scalco in scaling the values of
sx,sy,gx,gy. Type "sukeyword scalco" for more information.
Credits:
based on suchw, su3dchart
CWP: John Stockwell and UTulsa: Chris Liner, Oct. 1998
UTulsa: Chris Liner added offset option, Feb. 2002
cll: fixed offset option and added cmp option, May 2003
RISSC: Nils Maercklin added key options for offset and
midpoints, and added azimuth direction option, Sep. 2006
Algorithms:
offset = osign * sqrt( (gx-sx)*(gx-sx) + (gy-sy)*(gy-sy) )
with osign = sgn( min((sx-gx),(sy-gy)) )
125
SUBFILT - apply Butterworth bandpass filter
Required parameters:
if dt is not set in header, then dt is mandatory
Credits:
CWP: Dave for bf.c subs and test drivers
CWP: Jack for su wrapper
126
SUCCWT - Complex continuous wavelet transform of seismic traces
Required Parameters:
None
Optional Parameters:
noct=5 Number of octaves (int)
nv=10 Number of voices per octave (int)
fmax=Nyq Highest frequency in transform
p=-0.5 Power of scale value normalizing CWT
=0 for amp-preserved spec. decomp.
c=1/(2*fmax) Time-domain inverse gaussian damping parameter
(bigger c means more wavelet oscillations,
default gives minimal oscillations)
k=1 Use complex Morlet as wavelet transform kernel
=2 use Fourier kernel ... Exp[i 2 pi f t]
fs=1 Use dyadic freq sampling (CWT standard, honors
noct, nv)
=2 use linear freq sampling (Fourier standard)
df=1 Frequency sample interval in Hz (used only for fs=2)
NOTE: not yet implimented (hardwired to df=1)
dt=(from tr.dt) Sample interval override (in secs, if time data)
verbose=0 Run silent, except echo c value. (=1 for more info)
Examples:
This generates amplitude spec of the CWT impulse response (IR).
suspike ntr=1 ix1=1 nt=125 | succwt | suamp | suximage &
Real part of Fourier IR with linear freq sampling:
suspike ntr=1 ix1=1 nt=125 | succwt k=2 fs=2 | suamp mode=real | suximage &
Real part of Fourier IR with dyadic freq sampling:
suspike ntr=1 ix1=1 nt=125 | succwt k=2 | suamp mode=real | suximage &
Notes:
1. Total number of scales: nscale = noct*nv
2. Each input trace spawns nscale complex output traces
3. Lowest frequency in the transform is fmax/( 2^(noct-1/nv) )
4. Header field (cdp) used as cwt spectrum counter
5. Header field (cdpt) used as scale counter within cwt spectrum
127
6. Header field (gut) holds number of cwt scales ‘na’
7. Header field (unscale) holds CWT scale ‘a’
todo:
fix fs=2 case to allow df not equal to 1
History:
6/18/04
major overhaul by Clapp, including fourier implementation.
Speedup ~ 41 times (4100 %)
2/20/04
made p=-0.5 default
2/16/04
added p option to experiment with CWT normalization
2/12/04
replace fb (bandwidth parameter) with c (t-domain gaussian damping const.)
2/10/04 --- in sync with EAS paper in prep
changed morlet scaling (c = 1) to preserve time-domain peak amplitude
changed morlet exp sign to std CWT definition (conjugate) and
mathematica result that only gives positive freq gaussian with neg exp
1/26/04
added linear frequency sampling option
1/23/04
figured out fb and made it a getpar
key: Look at real ccwt output and determine fb by number of
oscillations desired: Default gives -+-+-+-
1/20/04
beefed up verbose output
dimension wavelet to length 2*nt and change correlation call
... this is done to avoid conv edge effects
1/19/04
added fourier wavlet option for comparison with Fourier Transform action
1/17/04
complex morlet amp scaling now set to preserve first scale amp with IR
1/16/04
added dt getpar to handle depth input properly
128
preserves first tracl so tracl is ok after spice
11/11/03
initial version
129
SUCDDECON - DECONvolution with user-supplied filter by straightforward
Complex Division in the frequency domain
Required parameters:
filter= ascii filter values separated by commas
...or...
sufile= file containing SU traces to use as filter
(must have same number of traces as input data
for panel=1)
Optional parameters:
panel=0 use only the first trace of sufile as filter
=1 decon trace by trace an entire gather
pnoise=0.001 white noise factor for stabilizing results
(see below)
centered=0 not centered, =1 center the output on each trace
verbose=0 silent, =1 chatty
Notes:
For given time-domain input data I(t) (stdin) and deconvolution
filter F(t), the frequency-domain deconvolved trace can be written as:
Credits:
CWP: Ivan Vasconcelos
some changes by John Stockwell
130
CAVEATS:
In the option, panel=1 the number of traces in the sufile must be
the same as the number of traces on the input.
131
SUCENTSAMP - CENTRoid SAMPle seismic traces
Required parameters:
none
Optional parameters:
dt=from header sampling interval
verbose=1 =0 to stop advisory messages
Notes:
This program takes seismic traces as input, and returns traces
consisting of spikes of height equal to the area of each lobe
of each oscillation, located at the centroid of the lobe in
question. The height of each spike equal to the area of the
corresponding lobe.
Caveat: No check is made that the data are real time traces!
Credits:
132
SUCHART - prepare data for x vs. y plot
Required parameters:
none
Optional parameters:
key1=sx abscissa
key2=gx ordinate
outpar=null name of parameter file
Examples:
suchart < sudata outpar=pfile >plot_data
psgraph <plot_data par=pfile title="CMG" \\
linewidth=0 marksize=2 mark=8 | ...
rm plot_data
fold chart:
suchart < stacked_data key1=cdp key2=nhs |
psgraph n=NUMBER_OF_TRACES d1=.004 \\
linewidth=0 marksize=2 mark=8 > chart.ps
Credits:
SEP: Einar Kjartansson
CWP: Jack K. Cohen
Notes:
The vtof routine from valpkge converts values to floats.
133
SUCHW - Change Header Word using one or two header word fields
Required parameters:
none
Optional parameters:
key1=cdp,... output key(s)
key2=cdp,... input key(s)
key3=cdp,... input key(s)
a=0,... overall shift(s)
b=1,... scale(s) on first input key(s)
c=0,... scale on second input key(s)
d=1,... overall scale(s)
e=1,... exponent on first input key(s)
f=1,... exponent on second input key(s)
Examples:
Shift cdp numbers by -1:
suchw <data >outdata a=-1
134
Credits:
SEP: Einar Kjartansson
CWP: Jack K. Cohen
CWP: John Stockwell, 7 July 1995, added array of keys feature
Delphi: Alexander Koek, 6 November 1995, changed calculation so
headers of different types can be expressed in each other
135
SUCLIPHEAD - Clip header values
Required parameters:
none
Optional parameters:
key=cdp,... header key word(s) to clip
min=0,... minimum value to clip
max=ULONG_MAX,ULONG_MAX,... maximum value to clip
Credits:
Geocon: Garry Perratt
136
char* sdoc[] = {
SUCMP - CoMPare two seismic data sets, returns 0 to the shell ",
if the same and 1 if different
Required parameters:
none
Optional parameters:
limit=1.0e-4 normalized difference threshold value
Notes:
This program is the seismic equivalent of the Unix cmp(1)
command. However, unlike cmp(1), it understands seismic data
and will consider files which have only small numerical
differences to be the same.
Sucmp first checks that the number of traces and number of samples
are the same. It then compares the trace headers bit for bit.
Finally it checks that the fractional difference of A & B is
less than limit.
./fubar par=tst1.par
sucmp tst1.su ref/tst1.su
if [ $? ]
then
suxwigb <tst1.su &
suxwigb <ref/tst1.su & "
fi
137
Author: Reginald H. Beardsley
[email protected]
Algorithm:
Note that the program exits as soon as the files fail to match.
138
SUCOMMAND - pipe traces having the same key header word to command
Required parameters:
none
Optional parameters:
verbose=0 wordy output
key=cdp header key word to pipe on
command="suop nop" command piped into
dir=0 0: change of header key
-1: break in monotonic decrease of header key
+1: break in monotonic increase of header key
Notes:
This program permits limited parallel processing capability by opening
pipes for processes, signaled by a change in key header word value.
Credits:
VT: Matthias Imhof
Note:
The "valxxx" subroutines are in su/lib/valpkge.c. In particular,
"valcmp" shares the annoying attribute of "strcmp" that
if (valcmp(type, val, valnew) {
...
}
will be performed when val and valnew are different.
139
SUCONV - convolution with user-supplied filter
Optional parameters:
none
Examples:
suplane | suwind min=12 max=12 >TRACE
suconv<DATA sufile=TRACE | ...
Here, the su data file, "DATA", is convolved trace by trace with the
the single su trace, "TRACE".
Credits:
CWP: Jack K. Cohen, Michel Dietrich
Modification:
CWP: Huub Douma (HD), 14/01/2005
Implemented correct use of delrt
140
141
SUCOUNTKEY - COUNT the number of unique values for a given KEYword.
Globals variables*/
segy tr;
internal structure
typedef struct {
int num;
Value *val;
} my_Count;
/* Initialize
initargs(argc, argv);
requestdoc(1);
142
/* Get "key" values
if ((nkeys=countparval("key"))!=0) {
getparstringarray("key",key);
} else {
key[0]="cdp";
}
if (!getparint("verbose", &verbose)) verbose = 1;
if (i==count_table[ikey].num){
gethval(&tr, index[ikey], &count_table[ikey].val[count_table[ikey].num]);
count_table[ikey].num++;
}
143
}
if (verbose==1)
warn("The counting of key word is finished, the total number for specified header is
for (ikey=0;ikey<nkeys;++ikey){
if (verbose==1)
warn(" key %s has %d unique entries in this data", key[ikey], count_table[ikey].num)
else
fprintf(stdout,"%s %d ", key[ikey], count_table[ikey].num);
return(CWP_Exit());
}
144
SUCWT - generates Continous Wavelet Transform amplitude, regularity
analysis in the wavelet basis
Required Parameters:
none
Optional Parameters:
base=10 Base value for wavelet transform scales
first=-1 First exponent value for wavelet transform scales
expinc=0.01 Exponent increment for wavelet transform scales
last=1.5 Last exponent value for wavelet transform scales
Wavelet Parameters:
wtype=0 2nd derivative of Gaussian (Mexican hat)
=1 4th derivative of Gaussian (witch’s hat)
=2 6th derivative of Gaussian (wizard’s hat)
nwavelet=1024 number of samples in the wavelet
xmin=-20 minimum x value wavelet is computed
xcenter=0 center x value wavelet is computed
xmax=20 maximum x value wavelet is computed
sigma=1 sharpness parameter ( sigma > 1 sharper)
Notes:
This is the CWT version of the time frequency analysis notion that is
applied in sugabor.
The parameter base is the base of the power that is applied to scale
the wavelet. Some mathematical literature assume base 2. Base 10 works
well here.
145
divisor=1.0 means the exponent is computed simply by fitting a line
through all of the values in the transform. A value of divisor>1.0
indicates that the Holder exponent is determined as the max of slopes
found in (total scales)/divisor length segments.
Credits:
CWP: John Stockwell, Nov 2004
inspired in part by "bhpcwt" in the BHP_SU package, code written by
BHP: Michael Glinsky, c. 2002, based loosely on a Matlab CWT function
References:
146
SUDATUMFD - 2D zero-offset Finite Difference acoustic wave-equation
DATUMing
Required parameters:
Optional parameters:
Notes:
The algorithm is a 45-degree implicit-finite-difference scheme based
on the one-way wave equation. It works on poststack (zero-offset)
data only. The two velocity files, vfile1 and vfile2, are binary
files containing floats with the format v[ix][iz]. There are two
potentially different velocity files for the thin-lens and
diffraction terms to allow for the use of a zero-velocity layer
which allows for datuming from an irregular surface.
147
References:
Beasley, C., and Lynn, W., 1992, The zero-velocity layer: migration
from irregular surfaces: Geophysics, 57, 1435-1443.
148
SUDATUMK2DR - Kirchhoff datuming of receivers for 2D prestack data
(shot gathers are the input)
Required parameters:
infile=stdin file for input seismic traces
outfile=stdout file for common offset migration output
ttfile= file for input traveltime tables
The following 9 parameters describe traveltime tables:
fzt= first depth sample in traveltime table
nzt= number of depth samples in traveltime table
dzt= depth interval in traveltime table
fxt= first lateral sample in traveltime table
nxt= number of lateral samples in traveltime table
dxt= lateral interval in traveltime table
fs= x-coordinate of first source
ns= number of sources
ds= x-coordinate increment of sources
Optional Parameters:
dt= or from header (dt) time sampling interval of input data
ft= or from header (ft) first time sample of input data
surf="0,0;99999,0" The first surface defined the recording surface
surf="0,0;99999,0" and the second one, the new datum.
"x1,z1;x2,z2;x3,z3;...
fzo=fzt z-coordinate of first point in output trace
dzo=0.2*dzt vertical spacing of output trace
nzo=5*(nzt-1)+1 number of points in output trace ",
fxso=fxt x-coordinate of first shot
dxso=0.5*dxt shot horizontal spacing
nxso=2*(nxt-1)+1 number of shots
fxgo=fxt x-coordinate of first receiver
dxgo=0.5*dxt receiver horizontal spacing
nxgo=nxso number of receivers per shot
fmax=0.25/dt frequency-highcut for input traces
offmax=99999 maximum absolute offset allowed in migration
aperx=nxt*dxt/2 migration lateral aperature
149
angmax=60 migration angle aperature from vertical
v0=1500(m/s) reference velocity value at surface
dvz=0.0 reference velocity vertical gradient
antiali=1 Antialiase filter (no-filter = 0)
jpfile=stderr job print file name
mtr=100 print verbal information at every mtr traces
ntr=100000 maximum number of input traces to be migrated
Notes:
1. Traveltime tables were generated by program rayt2d (or other ones)
on relatively coarse grids, with dimension ns*nxt*nzt. In the
datuming process, traveltimes are interpolated into shot/gephone
positions and output grids.
2. Input traces must be SU format and organized in common rec. gathers
3. If the offset value of an input trace is not in the offset array
of output, the nearest one in the array is chosen.
4. Amplitudes are computed using the reference velocity profile, v(z),
specified by the parameters v0= and dvz=.
5. Input traces must specify source and receiver positions via the header
fields tr.sx and tr.gx. Offset is computed automatically.
References :
150
Berryhill, J.R., 1979, Wave equation datuming: Geophysics,
44, 1329--1344.
151
SUDATUMK2DS - Kirchhoff datuming of sources for 2D prestack data
(input data are receiver gathers)
Required parameters:
infile=stdin file for input seismic traces
outfile=stdout file for common offset migration output
ttfile= file for input traveltime tables
The following 9 parameters describe traveltime tables:
fzt= first depth sample in traveltime table
nzt= number of depth samples in traveltime table
dzt= depth interval in traveltime table
fxt= first lateral sample in traveltime table
nxt= number of lateral samples in traveltime table
dxt= lateral interval in traveltime table
fs= x-coordinate of first source
ns= number of sources
ds= x-coordinate increment of sources
Optional Parameters:
dt= or from header (dt) time sampling interval of input data
ft= or from header (ft) first time sample of input data
surf="0,0;99999,0" The first surface defined the recording surface
surf="0,0;99999,0" and the second one, the new datum.
"x1,z1;x2,z2;x3,z3;...
fzo=fzt z-coordinate of first point in output trace
dzo=0.2*dzt vertical spacing of output trace
nzo=5*(nzt-1)+1 number of points in output trace ",
fxso=fxt x-coordinate of first shot
dxso=0.5*dxt shot horizontal spacing
nxso=2*(nxt-1)+1 number of shots
fxgo=fxt x-coordinate of first receiver
exgo=fxgo+(nxgo-1)*dxgo x-coordinate of the last receiver
dxgo=0.5*dxt receiver horizontal spacing
nxgo=nxso number of receivers per shot
fmax=0.25/dt frequency-highcut for input traces
offmax=99999 maximum absolute offset allowed in migration
152
aperx=nxt*dxt/2 migration lateral aperature
angmax=60 migration angle aperature from vertical
v0=1500(m/s) reference velocity value at surface
dvz=0.0 reference velocity vertical gradient
antiali=1 Antialiase filter (no-filter = 0)
jpfile=stderr job print file name
mtr=100 print verbal information at every mtr traces
ntr=100000 maximum number of input traces to be migrated
Notes:
1. Traveltime tables were generated by program rayt2d (or other ones)
on relatively coarse grids, with dimension ns*nxt*nzt. In the
migration process, traveltimes are interpolated into shot/gephone
positions and output grids.
2. Input traces must be SU format and organized in common shot gathers
3. If the offset value of an input trace is not in the offset array
of output, the nearest one in the array is chosen.
4. Amplitudes are computed using the reference velocity profile, v(z),
specified by the parameters v0= and dvz=.
5. Input traces must specify source and receiver positions via the header
fields tr.sx and tr.gx. Offset is computed automatically.
References :
153
Berryhill, J.R., 1979, Wave equation datuming: Geophysics,
44, 1329--1344.
154
SUDIPDIVCOR - Dip-dependent Divergence (spreading) correction
Required Parameters:
dxcdp distance between sucessive cdps in meters
Optional Parameters:
np=50 number of slopes
tmig=0.0 times corresponding to interval velocities in vmig
vmig=1500.0 interval velocities corresponding to times in tmig
vfile=binary (non-ascii) file containing velocities vmig(t)
conv=0 =1 to apply the conventional divergence correction
trans=0 =1 to include transmission factors
verbose=0 =1 for diagnostic print
Notes:
The tmig, vmig arrays specify an interval velocity function of time.
Linear interpolation and constant extrapolation is used to determine
interval velocities at times not specified. Values specified in tmig
must increase monotonically.
155
SUDIPFILT - DIP--or better--SLOPE Filter in f-k domain
Required Parameters:
dt=(from header) if not set in header then mandatory
dx=(from header, d1) if not set in header then mandatory
Optional parameters:
slopes=0.0 monotonically increasing slopes
amps=1.0 amplitudes corresponding to slopes
bias=0.0 slope made horizontal before filtering
Notes:
d2 is an acceptable alias for dx in the getpar
Credits:
156
Trace header fields accessed: ns, dt, d2
157
SUDIVCOR - Divergence (spreading) correction
Required Parameters:
none
Optional Parameters:
trms=0.0 times corresponding to rms velocities in vrms
vrms=1500.0 interval velocities corresponding to times in trms
vfile= binary (non-ascii) file containing velocities vrms(t)
Notes:
The trms, vrms arrays specify an rms velocity function of time.
Linear interpolation and constant extrapolation is used to determine
interval velocities at times not specified. Values specified in trms
must increase monotonically.
Credits:
CWP: Jack K. Cohen, Francesca Fazarri
158
SUDIVSTACK - Diversity Stacking using either average power or peak
power within windows
Required parameters:
none
Optional parameters:
key=tracf key header word to stack on
winlen=0.064 window length in seconds.
typical choices: 0.064, 0.128, 0.256,
0.512, 1.024, 2.048, 4.096
if not specified the entire trace is used
Notes:
Diversity stacking is a noise reduction technique used in the
summation of duplicate data. Each trace is scaled by the inverse
of its average power prior to stacking. The composite trace is
then renormalized by dividing by the sum of the scalers used.
This program stacks adjacent traces having the same key header
word, which can be specified by the key parameter. The default
is "tracf" (trace number within field record).
For more information on key header words, type "sukeyword -o".
Examples:
For duplicate field shot records:
susort < field.data tracf | sudivstack > stack.data
For CDP ordered data:
sudivstack < cdp.data key=cdp > stack.data
References:
159
Embree, P.,1968, Diversity seismic record stacking method and system:
U.S. patent 3,398,396.
Gimlin, D. R., and Smith, J. W., 1980, A comparison of seismic trace
summing techniques: Geophysics, vol. 45, pages 1017-1041.
160
SUDMOFKCW - converted-wave DMO via F-K domain (log-stretch) method for
common-offset gathers
Required Parameters:
cdpmin minimum cdp (integer number) for which to apply DMO
cdpmax maximum cdp (integer number) for which to apply DMO
dxcdp distance between adjacent cdp bins (m)
noffmix number of offsets to mix (see notes)
Optional Parameters:
tdmo=0.0 times corresponding to rms velocities in vdmo (s)
vdmo=1500.0 rms velocities corresponding to times in tdmo (m/s)
gamma=0.5 velocity ratio, upgoing/downgoing
ntable=1000 number of tabulated z/h and b/h (see notes)
sdmo=1.0 DMO stretch factor; try 0.6 for typical v(z)
flip=0 =1 for negative shifts and exchanging s1 and s2
(see notes below)
fmax=0.5/dt maximum frequency in input traces (Hz)
verbose=0 =1 for diagnostic print
Notes:
Input traces should be sorted into common-offset gathers. One common-
offset gather ends and another begins when the offset field of the trace
headers changes.
The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
the cdp location expressed in units of meters or feet.
The number of offsets to mix (noffmix) should typically equal the ratio of
the shotpoint spacing to the cdp spacing. This choice ensures that every
cdp will be represented in each offset mix. Traces in each mix will
contribute through DMO to other traces in adjacent cdps within that mix.
The tdmo and vdmo arrays specify a velocity function of time that is
used to implement a first-order correction for depth-variable velocity.
The times in tdmo must be monotonically increasing. The velocity function
is assumed to have been gotten by traditional NMO.
For each offset, the minimum time at which a non-zero sample exists is
used to determine a mute time. Output samples for times earlier than this",
mute time will be zeroed. Computation time may be significantly reduced
161
if the input traces are zeroed (muted) for early times at large offsets.
Flip factor = 1 implies positive shift of traces (in the increasing CDP
bin number direction). When processing split-spread data, for example,
if one side of the spread is processed with flip=0, then the other side
of the spread should be processed with flip=1. The flip factor also
determines the actions of the factors s1 and s2, i.e., stretching or
squeezing.
Credits:
CWP: Mohamed Alfaraj
Dave Hale
Technical Reference:
Transformation to zero offset for mode-converted waves
Mohammed Alfaraj, Ph.D. thesis, 1993, Colorado School of Mines
162
SUDMOFK - DMO via F-K domain (log-stretch) method for common-offset gathers
Required Parameters:
cdpmin minimum cdp (integer number) for which to apply DMO
cdpmax maximum cdp (integer number) for which to apply DMO
dxcdp distance between adjacent cdp bins (m)
noffmix number of offsets to mix (see notes)
Optional Parameters:
tdmo=0.0 times corresponding to rms velocities in vdmo (s)
vdmo=1500.0 rms velocities corresponding to times in tdmo (m/s)
sdmo=1.0 DMO stretch factor; try 0.6 for typical v(z)
fmax=0.5/dt maximum frequency in input traces (Hz)
verbose=0 =1 for diagnostic print
tmpdir= if non-empty, use the value as a directory path prefix
for storing temporary files; else if the CWP_TMPDIR
environment variable is set use its value for the path;
else use tmpfile()
Notes:
Input traces should be sorted into common-offset gathers. One common-
offset gather ends and another begins when the offset field of the trace
headers changes.
The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
the cdp location expressed in units of meters or feet.
The number of offsets to mix (noffmix) should typically equal the ratio of
the shotpoint spacing to the cdp spacing. This choice ensures that every
cdp will be represented in each offset mix. Traces in each mix will
contribute through DMO to other traces in adjacent cdps within that mix.
The tdmo and vdmo arrays specify a velocity function of time that is
used to implement a first-order correction for depth-variable velocity.
The times in tdmo must be monotonically increasing.
For each offset, the minimum time at which a non-zero sample exists is
used to determine a mute time. Output samples for times earlier than this",
mute time will be zeroed. Computation time may be significantly reduced
if the input traces are zeroed (muted) for early times at large offsets.
163
Credits:
CWP: Dave
Technical Reference:
Dip-Moveout Processing - SEG Course Notes
Dave Hale, 1988
164
SUDMOTIVZ - DMO for Transeversely Isotropic V(Z) media for common-offset
gathers
Required Parameters:
cdpmin minimum cdp (integer number) for which to apply DMO
cdpmax maximum cdp (integer number) for which to apply DMO
dxcdp distance between adjacent cdp bins (m)
noffmix number of offsets to mix (see notes)
Optional Parameters:
vnfile= binary (non-ascii) file containing NMO interval
velocities (m/s)
vfile= binary (non-ascii) file containing interval velocities (m/s)
etafile= binary (non-ascii) file containing eta interval values (m/s)
tdmo=0.0 times corresponding to interval velocities in vdmo (s)
vndmo=1500.0 NMO interval velocities corresponding to times in tdmo (m/s)
vdmo=vndmo interval velocities corresponding to times in tdmo (m/s)
etadmo=1500.0 eta interval values corresponding to times in tdmo (m/s)
fmax=0.5/dt maximum frequency in input traces (Hz)
smute=1.5 stretch mute used for NMO correction
speed=1.0 twist this knob for speed (and aliasing)
verbose=0 =1 for diagnostic print
Notes:
Input traces should be sorted into common-offset gathers. One common-
offset gather ends and another begins when the offset field of the trace
headers changes.
The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
the cdp location expressed in units of meters or feet.
The number of offsets to mix (noffmix) should typically equal the ratio of
the shotpoint spacing to the cdp spacing. This choice ensures that every
cdp will be represented in each offset mix. Traces in each mix will
contribute through DMO to other traces in adjacent cdps within that mix.
vnfile, vfile and etafile should contain the regularly sampled interval
values of NMO velocity, velocity and eta respectivily as a
function of time. If, for example, vfile is not supplied, the interval
velocity function is defined by linear interpolation of the values in the
tdmo and vdmo arrays. The times in tdmo must be monotonically increasing.
165
If vfile or vdmo are not given it will be equated to vnfile or vndmo.
For each offset, the minimum time to process is determined using the
smute parameter. The DMO correction is not computed for samples that
have experienced greater stretch during NMO.
166
SUDMOTX - DMO via T-X domain (Kirchhoff) method for common-offset gathers
Required Parameters:
cdpmin minimum cdp (integer number) for which to apply DMO
cdpmax maximum cdp (integer number) for which to apply DMO
dxcdp distance between successive cdps
noffmix number of offsets to mix (see notes)
Optional Parameters:
offmax=3000.0 maximum offset
tmute=2.0 mute time at maximum offset offmax
vrms=1500.0 RMS velocity at mute time tmute
verbose=0 =1 for diagnostic print
tmpdir= if non-empty, use the value as a directory path prefix
for storing temporary files; else if the CWP_TMPDIR
environment variable is set use its value for the path;
else use tmpfile()
Notes:
Input traces should be sorted into common-offset gathers. One common-
offset gather ends and another begins when the offset field of the trace
headers changes.
The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
the cdp location expressed in units of meters or feet.
The number of offsets to mix (noffmix) should typically equal the ratio of
the shotpoint spacing to the cdp spacing. This choice ensures that every
cdp will be represented in each offset mix. Traces in each mix will
contribute through DMO to other traces in adjacent cdps within that mix.
The defaults for offmax and vrms are appropriate only for metric units.
If distances are measured in feet, then these parameters should be
specified explicitly.
167
determine parameters required to perform DMO.
Credits:
CWP: Dave Hale
Technical Reference:
A non-aliased integral method for dip-moveout
Dave Hale
submitted to Geophysics, June, 1990
168
SUDMOVZ - DMO for V(Z) media for common-offset gathers
Required Parameters:
cdpmin minimum cdp (integer number) for which to apply DMO
cdpmax maximum cdp (integer number) for which to apply DMO
dxcdp distance between adjacent cdp bins (m)
noffmix number of offsets to mix (see notes)
Optional Parameters:
vfile= binary (non-ascii) file containing interval velocities (m/s)
tdmo=0.0 times corresponding to interval velocities in vdmo (s)
vdmo=1500.0 interval velocities corresponding to times in tdmo (m/s)
fmax=0.5/dt maximum frequency in input traces (Hz)
smute=1.5 stretch mute used for NMO correction
speed=1.0 twist this knob for speed (and aliasing)
verbose=0 =1 for diagnostic print
Notes:
Input traces should be sorted into common-offset gathers. One common-
offset gather ends and another begins when the offset field of the trace
headers changes.
The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
the cdp location expressed in units of meters or feet.
The number of offsets to mix (noffmix) should typically equal the ratio of
the shotpoint spacing to the cdp spacing. This choice ensures that every
cdp will be represented in each offset mix. Traces in each mix will
contribute through DMO to other traces in adjacent cdps within that mix.
For each offset, the minimum time to process is determined using the
smute parameter. The DMO correction is not computed for samples that
have experienced greater stretch during NMO.
169
SUDUMPTRACE - print selected header values and data.
Print first num traces.
Use SUWIND to skip traces.
Optional parameters:
num=4 number of traces to dump
key=key1,key2,... key(s) to print above trace values
hpf=0 header print format is float
=1 print format is exponential
Examples:
sudumptrace < inseis.su PRINTS: 4 traces, no headers
sudumptrace < inseis.su key=tracf,offset
sudumptrace < inseis.su num=7 key=tracf,offset > info.txt
sudumptrace < inseis.su num=7 key=tracf,offset hpf=1 > info.txt
Credits:
MTU: David Forel, Jan 2005
170
SUEA2DF - SU version of (an)elastic anisotropic 2D finite difference
forward modeling
Required Parameters:
c11file=c11_file c11 voigt elasticity parameter filename
c55file=c55_file c55 voigt elasticity parameter filename
Optional Parameters:
rhofile=rho_file density filename
Anisotropy parameters:
aniso=0 =1 - include anisotropy parameters
mode=0 =0 output particle velocity, =1 output stresses
(snapshots only)
Source parameters:
sx=0 source x position (m)
sz=500 source location (m)
stype=’p’ source type
p: P-wave
v: velocity
pw: P plane-wave
171
sang=0 for stype=’pw’: plane wave angle
wtype=’dg’ wave type
dg: Gaussian derivative
ga: Gaussian
ri: Ricker
sp: spike, sp2: double spike
ts=0.05 source duration (s)
favg=50 source average frequency
Attenuation parameters:
ql= model q at xl,zl
qsw=0 switch to include attenuation =1 - include
Output parameters:
sofile= name of source file
snfile= name of file containing for snapshots
snaptime= times of snapshots i.e. snaptime=0.1,0.2,0.3
Notes:
1) The outfile contains information generated by the input parameters,
such as memory allocation, stability, etc. If your input file does
not work, check this file first.
172
The model is specified as binary files of stiffness parameters and
densities. These may be created any way the user desires. The program
unif2 or makevel may be used to generate densities, and the program
unif2aniso may be used to generate the stiffnesses. You will need to
transpose these files, as the input format for suea2df assumes that the
fast dimesion is the horizontal or the x-dimension. You may do this via
If aniso=1 then the program will expect the additional stiffnesss files.
The epl and dsl are epsilon and delstar in Thomson (1986, Geophys.)
anl is the angle the anisotropy makes with the horizontal.
173
3. 2001-01-30: Added option to set absorbing bc constants bc_a and bc_r
11. 2003-05-02: Extended the model area by half the grid spacing on the RHS.
This makes the model area symmetric allowing a plane wave source to be
introduced into the model (stype=pw). The w, txx and tzz grids contain now
one more column than the u and txz grids.
13. 15 Oct 2005 -- tossed all the model building stuff. Read models
from binary files made by unif2aniso
174
175
char* sdoc[] = {
Credits:
SEP: Einar Kjartansson, Shuki Ronen, Stew Levin
CWP: Jack K. Cohen
Unocal: Reg Beardsley
Trace header fields accessed: ns
Trace header fields modified: ntr (only for internal plotting)
176
SUEIPOFI - EIgenimage (SVD) based POlarization FIlter for
three-component data
Required parameters:
none
Optional parameters:
dt=(from header) time sampling intervall in seconds
wl=0.1 SVD time window length in seconds
pwr=1.0 exponent of filter weights
interp=cubic interpolation between initially calculated
weights, choose "cubic" or "linear
verbose=0 1 = echo additional information
Notes:
Three adjacent traces are considered as one three-component
dataset.
The filter is the sum of the first two eigenimages of the singular
value decomposition (SVD) of the signal matrix (time window).
Weighting functions depending on linearity and planarity of the
signal are applied, additionally. To avoid edge effects, these are
interpolated linearily or via cubic splines between initially
calculated values of non-overlapping time windows.
The algorithm is based on the assumption that the particle motion
trajectory is essentially 2D (elliptical polarization).
Caveat:
Cubic spline interpolation may result in filter weights exceeding
the set of values of initial weights. Weights outside the valid
interval [0.0, 1.0] are clipped.
177
Author: Nils Maercklin,
GeoForschungsZentrum (GFZ) Potsdam, Germany, 2001.
E-mail: [email protected]
References:
Franco, R. de, and Musacchio, G., 2000: Polarization Filter with
Singular Value Decomposition, submitted to Geophysics and
published electronically in Geophysics online (www.geo-online.org).
Jurkevics, A., 1988: Polarization analysis of three-comomponent
array data, Bulletin of the Seismological Society of America,
vol. 78, no. 5.
Press, W. H., Teukolsky, S. A., Vetterling, W. T., and Flannery, B. P.
1996: Numerical Recipes in C - The Art of Scientific Computing,
Cambridge University Press, Cambridge.
178
SUFCTANISMOD - Flux-Corrected Transport correction applied to the 2D
elastic wave equation for finite difference modeling in
anisotropic media
New parameter:
receiverdepth=0 depth of horizontal receivers (in gridpoints)
Optional Parameters:
dofct=1 1 do the FCT correction
0 do not do the FCT correction
FCT Related parameters:
eta0=0.03 diffusion coefficient
typical values ranging from 0.008 to 0.06
about 0.03 for the second-order method
about 0.012 for the fourth-order method
eta=0.04 anti-diffusion coefficient
typical values ranging from 0.008 to 0.06
about 0.04 for the second-order method
about 0.015 for the fourth-order method
fctxbeg=0 x coordinate to begin applying the FCT correction
179
fctzbeg=0 z coordinate to begin applying the FCT correction
fctxend=nx x coordinate to stop applying the FCT correction
fctzend=nz z coordinate to stop applying the FCT correction
General Parameters:
order=2 2 second-order finite-difference
4 fourth-order finite-difference
180
Density and Elastic Parameters:
dfile= the name of input density file,
if no name specified then
assume a linear density profile with ...
rho00=2.0 density at (0, 0)
drhodx=0.0 density gradient in x-direction d(rho)/dx
drhodz=0.0 density gradient in z-direction d(rho)/dz
Optimizations:
The moving boundary option permits the user to restrict the computations
of the wavefield to be confined to a specific range of spatial coordinates.
The boundary of this restricted area moves with the wavefield
181
movebc=0 0 do not use moving boundary optimization
1 use moving boundaries
If movebc=1 then specify:
mbx1=0 initial left side of moving boundary
mbz1=0 initial top of moving boundary
mbx2=nx initial right side of moving boundary
mbz2=nz initial bottom of moving boundary
Notes:
This program performs seismic modeling for elastic anisotropic
media with vertical axis of symmetry.
The finite-difference method with the FCT correction is used.
References:
The detailed algorithm description is given in the article
"Elimination of dispersion in finite-difference modeling
and migration" in CWP-137, project review, page 155-174.
182
SUFDMOD1 - Finite difference modelling (1-D 1rst order) for the
acoustic wave equation "
Required parameters :
<vfile or vfile= binary file containing velocities[nz]
>sfile or sfile= SU file containing seimogram[nt]
nz= number of z samples
tmax= maximum propagation time
sz= z coordinate of source
Optional parameters :
dz=1 z sampling interval
fz=0.0 first depth sample
rz=1 coordinate of receiver
sz=1 coordinate of source
dfile= binary input file containing density[nz]
wfile= output file for wave field (snapshots in a SU trace panel)
abs=0,1 absorbing conditions on top and bottom
styp=0 source type (0: gauss, 1: ricker 1, 2: ricker 2)
freq=15.0 approximate source center frequency (Hz)
nt=1+tmax/dt number od time samples (dt determined for numerical
stability)
zt=1 trace undersampling factor for trace and snapshots
zd=1 depth undersampling factor for snapshots
press=1 to record the pressure field; 0 records the particle
velocity
verbose=0 =1 for diagnostic messages
Notes :
This program uses a first order explicit velocity/pressure finite
difference equation.
The source function is applied on the pressure component.
If no density file is given, constant density is assumed
Wavefield can be easily viewed with suximage, user must provide f2=0
to the ximage program in order to get correct time labelling
Seismic trace is shifted in order to get a zero phase source
Source begins and stop when it’s amplitude is 10^-4 its maximum
Time and depth undersampling only modify the output trace and snapshots.
These parameters are useful for keeping snapshot file small and
the number of samples under SU_NFLTS.
183
NULL };
float source (float t, int styp, float dt, float dz, float t0, float alpha);
184
/* hook up getpar to handle the parameters
initargs (argc, argv);
requestdoc(0);
/* verbose
if (!getparint ("verbose",&verbose)) verbose=0;
185
if (*velfile != ’\0’ ) warn("Velocity file : %s ",velfile);
else warn("Velocity file supplied via stdin");
}
186
if (verbose) {
if (press==1) warn( "program will output pressure values");
else if (press==0) warn( "program will output particle velocity values");
}
/* allocate space
p=alloc1float(nz);
v=alloc1float(nz);
rv=alloc1float(nz);
rd=alloc1float(nz);
rd1_5=alloc1float(nz);
187
/* time shift to get a t0 centered source
if ((styp==0) || (styp == 2)) epst0=fabs(source (0, styp, dt, dz, 0, alpha) / 1e4);
else if (styp==1) epst0=fabs(source (1/sqrt(2*alpha), styp, dt, dz, 0, alpha)) / 1e4
if (verbose) warn( "epst0 = %f ", epst0);
t=tmax+dt;
do t=t-dt; while (fabs(source(t, styp, dt, dz, 0, alpha))<epst0);
t0=t;
ies=2*t/dt;
array initialization
for (iz=0; iz<nz; iz++) { v[iz]=0; p[iz]=0; }
if (*wfile != ’\0’) {
wavefp=fopen (wfile,"w");
snapsh.d1=dz*zd; snapsh.f1=fz ; snapsh.ns=nz/zd+1; snapsh.d2=dt*td; snapsh.f2=0;
/* snapsh.f2=0 is useless since 0 is the "no value" code for SU headers
}
/* propagation computation
itsis=0;
for (it=0; it<=nt; it++) {
t=it*dt;
if (abs[0]==1) p[0]=(p[0]*(1-rv[0]*dt/dz)+2*rd[0]*rv[0]*rv[0]*dt/dz*v[0])/(1+rv[0]*d
else p[0]=0;
for (iz=1; iz<nz; iz++) p[iz]=p[iz]+rd[iz]*rv[iz]*rv[iz]*dt/dz*(v[iz]-v[iz-1]);
if (abs[1]!=1) p[nz-1]=0;
if (it<ies) {
p[isz]=p[isz]+source(t, styp, dt, dz, t0, alpha);
}
if (abs[1] != 1) v[nz-1]=0;
else
v[nz-1]=((rd1_5[nz-1]*dz-dt*rd[nz-1]*rv[nz-1])*v[nz-1]-2*dt*p[nz-1])/(rd1_5[nz-1]*dz
if (it % td == 0) {
if (press==1)
sismo.data[itsis]=p[irz];
else
188
sismo.data[itsis]=v[irz];
itsis++;
}
fputtr(wavefp, &snapsh);
}
return(CWP_Exit());
}
float source (float t, int styp, float dt, float dz, float t0, float alpha)
{
float x=0.0, sou=0.0;
x=-alpha*(t-t0)*(t-t0);
if (x>-40) {
if (styp==0) sou=exp(x);
else if (styp==1) sou=-2*alpha*(t-t0)*exp(x);
else if (styp==2) sou=2*alpha*(1+2*x)*exp(x);
}
else sou=0;
return sou/dz*dt*1e8;
}
189
SUFDMOD2_PML - Finite-Difference MODeling (2nd order) for acoustic wave
equation with PML absorbing boundary conditions.
Caveat: experimental PML absorbing boundary condition version,
may be buggy!
sufdmod2_pml <vfile >wfile nx= nz= tmax= xs= zs= [optional parameters]
Required Parameters:
<vfile file containing velocity[nx][nz]
>wfile file containing waves[nx][nz] for time steps
nx= number of x samples (2nd dimension)
nz= number of z samples (1st dimension)
xs= x coordinates of source
zs= z coordinates of source
tmax= maximum time
Optional Parameters:
nt=1+tmax/dt number of time samples (dt determined for stability)
mt=1 number of time steps (dt) per output time step
...PML parameters....
pml_max=1000.0 PML absorption parameter
pml_thick=0 half-thickness of pml layer (0 = do not use PML)
190
Notes:
This program uses the traditional explicit second order differencing
method.
Thomee, V., 1962, A stable difference scheme for the mixed boundary problem
for a hyperbolic, first-order system in two dimensions, J. Soc. Indust.
Appl. Math., 10, 229-245.
Toldi, J. L., and Hale, D., 1982, Data-dependent absorbing side boundaries,
Stanford Exploration Project Report SEP-30, 111-121.
191
Jean-Pierre Berenger, ‘‘A Perfectly Matched Layer for the Absorption of
Electromagnetic Waves,’’ Journal of Computational Physics, vol. 114,
pp. 185-200.
Trace header fields set: ns, delrt, tracl, tracr, offset, d1, d2,
sdepth, trid
192
SUFDMOD2 - Finite-Difference MODeling (2nd order) for acoustic wave equation
sufdmod2 <vfile >wfile nx= nz= tmax= xs= zs= [optional parameters]
Required Parameters:
<vfile file containing velocity[nx][nz]
>wfile file containing waves[nx][nz] for time steps
nx= number of x samples (2nd dimension)
nz= number of z samples (1st dimension)
xs= x coordinates of source, or, alternatively, the name
of a file that contains the x- and z-coordinates,
with the number of pairs as the first record and
the actual pairs of (x,z) locations following.
zs= z coordinates of source
sstrength=1.0 strength of source
tmax= maximum time
Optional Parameters:
nt=1+tmax/dt number of time samples (dt determined for stability)
mt=1 number of time steps (dt) per output time step
Notes:
193
This program uses the traditional explicit second order differencing
method.
The input velocity and density files contain C-style binary floating
numbers with the z-direction being the fast dimension in the file.
Here v[ix][iz] means that this is a v(z,x) velocity function.
Trace header fields set: sx, gx, ns, delrt, tracl, tracr, offset, d1, d2,
sdepth, trid
194
SUFFT - fft real time traces to complex frequency traces
Required parameters:
none
Optional parameters:
sign=1 sign in exponent of fft
dt=from header sampling interval
verbose=1 =0 to stop advisory messages
Caveats:
No check is made that the data IS real time traces!
Examples:
sufft < stdin | suamp mode=amp | ....
sufft < stdin | suamp mode=phase | ....
sufft < stdin | suamp mode=real | ....
sufft < stdin | suamp mode=imag | ....
Credits:
195
SUFILTER - applies a zero-phase, sine-squared tapered filter
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 interval (sec)
verbose=0 =1 for advisory messages
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. |..
Credits:
CWP: John Stockwell, Jack Cohen
CENPET: Werner M. Heigl - added well log support
196
SUFLIP - flip a data set in various ways
Required parameters:
none
Optional parameters:
flip=1 rotational sense of flip
+1 = flip 90 deg clockwise
-1 = flip 90 deg counter-clockwise
0 = transpose data
2 = flip right-to-left
3 = flip top-to-bottom
tmpdir= if non-empty, use the value as a directory path
prefix for storing temporary files; else if
the CWP_TMPDIR environment variable is set use
its value for the path; else use tmpfile()
Credits:
CWP: Chris Liner, Jack K. Cohen, John Stockwell
Caveat:
right-left flip (flip = 2) and top-bottom flip (flip = 3)
don’t require the matrix approach. We sacrificed efficiency
for uniform coding.
197
198
SUFNZERO - get Time of First Non-ZERO sample by trace
Required parameters:
none
Optional parameters:
mode=first Output time of first non-zero sample
=last for last non-zero sample
=both for both first & last non-zero samples
Credits:
Geocon : Garry Perratt
based on surms by the same, itself based on sugain & sumax by:
CWP : John Stockwell
199
SUFRAC -- take general (fractional) time derivative or integral of
data, plus a phase shift. Input is CAUSAL time-indexed
or depth-indexed data.
Optional parameters:
power=0 exponent of (-i*omega)
=0 ==> phase shift only
>0 ==> differentiation
<0 ==> integration
Examples:
preprocess to correct 3D data for 2.5D migration
sufrac < sudata power=.5 sign=1 | ...
preprocess to correct susynlv, susynvxz, etc. (2D data) for 2D migration
sufrac < sudata phasefac=.25 | ...
The filter is applied in frequency domain.
if dt is not set in header, then dt is mandatory
Algorithm:
g(t) = Re[INVFTT{ ( (sign) iw)^power FFT(f)}]
Caveat:
Large amplitude errors will result if the data set has too few points.
Credits:
CWP: Chris Liner, Jack K. Cohen, Dave Hale (pfas)
CWP: Zhenyue Liu and John Stockwell added phase shift option
CENPET: Werner M. Heigl - added well log support
200
SUFXDECON - random noise attenuation by FX-DECONvolution
Required Parameters:
Optional Parameters:
taper=.1 length of taper
fmin=6. minimum frequency to process in Hz (accord to twlen)
fmax=.6/(2*dt) maximum frequency to process in Hz
twlen=entire trace time window length (minimum .3 for lower freqs)
ntrw=10 number of traces in window
ntrf=4 number of traces for filter (smaller than ntrw)
verbose=0 =1 for diagnostic print
tmpdir= if non-empty, use the value as a directory path prefix
for storing temporary files; else, if the CWP_TMPDIR
environment variable is set, use its value for the path;
else use tmpfile()
Credits:
References:
Canales(1984):’Random noise reduction’ 54th. SEGM
Gulunay(1986):’FXDECON and complex Wiener Predicition
filter’ 56th. SEGM
Galbraith(1991):’Random noise attenuation by F-X
prediction: a tutorial’ 61th. SEGM
Algorithm:
- read data
- loop over time windows
- select data
- FFT (t -> f)
- loop over space windows
201
- select data
- loop over frequencies
- autocorelation
- matrix problem
- construct filter
- filter data
- loop along space window
- FFT (f -> t)
- reconstruct data
- output data
202
SUGABOR - Outputs a time-frequency representation of seismic data via
the Gabor transform-like multifilter analysis technique
presented by Dziewonski, Bloch and Landisman, 1969.
Required parameters:
if dt is not set in header, then dt is mandatory
Optional parameters:
dt=(from header) time sampling interval (sec)
fmin=0 minimum frequency of filter array (hz)
fmax=NYQUIST maximum frequency of filter array (hz)
beta=3.0 ln[filter peak amp/filter endpoint amp]
band=.05*NYQUIST filter bandwidth (hz)
alpha=beta/band^2 filter width parameter
verbose=0 =1 supply additional info
holder=0 =1 output Holder regularity estimate
=2 output linear regularity estimate
Caveat:
The Gabor transform is not a wavelet transform, but rather are sharp
203
frame basis. However, it is nearly a Morlet continuous wavelet transform
so the concept of Holder regularity may have some meaning. If you are
computing Holder regularity of, say, a migrated seismic section, then
set band to 1/3 of the frequency band of your data.
Examples:
suvibro | sugabor | suximage
suvibro | sugabor | suxmovie n1= n2= n3=
(because suxmovie scales it’s amplitudes off of the first panel,
may have to experiment with the wclip and bclip parameters
suvibro | sugabor | supsimage | ... ( your local PostScript utility)
Credits:
204
References: Dziewonski, Bloch, and Landisman, 1969, A technique
for the analysis of transient seismic signals,
Bull. Seism. Soc. Am., 1969, vol. 59, no.1, pp.427-444.
Taner, M., T., Koehler, F., and Sheriff, R., E., 1979,
Complex seismic trace analysis, Geophysics, vol. 44,
pp.1041-1063.
205
SUGAIN - apply various types of gain to display traces
Required parameters:
none (no-op)
Optional parameters:
panel=0 =1 gain whole data set (vs. trace by trace)
tpow=0.0 multiply data by t^tpow
epow=0.0 multiply data by exp(epow*t)
gpow=1.0 take signed gpowth power of scaled data
agc=0 flag; 1 = do automatic gain control
gagc=0 flag; 1 = ... with gaussian taper
wagc=0.5 agc window in seconds (use if agc=1 or gagc=1)
trap=none zero any value whose magnitude exceeds trapval
clip=none clip any value whose magnitude exceeds clipval
pclip=none clip any value greater than clipval
nclip=none clip any value less than clipval
qclip=1.0 clip by quantile on absolute values on trace
qbal=0 flag; 1 = balance traces by qclip and scale
pbal=0 flag; 1 = bal traces by dividing by rms value
mbal=0 flag; 1 = bal traces by subtracting the mean
maxbal=0 flag; 1 = balance traces by subtracting the max
scale=1.0 multiply data by overall scale factor
norm=0.0 divide data by overall scale factor
bias=0.0 bias data by adding an overall bias value
jon=0 flag; 1 means tpow=2, gpow=.5, qclip=.95
verbose=0 verbose = 1 echoes info
mark=0 apply gain only to traces with tr.mark=0
=1 apply gain only to traces with tr.mark!=0
Operation order:
if (norm) scale/norm
206
Notes:
The jon flag selects the parameter choices discussed in
Claerbout’s Imaging the Earth, pp 233-236.
Credits:
SEP: Jon Claerbout
CWP: Jack K. Cohen, Brian Sumner, Dave Hale
Technical Reference:
Jon’s second book, pages 233-236.
207
SUGAUSSTAPER - Multiply traces with gaussian taper
Required Parameters:
<none>
Optional parameters:
key=offset keyword of header field to weight traces by
x0=300 centre of gaussian window
xw=50 width of gaussian window
Credits:
208
SUGAZMIGQ - SU version of Jeno GAZDAG’s phase-shift migration
for zero-offset data, with attenuation Q.
Optional Parameters:
dt=from header(dt) or .004 time sampling interval
dx=from header(d2) or 1.0 midpoint sampling interval
ft=0.0 first time sample
ntau=nt(from data) number of migrated time samples
dtau=dt(from header) migrated time sampling interval
ftau=ft first migrated time sample
tmig=0.0 times corresponding to interval velocities in vmig
vmig=1500.0 interval velocities corresponding to times in tmig
vfile= name of file containing velocities
Q=1e6 quality factor
ceil=1e6 gain ceiling beyond which migration ceases
The tmig and vmig arrays specify an interval velocity function of time.
Linear interpolation and constant extrapolation is used to determine
interval velocities at times not specified. Values specified in tmig
must increase monotonically.
Credits:
Constant Q attenuation correction by Chuck Oden 5 May 2004
CWP John Stockwell 12 Oct 1992
Based on a constant v version by Dave Hale.
209
Trace header fields accessed: ns, dt, delrt, d2
Trace header fields modified: ns, dt, delrt
210
SUGETHW - sugethw writes the values of the selected key words
Required parameters:
key=key1,... At least one key word.
Optional parameters:
output=ascii output written as ascii for display
=binary for output as binary floats
=geom ascii output for geometry setting
verbose=0 quiet
=1 chatty
Example:
sugethw <stdin key=sx,gx
writes sx, gx values as ascii trace by trace to the terminal.
Comment:
Users wishing to edit one or more header field (as in geometry setting)
may do this via the following sequence:
sugethw < sudata output=geom key=key1,key2,... > hdrfile
Now edit the ASCII file hdrfile with any editor, setting the fields
appropriately. Convert hdrfile to a binary format via:
a2b < hdrfile n1=nfields > binary_file
Then set the header fields via:
sushw < sudata infile=binary_file key=key1,key2,... > sudata.edited
Credits:
211
SUGET - Connect SU program to file descriptor for input stream.
fd=-1 file_descriptor_for_input_stream
verbose=0 minimal listing
=1 asks for message with each trace processed.
212
SUGOUPILLAUDPO - calculate Primaries-Only impulse response of a lossless
GOUPILLAUD medium for plane waves at normal incidence
Required parameters:
none
Optional parameters:
l=1 source layer number; 1 <= l <= tr.ns
Source is located at the top of layer l.
k=1 receiver layer number; 1 <= k
Receiver is located at the top of layer k.
tmax number of output time-samples;
default: long enough to capture all primaries
pV=1 flag for vector field seismogram
(displacement, velocity, acceleration);
=-1 for pressure seismogram.
verbose=0 silent operation, =1 list warnings
impedance[i]-impedance[i+1]
r[i] = -----------------------------
impedance[i]+impedance[i+1]
Remarks:
1. For vector fields, a buried source produces a spike of amplitude 1
propagating downwards and a spike of amplitude -1 propagating upwards.
A buried pressure source produces spikes of amplitude 1 both in the up-
and downward directions.
A surface source induces only a downgoing spike of amplitude 1 at the
top of the first layer (both for vector and pressure fields).
2. The sampling interval dt in the header of the input reflectivity file
is interpreted as a two-way traveltime thicknes of the layers. The sampling
interval of the output seismogram is the same as that of the input file.
213
Credits:
CWP: Albena Mateeva, April 2001.
214
SUGOUPILLAUD - calculate 1D impulse response of
non-absorbing Goupillaud medium
Required parameters:
none
Optional parameters:
l=1 source layer number; 1 <= l <= tr.ns
Source is located at the top of layer l.
k=1 receiver layer number; 1 <= k
Receiver is located at the top of layer k.
tmax number of output time-samples; default:
tmax=NINT((2*tr.ns-(l-1)-(k-1))/2) if k < tr.ns
tmax=k if k >=tr.ns
pV=1 flag for vector field seismogram
(displacement, velocity, acceleration);
=-1 for pressure seismogram.
verbose=0 silent operation, =1 list warnings
impedance[i]-impedance[i+1]
r[i] = -----------------------------
impedance[i]+impedance[i+1]
Remarks:
1. For vector fields, a buried source produces a spike of amplitude 1
propagating downwards and a spike of amplitude -1 propagating upwards.
A buried pressure source produces spikes of amplitude 1 both in the up-
and downward directions.
A surface source induces only a downgoing spike of amplitude 1 at the
top of the first layer (both for vector and pressure fields).
2. The sampling interval dt in the header of the input reflectivity file
is interpreted as a two-way traveltime thicknes of the layers. The sampling
interval of the output seismogram is the same as that of the input file.
215
Credits:
CWP: Albena Mateeva, May 2000, a summer project at Western Geophysical
ANOTATION used in the code comments [arises from the use of z-transforms]:
Z-sampled: sampling interval equal to the TWO-way
traveltime of the layers;
z-sampled: sampling interval equal to the ONE-way
traveltime of the layers;
REFERENCES:
216
SUHARLAN - signal-noise separation by the invertible linear
transformation method of Harlan, 1984
Required Parameters:
<none>
Optional Parameters:
FLAGS:
niter=1 number of requested iterations
anenv=1 =1 for positive analytic envelopes
=0 for no analytic envelopes (not recommended)
scl=0 =1 to scale output traces (not recommended)
plot=3 =0 for no plots. =1 for 1-D plots only
=2 for 2-D plots only. =3 for all plots
norm=1 =0 not to normalize reliability values
verbose=1 =0 not to print processing information
rgt=2 =1 for uniform random generator
=2 for gaussian random generator
sts=1 =0 for no smoothing (not recommended)
General Parameters:
dx=20 offset sampling interval (m)
fx=0 offset on first trace (m)
dt=0.004 time sampling interval (s)
217
pmula=pmax1 maximum p-value preserved in the data (ms)
pmulb=pmax1 minimum p-value muted on the data (ms)
ninterp=0 number of traces to interpolate in input data
Extraction Parameters:
nintlh=50 number of intervals (bins) in histograms
sditer=5 number of steepest descent iterations to compute ps
c=0.04 maximum noise allowed in a sample of signal(%)
rel1=0.5 reliability value for first pass of the extraction
rel2=0.75 reliability value for second pass of the extraction
Output Files:
signal=out_signal name of output file for extracted signal
noise=out_noise name of output file for extracted noise
Notes:
The signal-noise separation algorithm was developed by Dr. Bill Harlan
in 1984. It can be used to separate events that can be focused by a
linear transformation (signal) from events that can’t (noise). The
linear transform is whatever is well siuted for the application at
hand. Here, only the discrete Radon transform is used, so the program
is capable of separating events focused by that transform (linear,
parabolic or time-invariantly hyperbolic). Should other transform be
required, the changes to the program will be relatively
straightforward.
218
Credits:
Gabriel Alvarez CWP (1995)
Some subroutines are direct translations to C from Fortran versions
written by Dr. Bill Harlan (1984)
References:
219
SUHILB - Hilbert transform
Credits:
CWP: Jack Cohen
CWP: John Stockwell, modified to use Dave Hale’s hilbert() subroutine
220
char *sdoc[] = {
required parameters:
optional parameters
Notes:
trend=0 produces a two column ASCII output for use w/ gnuplot.
Extreme values are counted in the end bins.
221
Author: Reginald H. Beardsley 2006 [email protected]
222
SUHROT - Horizontal ROTation of three-component data
Required parameters:
none
Optional parameters:
angle=rad unit of angles, choose "rad", "deg", or "gon
inv=0 1 = inverse rotation (counter-clockwise)
verbose=0 1 = echo angle for each 3-C station
Notes:
Three adjacent traces are considered as one three-component
dataset.
By default, the data will be rotated from the Z-North-East (Z,N,E)
coordinate system into Z-Radial-Transverse (Z,R,T).
Trace header fields accessed: ns, sx, sy, gx, gy, key=keyword
Trace header fields modified: trid
223
SUHTMATH - do unary arithmetic operation on segy traces with
headers values
Required parameters:
none
Optional parameter:
key=tracl header word to use
op=nop operation flag
nop : no operation
add : add header to trace
mult : multiply trace with header
div : divide trace by header
Credits:
Matthias Imhof, Virginia Tech, Fri Dec 27 09:17:29 EST 2002
224
SUIFFT - fft complex frequency traces to real time traces
Required parameters:
none
Optional parameter:
sign=-1 sign in exponent of inverse fft
Credits:
225
SUILOG -- time axis inverse log-stretch of seismic traces
Required parameters:
nt= nt output from sulog prog
ntmin= ntmin output from sulog prog
dt= dt output from sulog prog
Optional parameters:
none
Credits:
CWP: Shuki Ronen, Chris Liner
Caveats:
amplitudes are not well preserved
226
SUIMP2D - generate shot records for a line scatterer
embedded in three dimensions using the Born
integral equation ",
Optional parameters
nshot=1 number of shots
nrec=1 number of receivers
c=5000 speed
dt=.004 sampling rate
nt=256 number of samples
x0=1000 point scatterer location
z0=1000 point scatterer location
sxmin=0 first shot location
szmin=0 first shot location
gxmin=0 first receiver location
gzmin=0 first receiver location
dsx=100 x-step in shot location
dsz=0 z-step in shot location
dgx=100 x-step in receiver location
dgz=0 z-step in receiver location
Example:
suimp2d nrec=32 | sufilter | supswigp | ...
Credits:
CWP: Norm Bleistein, Jack K. Cohen
Trace header fields set: ns, dt, tracl, tracr, fldr, sx, selev,
gx, gelev, offset
227
SUIMP3D - generate inplane shot records for a point
scatterer embedded in three dimensions using
the Born integral equation ",
Optional parameters
nshot=1 number of shots
nrec=1 number of receivers
c=5000 speed
dt=.004 sampling rate
nt=256 number of samples
x0=1000 point scatterer location
y0=0 point scatterer location
z0=1000 point scatterer location
sxmin=0 first shot location
symin=0 first shot location
szmin=0 first shot location
gxmin=0 first receiver location
gymin=0 first receiver location
gzmin=0 first receiver location
dsx=100 x-step in shot location
dsy=0 y-step in shot location
dsz=0 z-step in shot location
dgx=100 x-step in receiver location
dgy=0 y-step in receiver location
dgz=0 z-step in receiver location
Example:
suimp3d nrec=32 | sufilter | supswigp | ...
Credits:
CWP: Norm Bleistein, Jack K. Cohen
228
Trace header fields set: ns, dt, tracl, tracr, fldr, tracf,
sx, sy, selev, gx, gy, gelev, offset
229
SUIMPEDANCE - Convert reflection coefficients to impedances.
Optional Parameters:
v0=1500. Velocity at first sample (m/sec)
rho0=1.0e6 Density at first sample (g/m^3)
Notes:
Implements recursion [1-R(k)]Z(k) = [1+R(k)]Z(k-1).
Credits:
230
SUINTERP - interpolate traces using automatic event picking
Notes:
This program outputs ’ninterp’ interpolated traces between each pair of
input traces. The values for lagc, freq1, and freq2 are only used for
event tracking. The output data will be full bandwidth with no agc. The
default parameters typically will do a satisfactory job of interpolation
for dips up to about 12 ms/trace. Using a larger value for freq2 causes
the algorithm to do a better job on the shallow dips, but to fail on the
steep dips. Only one dip is assumed at each time sample between each pair
of input traces.
The key assumption used here is that the low frequency data are unaliased
231
and can be used for event tracking. Those dip picks are used to interpolate
the original full-bandwidth data, giving some measure of interpolation
at higher frequencies which otherwise would be aliased. Using iopt equal
to 1 allows you to visually check whether the low-pass picking model is
aliased.
The place this code is most likely to fail is on the first breaks.
232
SUINTVEL - convert stacking velocity model to interval velocity model
Required parameters:
vs= stacking velocities
t0= normal incidence times
Optional parameters:
outpar=/dev/tty output parameter file in the form:
h=layer thicknesses vector
v=interval velocities vector
Examples:
suintvel vs=5000,5523,6339,7264 t0=.4,.8,1.125,1.425 outpar=intpar
Note: suintvel does not have standard su syntax since it does not
operate on seismic data. Hence stdin and stdout are not used.
Credits:
CWP: Jack
Technical Reference:
The Common Depth Point Stack
William A. Schneider
Proc. IEEE, v. 72, n. 10, p. 1238-1254
1984
Formulas:
Note: All sums on i are from 1 to k
From Schneider:
Let h[i] be the ith layer thickness measured at the cmp and
233
v[i] the ith interval velocity.
Set:
t[i] = h[i]/v[i]
Define:
t0by2[k] = 0.5 * t0[k] = Sum h[i]/v[i]
vh[k] = vs[k]*vs[k]*t0by2[k] = Sum v[i]*h[i]
Then:
dt[i] = h[i]/v[i] = t0by2[i] - t0by2[i-1]
dvh[i] = h[i]*v[i] = vh[i] - vh[i-1]
h[i] = sqrt(dvh[i] * dt[i])
v[i] = sqrt(dvh[i] / dt[i])
234
SUINVXZCO - Seismic INVersion of Common Offset data for a smooth
velocity function V(X,Z) plus a slowness perturbation vp(x,z)
Required Parameters:
vfile file containing velocity array v[nx][nz]
nx= number of x samples (2nd dimension) in velocity
nz= number of z samples (1st dimension) in velocity
nxm= number of midpoints of input traces
Optional Parameters:
dt= or from header (dt) time sampling interval of input data
offs= or from header (offset) source-receiver offset
dxm= or from header (d2) sampling interval of midpoints
fxm=0 first midpoint in input trace
nxd=5 skipped number of midpoints (see note)
dx=50.0 x sampling interval of velocity
fx=0.0 first x sample of velocity
dz=50.0 z sampling interval of velocity
nxb=nx/2 band centered at midpoints (see note)
nxc=0 hozizontal range in which velocity is changed
nzc=0 vertical range in which velocity is changed
fxo=0.0 x-coordinate of first output trace
dxo=15.0 horizontal spacing of output trace
nxo=101 number of output traces ",
fzo=0.0 z-coordinate of first point in output trace
dzo=15.0 vertical spacing of output trace
nzo=101 number of points in output trace ",
fmax=0.25/dt Maximum frequency set for operator antialiasing
ang=180 Maximum dip angle allowed in the image
ls=0 =1 for line source; =0 for point source
pert=0 =1 calculate time correction from v_p[nx][nz]
vpfile file containing slowness perturbation array v_p[nx][nz]
verbose=1 =1 to print some useful information
Notes:
Traveltime and amplitude are calculated by finite difference which
is done only in one of every NXD midpoints; in the skipped midpoint,
interpolation is used to calculate traveltime and amplitude. ",
For each midpoint, traveltime and amplitude are calculated in the
horizontal range of (xm-nxb*dx, xm+nxb*dx). Velocity is changed by
constant extropolation in two upper trianglar corners whose width is
235
nxc*dx and height is nzc*dz.
Reference:
Bleistein, N., Cohen, J. K., and Hagin, F., 1987,
Two-and-one-half dimensional Born inversion with an arbitrary reference
Geophysics Vol. 52, no.1, 26-36.
236
SUINVZCO3D - Seismic INVersion of Common Offset data with V(Z) velocity
function in 3D
Required Parameters:
vfile file containing velocity array v[nz]
nz= number of z samples (1st dimension) in velocity
nxm= number of midpoints of input traces
ny= number of lines
Optional Parameters:
dt= or from header (dt) time sampling interval of input data
offs= or from header (offset) source-receiver offset
dxm= or from header (d2) sampling interval of midpoints
fxm=0 first midpoint in input trace
nxd=5 skipped number of midpoints (see note)
dx=50.0 x sampling interval of velocity
fx=0.0 first x sample of velocity
dz=50.0 z sampling interval of velocity
nxb=nx/2 band centered at midpoints (see note)
fxo=0.0 x-coordinate of first output trace
dxo=15.0 horizontal spacing of output trace
nxo=101 number of output traces ",
fyo=0.0 y-coordinate of first output trace
dyo=15.0 y-coordinate spacing of output trace
nyo=101 number of output traces in y-direction
fzo=0.0 z-coordinate of first point in output trace
dzo=15.0 vertical spacing of output trace
nzo=101 number of points in output trace ",
fmax=0.25/dt Maximum frequency set for operator antialiasing
ang=180 Maximum dip angle allowed in the image
verbose=1 =1 to print some useful information
Notes:
237
linear interpolation in two upper trianglar corners whose width is
nxc*dx and height is nzc*dz. ",
238
SUK1K2FILTER - symmetric box-like K-domain filter defined by the
cartesian product of two sin^2-tapered polygonal
filters defined in k1 and k2
Optional parameters:
k1=val1,val2,... array of K1 filter wavenumbers
k2=val1,val2,... array of K2 filter wavenumbers
amps1=a1,a2,... array of K1 filter amplitudes
amps2=a1,a2,... array of K2 filter amplitudes
d1=tr.d1 or 1.0 sampling interval in first (fast) dimension
d2=tr.d1 or 1.0 sampling interval in second (slow) dimension
quad=0 =0 all four quandrants
=1 (quadrants 1 and 4)
=2 (quadrants 2 and 3)
Defaults:
k1=.10*(nyq1),.15*(nyq1),.45*(nyq1),.50*(nyq1)
k2=.10*(nyq2),.15*(nyq2),.45*(nyq2),.50*(nyq2)
amps1=0.,1.,...,1.,0. trapezoid-like bandpass filter
amps2=0.,1.,...,1.,0. trapezoid-like bandpass filter
Notes:
The filter is assumed to be symmetric, to yield real output
239
and K1, K2 define our respective wavenumbers.
Credits:
CWP: John Stockwell, November 1995.
240
SUKDMIG2D - Kirchhoff Depth Migration of 2D poststack/prestack data
Required parameters:
infile=stdin file for input seismic traces
outfile=stdout file for common offset migration output
ttfile= file for input traveltime tables
Optional Parameters:
dt= or from header (dt) time sampling interval of input data
ft= or from header (ft) first time sample of input data
dxm= or from header (d2) sampling interval of midpoints
fzo=fzt z-coordinate of first point in output trace
dzo=0.2*dzt vertical spacing of output trace
nzo=5*(nzt-1)+1 number of points in output trace ",
fxo=fxt x-coordinate of first output trace
dxo=0.5*dxt horizontal spacing of output trace
nxo=2*(nxt-1)+1 number of output traces ",
off0=0 first offest in output
doff=99999 offset increment in output
noff=1 number of offsets in output ",
absoff=0 flag for using absolute offsets of input traces
=0 means use offset=gx-sx
=1 means use abs(gx-sx)
limoff=0 flag for only using input traces that fall within the range
of defined output offset bins (off0,doff,noff)
=0 means use all input traces
=1 means limit traces used by offset
fmax=0.25/dt frequency-highcut for input traces
offmax=99999 maximum absolute offset allowed in migration
aperx=nxt*dxt/2 migration lateral aperature
241
angmax=60 migration angle aperature from vertical
v0=1500(m/s) reference velocity value at surface ",
dvz=0.0 reference velocity vertical gradient
Notes:
1. Traveltime tables were generated by program rayt2d (or other ones)
on relatively coarse grids, with dimension ns*nxt*nzt. In the
migration process, traveltimes are interpolated into shot/gephone
positions and output grids.
2. Input seismic traces must be SU format and can be any type of
gathers (common shot, common offset, common CDP, and so on). ",
3. Migrated traces are output in CDP gathers if velocity analysis
is required, with dimension nxo*noff*nzo. ",
4. If the offset value of an input trace is not in the offset array
of output, the nearest one in the array is chosen.
5. Memory requirement for this program is about
[ns*nxt*nzt+noff*nxo*nzo+4*nr*nzt+5*nxt*nzt+npa*(2*ns*nxt*nzt
+noff*nxo*nzo+4*nxt*nzt)]*4 bytes
where nr = 1+min(nxt*dxt,0.5*offmax+aperx)/dxo.
6. Amplitudes are computed using the reference velocity profile, v(z),
specified by the parameters v0= and dvz=.
7. Input traces must specify source and receiver positions via the header
fields tr.sx and tr.gx. Offset is computed automatically.
8. if limoff=0, input traces from outside the range defined by off0, doff,
noff, will get migrated into the extremal offset bins/planes. E.g. if
absoff=0 and limoff=0, all traces with gx<sx will get migrated into the
off0 bin.
242
Author: Zhenyue Liu, 03/01/95, Colorado School of Mines
Modifcations:
Gary Billings, Talisman Energy, Sept 2005: added absoff, limoff.
243
SUKDMIG3D - Kirchhoff Depth Migration of 3D poststack/prestack data
Required parameters:
ttfile file for input tttables
Optional Parameters:
244
dxo=0.5*dxgd horizontal spacing of output trace (2 times finer)
nxo=2*(nxgd-1)+1 number of output traces (2 times finer)
fyo=fygd y-coordinate of first output trace
dyo=0.5*dygd horizontal spacing of output trace (2 times finer)
nyo=2*(nygd-1)+1 number of output traces (2 times finer)
Notes:
1. Traveltime tables were generated by program SUTETRARAY (or other
ones) on very sparse tetrahedral model, with dimension nys*nxs*nzs
*nyt*nxt.
2. Input seismic traces must be SU format and can be any type of
gathers (common shot, common offset, common CDP, and so on). ",
3. Migrated traces are output in CDP gathers if velocity analysis
is required, with dimension nyoffset*nxoffset*nyo*nxo*nzo. ",
4. If the offset value of an input trace is not in the offset array
of output, the nearest one in the array is chosen.
5. Memory requirement for this program is about
[nys*nxs*nzs*nyt*nxt+nyoffset*nxoffset*nxo*nyo*nzo+
nys*nxo*nzo*nyt*nxt]
6. Input traces must specify source and receiver positions via header
fields tr.sx and tr.gx, as well as tr.sy and tr.gy. Offset is
computed automatically.
Disclaimer:
This is a research code that will take considerable work to get into
245
the form of a a production level 3D migration code. The code is
offered as is, along with tetramod and sutetraray, to provide a starting
point for researchers who wish to write their own 3D migration codes.
246
SUKDSYN2D - Kirchhoff Depth SYNthesis of 2D seismic data from a
migrated seismic section
Required parameters:
infile=stdin input migrated section
outfile=stdout file for output seismic traces
ttfile file for input traveltime tables
Optional Parameters:
nt=501 number of time samples
dt=0.004 time sampling interval (sec)
ft=0.0 first time (sec)
nxo=1 number of source-receiver offsets
dxo=25 offset sampling interval
fxo=0.0 first offset
nxs=101 number of shotpoints
dxs=25 shotpoint sampling interval
fxs=0.0 first shotpoint
fmax=1/(4*dt) maximum frequency in migration section (Hz)
aperx=nxt*dxt/2 modeling lateral aperature
angmax=60 modeling angle aperature from vertical
v0=1500(m/s) reference velocity value at surface
247
dvz=0.0 reference velocity vertical gradient
ls=1 flag for line source
jpfile=stderr job print file name
mtr=100 print verbal information at every mtr traces
Notes:
This program takes a migrated seismic section and a set of travel time
tables generated using rayt2d for a specific background velocity model
and generates synthetic seismic data in the form of common shot gathers.
(Common offset gathers may be generated by using nxo=1.) (Demigration.)
This program is a tool which may be used for the migration residual
statics estimation technique of Tjan, Audebert, and Larner 1994.
1. The traveltime tables are generated by program rayt2d (or other ones)
on relatively coarse grids, with dimension ns*nxt*nzt. In the
modeling process, traveltimes are interpolated into shot/geophone
positions and migration section grids.
2. The input migration section must be an array of binary floats (no SU
headers). ",
3. The synthesized traces are output in common-shot gathers in SU format.
4. The memory requirement for this program is about
(ns*nxt*nzt+nx*nz+4*nr*nzt+3*nxt*nzt)*4 bytes
where nr = 1+min(nxt*dxt,0.5*offmax+aperx)/dxo.
References:
Tjan, T., 1995, Residual statics estimation for data from structurally
complex areas using prestack depth migration: M.Sc. thesis, Colorado
School of Mines. (In progress.)
Larner, K., and Tjan, T., 1995, Simultaneous statics and velocity
estimation for data from structurally complex areas.
(Appeared in 1995 Project Review, CWP-185.)
248
Trace header fields set: ns, dt, delrt, tracl, tracr, fldr, tracf
offset, sx, gx, trid, counit
249
SUKEYCOUNT - sukeycount writes a count of a selected key
Required parameters:
key=keyword One key word.
Optional parameters:
verbose=0 quiet
=1 chatty
Examples:
sukeycount < stdin key=fldr
sukeycount < stdin key=fldr > out.txt
Credits:
250
SUKFILTER - radially symmetric K-domain, sin^2-tapered, polygonal
filter
Optional parameters:
k=val1,val2,... array of K filter wavenumbers
amps=a1,a2,... array of K filter amplitudes
d1=tr.d1 or 1.0 sampling interval in first (fast) dimension
d2=tr.d1 or 1.0 sampling interval in second (slow) dimension
Defaults:
k=.10*(nyq),.15*(nyq),.45*(nyq),.50*(nyq)
amps=0.,1.,...,1.,0. trapezoid-like bandpass filter
Notes:
The filter is assumed to be symmetric, to yield real output.
Credits:
CWP: John Stockwell, June 1997.
251
SUKFRAC - apply FRACtional powers of i|k| to data, with phase shift
Optional parameters:
power=0 exponent of (i*sqrt(k1^2 + k2^2))^power
=0 ===> phase shift only
>0 ===> differentiation
<0 ===> integration
sign=1 sign on transform exponent
d1=1.0 x1 sampling interval
d2=1.0 x2 sampling interval
phasefac=0 phase shift by phase=phasefac*PI
Notes:
The relation: w = 2 pi F is well known for frequency, but there
doesn’t seem to be a commonly used letter corresponding to F for the
spatial conjugate transform variables. We use K1 and K2 for this.
More specifically we assume a phase:
-i(k1 x1 + k2 x2) = -2 pi i(K1 x1 + K2 x2).
and K1, K2 define our respective wavenumbers.
Algorithm:
g(x1,x2)=Re[2DINVFFT{ ( (sign) i |k|)^power 2DFFT(f)}e^i(phase)]
Caveat:
Large amplitude errors will result of the data set has too few points.
Examples:
Edge sharpening:
Laplacean :
sukfrac < image_data power=2 phasefac=-1 | ...
Image enhancement:
Derivative filter:
sukfrac < image_data power=1 phasefac=-.5 | ...
Image enhancement:
Half derivative (this one is the best for photographs):
sukfrac < image_data power=.5 phasefac=-.25 | ...
Credits:
CWP: John Stockwell, June 1997, based on sufrac.
252
Trace header fields accessed: ns, d1, d2
253
SUKILL - zero out traces
Required parameters
min= first trace to kill (one-based)
Optional parameters
count= 1 number of traces to kill
Credits:
CWP: Chris Liner, Jack K. Cohen
254
SULOG -- time axis log-stretch of seismic traces
Required parameters:
none
Optional parameters:
ntmin= .1*nt minimum time sample of interest
outpar=/dev/tty output parameter file, contains:
number of samples (nt=)
minimum time sample (ntmin=)
output number of samples (ntau=)
m=3 length of stretched data
is set according to
ntau = nextpow(m*nt)
ntau= pow of 2 override for length of stretched
data (useful for padding zeros
to avoid aliasing)
NOTES:
ntmin is required to avoid taking log of zero and to
keep number of outsamples (ntau) from becoming enormous.
Data above ntmin is zeroed out.
Credits:
CWP: Shuki, Chris
Caveats:
Amplitudes are not well preserved.
255
char *sdoc[] = {
Required parameters:
none
Optional parameters:
output=ascii write ascii data to outpar
=binary for binary floats to stdout
=segy for SEGY traces to stdout
Examples:
For global max and min values: sumax < segy_data
For local and global max and min values: sumax < segy_data verbose=1
To plot values specified by mode:
sumax < segy_data output=binary mode=modeval | xgraph n=npairs
To plot seismic data with the only values nonzero being those specified
by mode=modeval:
sumax < segy_data output=segy mode=modeval | suxwigb
Note: while traces are counted from 1, sample values are counted from 0.
256
Also, if multiple min, max, or abs max values exist on a trace,
only the first one is captured.
Credits:
CWP : John Stockwell (total rewrite)
Geocon : Garry Perratt (all ASCII output changed from %e to %f)
(added mode=rms).
ESCI: Reginald Beardsley (added header key option)
based on an original program by:
SEP: Shuki Ronen
CWP: Jack K. Cohen
IFM-GEOMAR: Gerald Klein (added threshold option)
257
SUMEAN - get the mean values of data traces ",
Required parameters:
power = 2.0 mean to the power
(e.g. = 1.0 mean amplitude, = 2.0 mean energy)
Optional parameters:
verbose = 0 writes mean value of section to outpar
= 1 writes mean value of each trace / section to
outpar
outpar=/dev/tty output parameter file
abs = 1 average absolute value
= 0 preserve sign if power=1.0
Notes:
Each sample is raised to the requested power, and the sum of all those
values is averaged for each trace (verbose=1) and the section.
The values power=1.0 and power=2.0 are physical, however other powers
represent other mathematical L-p norms and may be of use, as well.
Credits:
Bjoern E. Rommel, IKU, Petroleumsforskning / October 1997
[email protected]
258
SUMEDIAN - MEDIAN filter about a user-defined polygonal curve with
the distance along the curve specified by key header word
Required parameters:
xshift= array of position values as specified by
the ‘key’ parameter
tshift= array of corresponding time values (sec)
... or input via files:
nshift= number of x,t values defining median times
xfile= file containing position values as specified by
the ‘key’ parameter
tfile= file containing corresponding time values (sec)
Optional parameters:
key=tracl Key header word specifying trace number
=offset use trace offset instead
Notes:
------
Median filtering is a process for suppressing a particular moveout on
seismic sections. Its advantage over traditional dip filtering is that
events with arbitrary moveout may be suppressed. Median filtering is
commonly used in up/down wavefield separation of VSP data.
259
specifying moveout is flattened to horizontal. The x,t pairs are
specified either by the vector xshift,tshift or by the values in
the datafiles xfile,tfile. For fractional shift, the shifted data
is interpolated.
2. Then a mix (weighted moving average) is performed over the shifted
panel to emphasize events with the specified moveout and suppress
events with other moveouts.
3. The panel is then shifted back (and interpolated) to its original
moveout, and subtracted from the original data. Thus all events
with the user-specified moveout are removed.
The files tfile and xfile are files of binary (C-style) floats.
Caveat:
The median filter may perform poorly on the edges of a section.
Choosing larger beginning and ending mix values may help, but may
also introduce additional artifacts.
Examples:
Credits:
260
ideas for improvement:
* a versatile median filter needs to do:
shift traces by fractional amounts -> needs sinc interpolation
positive and negative shifts similar to SUSTATIC
make subtraction of filtered events a user choice
provide a median stack as well as a weighted average stack
261
SUMIGFD - 45-90 degree Finite difference depth migration for
zero-offset data.
Required Parameters:
nz= number of depth sapmles
dz= depth sampling interval
vfile= name of file containing velocities
(see Notes below concerning format of this file)
Optional Parameters:
dt=from header(dt) or .004 time sampling interval
dx=from header(d2) or 1.0 midpoint sampling interval
dip=45,65,79,80,87,89,90 Maximum angle of dip reflector
Notes: ",
The computation cost by dip angle is 45=65=79<80<87<89<90
The input velocity file \’vfile\’ consists of C-style binary floats. ",
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU
programs. (In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
denotes a v(z,x) array, the opposite of what Matlab and Fortran
programmers may expect.) ",
262
Trace header fields accessed: ns, dt, delrt, d2
Trace header fields modified: ns, dt, delrt
263
SUMIGFFD - Fourier finite difference depth migration for
zero-offset data. This method is a hybrid migration which
combines the advantages of phase shift and finite difference",
migrations.
Required Parameters:
nz= number of depth sapmles ",
dz= depth sampling interval
vfile= name of file containing velocities
Optional Parameters:
dt=from header(dt) or .004 time sampling interval
dx=from header(d2) or 1.0 midpoint sampling interval
ft=0.0 first time sample
fz=0.0 first depth sample
The input velocity file \’vfile\’ consists of C-style binary floats. ",
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU ",
programs. (In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
denotes a v(z,x) array, the opposite of what Matlab and Fortran
programmers may expect.) ",
Because most of the tools in the SU package (such as unif2, unisam2, ",
and makevel) produce output with the structure vfile[ix][iz], you will
need to transpose the velocity files created by these programs. You may
use the SU program \’transp\’ in SU to transpose such files into the
required vfile[iz][ix] structure.
264
Trace header fields accessed: ns, dt, delrt, d2
Trace header fields modified: ns, dt, delrt
265
SUMIGGBZOAN - MIGration via Gaussian beams ANisotropic media (P-wave)
Required Parameters:
a3333file= name of file containing a3333(x,z)
nx= number of inline samples (traces)
nz= number of depth samples
Optional Parameters:
dt=tr.dt time sampling interval
dx=tr.d2 inline sampling interval (trace spacing)
dz=1.0 depth sampling interval
fmin=0.025/dt minimum frequency
fmax=10*fmin maximum frequency
amin=-amax minimum emergence angle; must be > -90 degrees
amax=60 maximum emergence angle; must be < 90 degrees
bwh=0.5*vavg/fmin beam half-width; vavg denotes average velocity
Credits:
CWP: Tariq Alkhalifah, based on MIGGBZO by Dave Hale
CWP: repackaged as an SU program by John Stockwell, April 2006
Technical Reference:
266
Cerveny, V., 1972, Seismic rays and ray intensities
in inhomogeneous anisotropic media:
Geophys. J. R. Astr. Soc., 29, 1--13.
267
SUMIGGBZO - MIGration via Gaussian Beams of Zero-Offset SU data
Required Parameters:
vfile= name of file containing v(z,x)
nz= number of depth samples
Optional Parameters:
dt=from header time sampling interval
dx=from header(d2) or 1.0 spatial sampling interval
dz=1.0 depth sampling interval
fmin=0.025/dt minimum frequency
fmax=10*fmin maximum frequency
amin=-amax minimum emergence angle; must be > -90 degrees
amax=60 maximum emergence angle; must be < 90 degrees
bwh=0.5*vavg/fmin beam half-width; vavg denotes average velocity
verbose=0 =0 silent; =1 chatty
Credits:
268
SUMIGPREFD --- The 2-D prestack common-shot 45-90 degree
finite-difference depth migration.
Optional Parameters:
dip=79 the maximum dip to migrate, possible values are:
45,65,79,80,87,89,90 degrees
The computation cost is 45=65=79<80<87<89<90
fmax=25 peak frequency of Ricker wavelet used as source wavelet
f1=5,f2=10,f3=40,f4=50 frequencies to build a Hamming window
Notes:
The input velocity file \’vfile\’ consists of C-style binary floats.
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU
programs.
Because most of the tools in the SU package (such as unif2, unisam2, ",
and makevel) produce output with the structure vfile[ix][iz], you will
need to transpose the velocity files created by these programs. You may
use the SU program \’transp\’ in SU to transpose such files into the
required vfile[iz][ix] structure.
(In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
denotes a v(z,x) array, the opposite of what Matlab and Fortran
programmers may expect.) ",
269
Also, sx must be monotonically increasing throughout the dataset, and
and gx must be monotonically increasing within a shot. You may resort
your data with \’susort\’, accordingly.
The scalco header field is honored so this field must be set correctly.
See selfdocs of \’susort\’, \’suchw\’. Also: sukeyword scalco
Trace header fields accessed: ns, dt, delrt, d2, sx, gx,
Trace header fields modified: ns, dt, delrt
270
SUMIGPREFFD - The 2-D prestack common-shot Fourier finite-difference
depth migration.
Optional Parameters:
fmax=25 the peak frequency of Ricker wavelet used as source wavelet
f1=5,f2=10,f3=40,f4=50 frequencies to build a Hamming window
lpad=9999,rpad=9999 number of zero traces padded on both
sides of depth section to determine the
migration aperature, the default
values are using the full aperature.
verbose=0 silent, =1 additional runtime information
Notes:
The input velocity file consists of C-style binary floats. ",
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU ",
programs.
Because most of the tools in the SU package (such as unif2, unisam2, ",
and makevel) produce output with the structure vfile[ix][iz], you will
need to transpose the velocity files created by these programs. You may
use the SU program \’transp\’ in SU to transpose such files into the
required vfile[iz][ix] structure.
(In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
denotes a v(z,x) array, the opposite of what Matlab and Fortran
programmers may expect.) ",
271
The scalco header field is honored so this field must be set correctly.
See selfdocs of \’susort\’, \’suchw\’. Also: sukeyword scalco
272
SUMIGPREPSPI --- The 2-D PREstack commom-shot Phase-Shift-Plus
interpolation depth MIGration.
Required Parameters:
Optional Parameters:
fmax=25 the peak frequency of Ricker wavelet used as source wavelet
f1=5,f2=10,f3=40,f4=50 frequencies to build a Hamming window
lpad=9999,rpad=9999 number of zero traces padded on both
sides of depth section to determine the
migration aperature, the default values
are using the full aperature.
verbose=0 silent, =1 additional runtime information
Notes:
The input velocity file \’vfile\’ consists of C-style binary floats. ",
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU ",
programs.
Because most of the tools in the SU package (such as unif2, unisam2, ",
and makevel) produce output with the structure vfile[ix][iz], you will
need to transpose the velocity files created by these programs. You may
use the SU program \’transp\’ in SU to transpose such files into the
required vfile[iz][ix] structure.
273
your data with \’susort\’, accordingly.
The scalco header field is honored so this field must be set correctly.
See selfdocs of \’susort\’, \’suchw\’. Also: sukeyword scalco
274
SUMIGPRESP - The 2-D prestack common-shot split-step Fourier ",
migration
Required Parameters:
nxo= number of total horizontal output samples
nxshot= number of shot gathers to be migrated
nz= number of depth sapmles
dx= horizontal sampling interval
dz= depth sampling interval
vfile= velocity profile, it must be binary format.
Optional Parameters:
fmax=25 The peak frequency of Ricker wavelet used as source wavelet
f1=5,f2=10,f3=40,f4=50 frequencies to build a Hamming window
lpad=9999,rpad=9999 number of zero traces padded on both
sides of depth section to determine the
migration aperature, the default values
are using the full aperature.
verbose=0 silent, =1 additional runtime information
Notes:
The input velocity file consists of C-style binary floats.
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU
programs.
Because most of the tools in the SU package (such as unif2, unisam2, ",
and makevel) produce output with the structure vfile[ix][iz], you will
need to transpose the velocity files created by these programs. You may
use the SU program \’transp\’ in SU to transpose such files into the
required vfile[iz][ix] structure.
(In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
denotes a v(z,x) array, the opposite of what Matlab and Fortran
programmers may expect.) ",
275
The scalco header field is honored so this field must be set correctly.
See selfdocs of \’susort\’, \’suchw\’. Also: sukeyword scalco
Trace header fields accessed: ns, dt, delrt, d2, sx, gx, scalco
Trace header fields modified: ns, dt, delrt
276
SUMIGPSPI - Gazdag’s phase-shift plus interpolation depth migration
for zero-offset data, which can handle the lateral
velocity variation.
Required Parameters:
nz= number of depth sapmles
dz= depth sampling interval
vfile= name of file containing velocities
(Please see Notes below concerning the format of vfile)
Optional Parameters:
dt=from header(dt) or .004 time sampling interval
dx=from header(d2) or 1.0 midpoint sampling interval
Notes:
The input velocity file \’vfile\’ consists of C-style binary floats.
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU ",
programs.
Because most of the tools in the SU package (such as unif2, unisam2, ",
and makevel) produce output with the structure vfile[ix][iz], you will
need to transpose the velocity files created by these programs. You may
use the SU program \’transp\’ in SU to transpose such files into the
required vfile[iz][ix] structure.
277
SUMIGPS - MIGration by Phase Shift with turning rays
Required Parameters:
None
Optional Parameters:
dt=from header(dt) or .004 time sampling interval
dx=from header(d2) or 1.0 distance between sucessive cdp’s
ffil=0,0,0.5/dt,0.5/dt trapezoidal window of frequencies to migrate
tmig=0.0 times corresponding to interval velocities in vmig
vmig=1500.0 interval velocities corresponding to times in tmig
vfile= binary (non-ascii) file containing velocities v(t)
nxpad=0 number of cdps to pad with zeros before FFT
ltaper=0 length of linear taper for left and right edges",
verbose=0 =1 for diagnostic print
Notes:
Input traces must be sorted by either increasing or decreasing cdp.
The tmig and vmig arrays specify an interval velocity function of time.
Linear interpolation and constant extrapolation is used to determine
interval velocities at times not specified. Values specified in tmig
must increase monotonically.
Credits:
CWP: Dave Hale (originally called supsmig.c)
278
279
SUMIGPSTI - MIGration by Phase Shift for TI media with turning rays
Required Parameters:
None
Optional Parameters:
dt=from header(dt) or .004 time sampling interval
dx=from header(d2) or 1.0 distance between sucessive cdp’s
ffil=0,0,0.5/dt,0.5/dt trapezoidal window of frequencies to migrate
tmig=0.0 times corresponding to interval velocities in vmig
vnmig=1500.0 interval NMO velocities corresponding to times in tmig
vmig=1500.0 interval velocities corresponding to times in tmig
etamig=0.0 interval eta values corresponding to times in tmig
vnfile= binary (non-ascii) file containing NMO velocities vn(t)
vfile= binary (non-ascii) file containing velocities v(t)
etafile= binary (non-ascii) file containing eta values eta(t)
nxpad=0 number of cdps to pad with zeros before FFT
ltaper=0 length of linear taper for left and right edges ",
verbose=0 =1 for diagnostic print
Notes:
Input traces must be sorted by either increasing or decreasing cdp.
The tmig, vnmig, vmig and etamig arrays specify an interval values
function of time. Linear interpolation and constant extrapolation is
used to determine interval velocities at times not specified. Values
specified in tmig must increase monotonically.
Alternatively, interval velocities may be stored in a binary file
containing one velocity for every time sample. If vnfile is specified,
then the tmig and vnmig arrays are ignored.
280
SUMIGSPLIT - Split-step depth migration for zero-offset data.
Required Parameters:
nz= number of depth sapmles
dz= depth sampling interval
vfile= name of file containing velocities
Optional Parameters:
dt=from header(dt) or .004 time sampling interval
dx=from header(d2) or 1.0 midpoint sampling interval
ft=0.0 first time sample
fz= first depth sample
Notes:
The input velocity file \’vfile\’ consists of C-style binary floats.
The structure of this file is vfile[iz][ix]. Note that this means that
the x-direction is the fastest direction instead of z-direction! Such a
structure is more convenient for the downward continuation type
migration algorithm than using z as fastest dimension as in other SU
programs.
Reference:
281
Stoffa, P. L. and Fokkema, J. T. and Freire, R. M. and Kessinger, W. P.,
1990, Split-step Fourier migration, Geophysics, 55, 410-421.
282
SUMIGTK - MIGration via T-K domain method for common-midpoint stacked data
Required Parameters:
dxcdp distance between successive cdps
Optional Parameters:
fmax=Nyquist maximum frequency
tmig=0.0 times corresponding to interval velocities in vmig
vmig=1500.0 interval velocities corresponding to times in tmig
vfile= binary (non-ascii) file containing velocities v(t)
nxpad=0 number of cdps to pad with zeros before FFT
ltaper=0 length of linear taper for left and right edges",
verbose=0 =1 for diagnostic print
Notes:
Input traces must be sorted by either increasing or decreasing cdp.
The tmig and vmig arrays specify an interval velocity function of time.
Linear interpolation and constant extrapolation is used to determine
interval velocities at times not specified. Values specified in tmig
must increase monotonically.
Credits:
CWP: Dave Hale
283
SUMIGTOPO2D - Kirchhoff Depth Migration of 2D postack/prestack data
from the (variable topography) recording surface
Required parameters:
infile=stdin file for input seismic traces
outfile=stdout file for common offset migration output
ttfile file for input traveltime tables
The following 9 parameters describe traveltime tables:
fzt first depth sample in traveltime table
nzt number of depth samples in traveltime table
dzt depth interval in traveltime table
fxt first lateral sample in traveltime table
nxt number of lateral samples in traveltime table
dxt lateral interval in traveltime table
fs x-coordinate of first source
ns number of sources
ds x-coordinate increment of sources
Optional Parameters:
dt= or from header (dt) time sampling interval of input data
ft= or from header (ft) first time sample of input data
dxm= or from header (d2) sampling interval of midpoints
surf="0,0;99999,0" Recording surface "x1,z1;x2,z2;x3,z3;...
fzo=fzt z-coordinate of first point in output trace
dzo=0.2*dzt vertical spacing of output trace
nzo=5*(nzt-1)+1 number of points in output trace ",
fxo=fxt x-coordinate of first output trace
dxo=0.5*dxt horizontal spacing of output trace
nxo=2*(nxt-1)+1 number of output traces ",
off0=0 first offest in output
doff=99999 offset increment in output
noff=1 number of offsets in output ",
fmax=0.25/dt frequency-highcut for input traces
offmax=99999 maximum absolute offset allowed in migration
aperx=nxt*dxt/2 migration lateral aperature
angmax=60 migration angle aperature from vertical
v0=1500(m/s) reference velocity value at surface ",
284
dvz=0.0 reference velocity vertical gradient
ls=1 flag for line source
jpfile=stderr job print file name
mtr=100 print verbal information at every mtr traces
ntr=100000 maximum number of input traces to be migrated
Notes:
1. Traveltime tables were generated by program rayt2dtopo (or any
other one that considers topography )on relatively coarse grids,
with dimension ns*nxt*nzt. In the migration process, traveltimes
are interpolated into shot/gephone positions and output grids.
2. Input seismic traces must be SU format and can be any type of
gathers (common shot, common offset, common CDP, and so on). ",
3. Migrated traces are output in CDP gathers if velocity analysis
is required, with dimension nxo*noff*nzo. ",
4. If the offset value of an input trace is not in the offset array
of output, the nearest one in the array is chosen.
5. Amplitudes are computed using the reference velocity profile, v(z),
specified by the parameters v0= and dvz=.
6. Input traces must specify source and receiver positions via the header
fields tr.sx and tr.gx. Offset is computed automatically.
References :
Bleistein, N., Cohen, J., and Hagin, F., 1987, Two and one-half
dimensional Born inversion with arbitrary reference: Geophysics,
52, 26-36.
285
SUMIXGATHERS - mix two gathers
Required Parameters:
ntr=tr.ntr if ntr header field is not set, then ntr is mandatory
Credits:
Daniel Trad. UBC
Trace header fields accessed: ns, dt, ntr
Copyright (c) University of British Columbia, 1999.
All rights reserved.
286
SUMIX - compute weighted moving average (trace MIX) on a panel
of seismic data
Note:
The number of values defined by mix=val1,val2,... determines the number
of traces to be averaged, the values determine the weights.
Examples:
sumix <stdin mix=.6,1,1,1,.6 >sdout (default) mix over 5 traces weights
sumix <stdin mix=1,1,1 >sdout simple 3 trace moving average
Author:
CWP: John Stockwell, Oct 1995
287
SUMUTE - mute above (or below) a user-defined polygonal curve with ",
the distance along the curve specified by key header word
Required parameters:
xmute= array of position values as specified by
the ‘key’ parameter
tmute= array of corresponding time values (sec)
in case of air wave muting, correspond to
air blast duration
... or input via files:
nmute= number of x,t values defining mute
xfile= file containing position values as specified by
the ‘key’ parameter
tfile= file containing corresponding time values (sec)
Optional parameters:
key=offset Key header word specifying trace offset
=tracl use trace number instead
ntaper=0 number of points to taper before hard
mute (sine squared taper)
mode=0 =1 to zero BELOW the polygonal curve
=2 to mute below AND above a straight line
in that case xmute,tmute describes the total
time length of the muted zone
linvel=330 linear velocity
tm0=0 time shift of linear mute at \’key\’=0
Notes:
The files tfile and xfile are files of binary (C-style) floats.
The below=2 option is intended for removing air waves. The mute is
is over a narrow window above and below the polygonal line specified
288
by the values in tmute, xmute or tfile and xfile.
Caveat: if data are seismic time sections, then tr.dt must be set. If
data are seismic depth sections, then tr.trid must be set to 30, and
tr.d1 header field must be set.
Credits:
289
SUNAN - remove NaNs & Infs from the input stream
Optional parameters:
verbose=1 echo locations of NaNs or Infs to stderr
=0 silent
Notes:
A simple program to remove NaNs and Infs from an input stream.
The program sets NaNs and Infs to 0.0.
A simple program to remove NaNs & Infs from an input stream. They
shouldn’t be there, but it can be hard to find the cause and fix
the problem if you can’t look at the data.
290
SUNHMOSPIKE - generates SPIKE test data set with a choice of several
Non-Hyperbolic MOveouts
Optional parameters:
nt=300 number of time samples
ntr=20 number of traces
dt=0.001 time sample rate in seconds
offref=2000 reference offset
Notes:
Creates a common cdp su data file with up to four spike events
for impulse response studies for suradon, and sutifowler
Credits:
CWP: Shuki Ronen, Chris Liner,
291
Modified: CWP by John Anderson, April, 1994, to have
appropriate trace header words and default values
for SUTIFOWLER tests
292
SUNMO - NMO for an arbitrary velocity function of time and CDP
Optional Parameters:
tnmo=0 NMO times corresponding to velocities in vnmo
vnmo=1500 NMO velocities corresponding to times in tnmo
anis1=0 two anisotropy coefficients making up quartic term
anis2=0 in traveltime curve, corresponding to times in tnmo
cdp= CDPs for which vnmo & tnmo are specified (see Notes)
smute=1.5 samples with NMO stretch exceeding smute are zeroed
lmute=25 length (in samples) of linear ramp for stretch mute
sscale=1 =1 to divide output samples by NMO stretch factor
invert=0 =1 to perform (approximate) inverse NMO
ixoffset=0 do not consider cross-line offset
=1 read cross-line offset from trace header
upward=0 =1 to scan upward to find first sample to kill
Notes:
For constant-velocity NMO, specify only one vnmo=constant and omit tnmo.
For NMO with a velocity function of time only, specify the arrays
vnmo=v1,v2,... tnmo=t1,t2,...
where v1 is the velocity at time t1, v2 is the velocity at time t2, ...
The times specified in the tnmo array must be monotonically increasing.
Linear interpolation and constant extrapolation of the specified velocities
is used to compute the velocities at times not specified.
The same holds for the anisotropy coefficients as a function of time only.
For NMO with a velocity function of time and CDP, specify the array
cdp=cdp1,cdp2,...
and, for each CDP specified, specify the vnmo and tnmo arrays as described
above. The first (vnmo,tnmo) pair corresponds to the first cdp, and so on.
Linear interpolation and constant extrapolation of 1/velocity^2 is used
to compute velocities at CDPs not specified.
The same holds for the anisotropy coefficients as a function of time and
CDP.
Moveout is defined by
293
1 anis1
--- x^2 + ------------- x^4.
v^2 1 + anis2 x^2
Note: In general, the user should set the cdp parameter. The default is
to use tr.cdp from the first trace and assume only one cdp.
Caveat:
Nmo cannot handle negative moveout as in triplication caused by
anisotropy. But negative moveout happens necessarily for negative anis1 at
sufficiently large offsets. Then the error-negative moveout- is printed.
Check anis1. An error (anis2 too small) is also printed if the
denominator of the quartic term becomes negative. Check anis2. These errors
are prompted even if they occur in traces which would not survive the
NMO-stretch threshold. Chop off enough far-offset traces (e.g. with suwind)
if anis1, anis2 are fine for near-offset traces.
NMO interpolation error is less than 1% for frequencies less than 60% of
the Nyquist frequency.
Credits:
SEP: Shuki, Chuck Sword
CWP: Shuki, Jack, Dave Hale, Bjoern Rommel
Modified: 08/08/98 - Carlos E. Theodoro - option for lateral offset
Modified: 07/11/02 - Sang-yong Suh -
added "upward" option to handle decreasing velocity function.
Technical Reference:
The Common Depth Point Stack
William A. Schneider
Proc. IEEE, v. 72, n. 10, p. 1238-1254
1984
294
SUNORMALIZE - Trace balancing by rms, max, or median ",
Required parameters:
dt=tr.dt if not set in header, dt is mandatory
ns=tr.ns if not set in header, ns is mandatory
Optional parameters:
norm=rms type of norm rms, max, med
t0=0.0 startimg time for window
t1=TMAX ending time for window
295
SUNULL - create null (all zeroes) traces
Required parameter
nt= number of samples per trace
Optional parameters
ntr=5 number of null traces to create
dt=0.004 time sampling interval
Credits:
CWP: Jack K. Cohen
296
SUOCEXT - smaller Offset EXTrapolation via Offset Continuation
method for common-offset gathers
Required Parameters:
cdpmin= minimum cdp (integer number) for which to apply DMO
cdpmax= maximum cdp (integer number) for which to apply DMO
dxcdp= distance between adjacent cdp bins (m)
noffmix= number of offsets to mix (see notes)
offextr= offset to extrapolate
Optional Parameters:
tdmo=0.0 times corresponding to rms velocities in vdmo (s)
vdmo=1500.0 rms velocities corresponding to times in tdmo (m/s)
sdmo=1.0 DMO stretch factor; try 0.6 for typical v(z)
fmax=0.5/dt maximum frequency in input traces (Hz)
verbose=0 =1 for diagnostic print
tmpdir= if non-empty, use the value as a directory path prefix
for storing temporary files; else if the CWP_TMPDIR
environment variable is set use its value for the path;
else use tmpfile()
Notes:
Input traces should be sorted into common-offset gathers. One common-
offset gather ends and another begins when the offset field of the trace
headers changes. One common-offset gather usually is enough.
The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
the cdp location expressed in units of meters or feet.
The number of offsets to mix (noffmix) should typically equal the ratio of
the shotpoint spacing to the cdp spacing. This choice ensures that every
cdp will be represented in each offset mix. Traces in each mix will
contribute through DMO to other traces in adjacent cdps within that mix.
The tdmo and vdmo arrays specify a velocity function of time that is
used to implement a first-order correction for depth-variable velocity.
The times in tdmo must be monotonically increasing.
For each offset, the minimum time at which a non-zero sample exists is
used to determine a mute time. Output samples for times earlier than this",
mute time will be zeroed. Computation time may be significantly reduced
297
if the input traces are zeroed (muted) for early times at large offsets.
Technical Reference:
C. Theodoro & K. Larner, 1998
Extrapolation of seismic data to small offsets (CWP-276).
298
SUOLDTONEW - convert existing su data to xdr format
Required parameters:
none
Optional parameters:
none
Notes:
This program is used to convert native machine datasets to
xdr-based, system-independent format.
299
SUOP2 - do a binary operation on two data sets
Required parameters:
none
Optional parameter:
op=diff difference of two panels of seismic data
=sum sum of two panels of seismic data
=prod product of two panels of seismic data
=quo quotient of two panels of seismic data
=ptdiff differences of a panel and single trace
=ptsum sum of a panel and single trace
=ptprod product of a panel and single trace
=ptquo quotient of a panel and single trace
=zipper do "zipper" merge of two panels
300
Note4: With op=quo and op=ptquo, divide by 0 is trapped and 0 is returned.
tr[2*i]= tr1[i]
tr[2*i+1] = tr2[i]
The default value of output tr.trid is that used by sufft and suifft,
which is the trace id reserved for the complex traces obtained through
the application of sufft. See also, suamp.
Credits:
SEP: Shuki Ronen
CWP: Jack K. Cohen
CWP: John Stockwell, 1995, added panel op trace options.
: Fernando M. Roxo da Motta <[email protected]> - added zipper op
Notes:
If efficiency becomes important consider inverting main loop
and repeating operation code within the branches of the switch.
301
SUOP - do unary arithmetic operation on segys
Required parameters:
none
Optional parameter:
op=abs operation flag
abs : absolute value
avg : remove average value
ssqrt : signed square root
sqr : square
ssqr : signed square
sgn : signum function
exp : exponentiate
slog : signed natural log
slog10: signed common log
cos : cosine
sin : sine
tan : tangent
cosh : hyperbolic cosine
sinh : hyperbolic sine
tanh : hyperbolic tangent
norm : divide trace by Max. Value
db : 20 * slog10 (data)
neg : negate value
posonly : pass only positive values
negonly : pass only negative values
sum : running sum trace integration
diff : running diff trace differentiation
refl : (v[i+1] - v[i])/(v[i+1] + v[i])
mod2pi : modulo 2 pi
inv : inverse
rmsamp : rms amplitude
nop : no operation
302
Credits:
Notes:
If efficiency becomes important consider inverting main loop
and repeating operation code within the branches of the switch.
303
SUPACK1 - pack segy trace data into chars
Required parameters:
none
Optional parameter:
gpow=0.5 exponent used to compress the dynamic
range of the traces
Credits:
CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner
Caveats:
This program is for single site use. Use segywrite to make
a portable tape.
Notes:
ungpow and unscale are defined in segy.h
trid = CHARPACK is defined in su.h and segy.h
304
SUPACK2 - pack segy trace data into 2 byte shorts
Required parameters:
none
Optional parameter:
gpow=0.5 exponent used to compress the dynamic
range of the traces
Credits:
CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner
Caveats:
This program is for single site use. Use segywrite to make
a portable tape.
Notes:
ungpow and unscale are defined in segy.h
trid = SHORTPACK is defined in su.h and segy.h
305
SUPASTE - paste existing SEGY headers on existing data
Required parameter:
ns=the number of samples per trace
Optional parameters:
head=headers file with segy headers
ftn=0 Fortran flag
0 = unformatted data from C
1 = ... from Fortran
verbose=0 1= echo number of traces pasted
Caution:
An incorrect ns field will munge subsequent processing.
Notes:
This program is used when the option head=headers is used in
sustrip. See: sudoc sustrip for more details
Credits:
CWP: Jack K. Cohen
306
SUPEF - Wiener predictive error filtering
Required parameters:
dt is mandatory if not set in header
Optional parameters:
cdp= CDPs for which minlag, maxlag, pnoise, mincorr,
maxcorr are set (see Notes)
minlag=dt first lag of prediction filter (sec)
maxlag=last lag default is (tmax-tmin)/20
pnoise=0.001 relative additive noise level
mincorr=tmin start of autocorrelation window (sec)
maxcorr=tmax end of autocorrelation window (sec)
showwiener=0 =1 to show Wiener filter on each trace
mix=1,... array of weights (floats) for moving
average of the autocorrelations
outpar=/dev/null output parameter file, contains the Wiener filter
if showwiener=1 is set
method=linear for linear interpolation of cdp values
=mono for monotonic cubic interpolation of cdps
=akima for Akima’s cubic interpolation of cdps
=spline for cubic spline interpolation of cdps
Notes:
You will see horizontal strip running across the center of your plot.
This is the autocorrelation wavelet for each trace. The idea of spiking
decon is to apply a Wiener filter with no gap to the data to collapse
the waveform into a spike. The idea is to pick the width of the
autocorrelation waveform _from beginning to end_ (not trough to trough)
and use this time for MAXLAG_SPIKING:
307
supef < data.su maxlag=MAXLAG_SPIKING > dataspiked.su
The value of ntout must be larger than the default 100. The idea is
to look for repetitions in the autocorrelation. These repetitions will
appear as a family of parallel stripes above and below the main
autocorrelation waveform. Set MAXLAG_PEF to the period of the repetitions
Set MINLAG_PEF to be slightly larger than the value of MAXLAG_SPIKING
that you used to spike the data.
3) It may be effective to sort your data into cdp gathers with susort,
and perform sunmo correction to the water speed with sunmo, prior to
attempts to suppress water bottom multiples. After applying supef, the
user should apply inverse nmo to undo the nmo to water speed prior to
further processing.
Caveat:
The showweiner=1 option writes out the wiener filter to outpar, and
the prediction error filter to stdout, which is ",
1,0,0,...,-wiener[0],...,-wiener[imaxlag-1]
where the sample value of -wiener[0], is iminlag in the pe-filter.
The pe-filter is output as a SU format datafile, one pe-filter for each
308
trace input.
Credits:
CWP: Shuki Ronen, Jack K. Cohen, Ken Larner
CWP: John Stockwell, added mixing feature (April 1998)
CSM: Tanya Slota (September 2005) added cdp feature
Technical Reference:
A. Ziolkowski, "Deconvolution", for value of maxlag default:
page 91: imaxlag < nt/10. I took nt/20.
Notes:
The prediction error filter is 1,0,0...,0,-wiener[0], ...,
so no point in explicitly forming it.
309
SUPERMUTE - permute or transpose a 3d datacube
Required parameters:
none
Optional parameters:
n1=ns from header number of samples in the fast direction
n2=ntr from header number of samples in the med direction ",
n3=1 number of samples in the slow direction
Credits:
310
SUPGC - Programmed Gain Control--apply agc like function
but the same function to all traces preserving
relative amplitudes spatially.
Required parameter:
file= name of input file
Optional parameters:
ntrscan=200 number of traces to scan for gain function
lwindow=1.0 length of time window in seconds
311
SUPICKAMP - pick amplitudes within user defined and resampled window
Required parameters:
d2= sampling interval for slow dimension
(required if key-parameter not specified)
Optional parameters:
key= Key header word specifying trace offset
(alternatively, specify d2,x2beg)
312
(3) files t_xabove, t_xbelow
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset)
Type sukeyword -o to see the complete list of SU keywords.
Credits:
313
SUPLANE - create common offset data file with up to 3 planes
Optional Parameters:
npl=3 number of planes
nt=64 number of time samples
ntr=32 number of traces
taper=0 no end-of-plane taper
= 1 taper planes to zero at the end
offset=400 offset
dt=0.004 time sample interval in seconds
...plane 1 ...
dip1=0 dip of plane #1 (ms/trace)
len1= 3*ntr/4 HORIZONTAL extent of plane (traces)
ct1= nt/2 time sample for center pivot
cx1= ntr/2 trace for center pivot
...plane 2 ...
dip2=4 dip of plane #2 (ms/trace)
len2= 3*ntr/4 HORIZONTAL extent of plane (traces)
ct2= nt/2 time sample for center pivot
cx2= ntr/2 trace for center pivot
...plane 3 ...
dip3=8 dip of plane #3 (ms/trace)
len3= 3*ntr/4 HORIZONTAL extent of plane (traces)
ct3= nt/2 time sample for center pivot
cx3= ntr/2 trace for center pivot
Credits:
CWP: Chris Liner
314
SUPOFILT - POlarization FILTer for three-component data
Required parameters:
dfile=polar.dir file containing the 3 components of the
direction of polarization
wfile=polar.rl file name of weighting polarization parameter
Optional parameters:
dt=(from header) time sampling intervall in seconds
smooth=1 1 = smooth filter operators, 0 do not
sl=0.05 smoothing window length in seconds
wpow=1.0 raise weighting function to power wpow
dpow=1.0 raise directivity functions to power dpow
verbose=0 1 = echo additional information
Notes:
Three adjacent traces are considered as one three-component
dataset.
References:
Benhama, A., Cliet, C. and Dubesset, M., 1986: Study and
Application of spatial directional filtering in three
component recordings.
Geophysical Prospecting, vol. 36.
Kanasewich, E. R., 1981: Time Sequence Analysis in Geophysics,
The University of Alberta Press.
Kanasewich, E. R., 1990: Seismic Noise Attenuation,
Handbook of Geophysical Exploration, Pergamon Press, Oxford.
315
Trace header fields accessed: ns, dt
316
SUPOLAR - POLarization analysis of three-component data
Required parameters:
none
Optional parameters:
dt=(from header) time sampling intervall in seconds
wl=0.1 correlation window length in seconds
win=boxcar correlation window shape, choose "boxcar",
"hanning", "bartlett", or "welsh
file=polar base of output file name(s)
rl=1 1 = rectilinearity evaluating 2 eigenvalues,
2, 3 = rectilinearity evaluating 3 eigenvalues
rlq=1.0 contrast parameter for rectilinearity
dir=1 1 = 3 components of direction of polarization
(the only three-component output file)
tau=0 1 = global polarization parameter
ellip=0 1 = principal, subprincipal, and transverse
ellipticities e21, e31, and e32
pln=0 1 = planarity measure
f1=0 1 = flatness or oblateness coefficient
l1=0 1 = linearity coefficient
amp=0 1 = amplitude parameters: instantaneous,
quadratic, and eigenresultant ir, qr, and er
theta=0 1, 2, 3 = incidence angle of principal axis
phi=0 1, 2, 3 = horizontal azimuth of principal axis
angle=rad unit of angles theta and phi, choose "rad",
"deg", or "gon
all=0 1, 2, 3 = set all output flags to that value
verbose=0 1 = echo additional information
Notes:
Three adjacent traces are considered as one three-component
dataset.
Correct calculation of angles theta and phi requires the first of
these traces to be the vertical component, followed by the two
horizontal components (e.g. Z, N, E, or Z, inline, crossline).
Significant signal energy on Z is necessary to resolve the 180 deg
ambiguity of phi (options phi=2,3 only).
317
Each calculated polarization attribute is written into its own
SU file. These files get the same base name (set with "file=")
and the parameter flag as an extension (e.g. polar.rl).
Range of values:
parameter option interval
rl 1, 2 0.0 ... 1.0 (1.0: linear polarization)
rl 3 -1.0 ... 1.0
tau, l1 1 0.0 ... 1.0 (1.0: linear polarization)
pln, f1 1 0.0 ... 1.0 (1.0: planar polarization)
e21, e31, e32 1 0.0 ... 1.0 (0.0: linear polarization)
theta 1 -pi/2... pi/2 rad
theta 2, 3 0.0 ... pi/2 rad
phi 1 -pi/2... pi/2 rad
phi 2 -pi ... pi rad (see notes above)
phi 3 0.0 ... 2 pi rad (see notes above)
References:
Jurkevics, A., 1988: Polarization analysis of three-component
array data. Bulletin of the Seismological Society of America,
vol. 78, no. 5.
Kanasewich, E. R., 1981: Time Sequence Analysis in Geophysics.
The University of Alberta Press.
Kanasewich, E. R., 1990: Seismic Noise Attenuation.
Handbook of Geophysical Exploration, Pergamon Press, Oxford.
Meyer, J. H. 1988: First Comparative Results of Integral and
Instantaneous Polarization Attributes for Multicomponent Seismic
Data. Institut Francais du Petrole.
Press, W. H., Teukolsky, S. A., Vetterling, W. T., and Flannery, B. P.
1996: Numerical Recipes in C - The Art of Scientific Computing.
Cambridge University Press, Cambridge.
318
Samson, J. C., 1973: Description of the Polarisation States of Vector
Processes: Application to ULF Electromagnetic Fields.
Geophysical Journal vol. 34, p. 403-419.
Sheriff, R. E., 1991: Encyclopedic Dictionary of Exploration
Geophysics. 3rd ed., Society of Exploration Geophysicists, Tulsa.
319
SUPUT - Connect SU program to file descriptor for output stream.
fd=-1 file_descriptor_for_output_stream_from_su
verbose=0 minimal listing
=1 asks for message with each trace processed.
320
SUPWS - Phase stack or phase-weighted stack (PWS) of adjacent traces
having the same key header word
Required parameters:
none
Optional parameters:
key=cdp key header word to stack on
pwr=1.0 raise phase stack to power pwr
dt=(from header) time sampling intervall in seconds
sl=0.0 window length in seconds used for smoothing
of the phase stack (weights)
ps=0 0 = output is PWS, 1 = output is phase stack
verbose=0 1 = echo additional information
Note:
Phase weighted stacking is a tool for efficient incoherent noise
reduction. An amplitude-unbiased coherency measure is designed
based on the instantaneous phase, which is used to weight the
samples of an ordinary, linear stack. The result is called the
phase-weighted stack (PWS) and is cleaned from incoherent noise.
PWS thus permits detection of weak but coherent arrivals.
If the stacking is over cdp and the PWS option is set, then the
offset header field is set to zero. Otherwise, output traces get
their headers from the first trace of each data ensemble to stack,
including the offset field. Use "sushw" afterwards, if this is
not acceptable.
References:
B. L. N. Kennett, 2000: Stacking three-component seismograms.
Geophysical Journal International, vol. 141, p. 263-269.
M. Schimmel and H. Paulssen, 1997: Noise reduction and detection
321
of weak , coherent signals through phase-weighted stacks.
Geophysical Journal International, vol. 130, p. 497-505.
M. T. Taner, A. F. Koehler, and R. E. Sheriff, 1979: Complex
seismic trace analysis. Geophysics, vol. 44, p. 1041-1063.
322
SUQUANTILE - display some quantiles or ranks of a data set
Required parameters:
none (no-op)
Optional parameters:
panel=1 flag; 0 = do trace by trace (vs. whole data set)
quantiles=1 flag; 0 = give ranks instead of quantiles
verbose=0 verbose = 1 echoes information
Credits:
CWP: Jack K. Cohen
323
SURADON - compute forward or reverse Radon transform or remove multiples
by using the parabolic Radon transform to estimate multiples
and subtract.
Optional Parameters:
choose=0 0 Forward Radon transform
1 Compute data minus multiples
2 Compute estimate of multiples
3 Compute forward and reverse transform
4 Compute inverse Radon transform
igopt=1 1 parabolic transform: g(x) = offset**2
2 Foster/Mosher psuedo hyperbolic transform
g(x) = sqrt(depth**2 + offset**2)
3 Linear tau-p: g(x) = offset
4 abs linear tau-p: g(x) = abs(offset)
offref=2000. reference maximum offset to which maximum and minimum
moveout times are associated
interoff=0. intercept offset to which tau-p times are associated
pmin=-200 minimum moveout in ms on reference offset
pmax=400 maximum moveout in ms on reference offset
dp=16 moveout increment in ms on reference offset
pmula=80 moveout in ms on reference offset where multiples begin
at maximum time
pmulb=200 moveout in ms on reference offset where multiples begin
at zero time
depthref=500. Reference depth for Foster/Mosher hyperbolic transform
nwin=1 number of windows to use through the mute zone
f1=60. High-end frequency before taper off
f2=80. High-end frequency
prewhite=0.1 Prewhitening factor in percent.
cdpkey=cdp name of header word for defining ensemble
offkey=offset name of header word with spatial information
nxmax=120 maximum number of input traces per ensemble
ltaper=7 taper (integer) for mute tapering function
Optimizing Parameters:
The following parameters are occasionally used to avoid spatial aliasing
problems on the linear tau-p transform. Not recommended for other
transforms...
ninterp=0 number of traces to interpolate between each input trace
prior to computing transform
324
freq1=3.0 low-end frequency in Hz for picking (good default: 3 Hz)
(Known bug: freq1 cannot be zero)
freq2=20.0 high-end frequency in Hz for picking (good default: 20 Hz)
lagc=400 length of AGC operator for picking (good default: 400 ms)
lent=5 length of time smoother in samples for picker
(good default: 5 samples)
lenx=1 length of space smoother in samples for picker
(good default: 1 sample)
xopt=1 1 = use differences for spatial derivative
(works with irregular spacing)
0 = use FFT derivative for spatial derivatives
(more accurate but requires regular spacing and
at least 16 input tracs--will switch to differences
automatically if have less than 16 input traces)
Credits:
CWP: John Anderson (visitor to CSM from Mobil) Spring 1993
NWIN notes:
The parabolic transform runs with higher resolution if the
mute zone is honored. When "nwin" is specified larger than
one (say 6), then multiple windows are used through the mute
zone. It is assumed in this case that the input data are
sorted by the offkey header item from small offset to large
offset. This causes the code to run 6 times longer. The
mute time is taken from the "muts" header word.
You may have to manually set this header field yourself, if
it is not already set.
References:
Anderson, J. E., 1993, Parabolic and linear 2-D, tau-p transforms
using the generalized radon tranform, in May 11-14, 1993
Project Review, Consortium Project on Seismic Inverse methods
for Complex Structures, CWP-137, Center for Wave Phenomena
325
internal report.
Other References cited in above paper:
Beylkin, G,.1987, The discrete Radon transform: IEEE Transactions
of Acoustics, Speech, and Signal Processing, 35, 162-712.
Chapman, C.H.,1981, Generalized Radon transforms and slant stacks:
Geophysical Journal of the Royal Astronomical Society, 66,
445-453.
Foster, D. J. and Mosher, C. C., 1990, Multiple supression
using curvilinear Radon transforms: SEG Expanded Abstracts 1990,
1647-1650.
Foster, D. J. and Mosher, C. C., 1992, Suppression of multiples
using the Radon transform: Geophysics, 57, No. 3, 386-395.
Gulunay, N., 1990, F-X domain least-squares Tau-P and Tau-Q: SEG
Expanded Abstracts 1990, 1607-1610.
Hampson, D., 1986, Inverse velocity stacking for multiple elimination:
J. Can. Soc. Expl. Geophs., 22, 44-55.
Hampson, D., 1987, The discrete Radon transform: a new tool for image
enhancement and noise suppression: SEG Expanded Abstracts 1978,
141-143.
Johnston, D.E., 1990, Which multiple suppression method should I use?
SEG Expanded Abstracts 1990, 1750-1752.
326
SURAMP - Linearly taper the start and/or end of traces to zero.
Required parameters:
if dt is not set in header, then dt is mandatory
Optional parameters
tmin=tr.delrt/1000 end of starting ramp (sec)
tmax=(nt-1)*dt beginning of ending ramp (sec)
dt = (from header) sampling interval (sec)
Credits:
327
SURANDSPIKE - make a small data set of RANDom SPIKEs
Optional parameters:
n1=500 number of time samples
n2=200 number of traces
dt=0.002 time sample rate in seconds
nspk=20 number of spikes per trace
amax=0.2 abs(max) spike value
mode=1 different spikes on each trace
=2 same spikes on each trace
seed=from_clock random number seed (integer)
Credits:
ARAMCO: Chris Liner
328
SURANDSTAT - Add RANDom time shifts STATIC errors to seismic traces
Required parameters:
none
Optional Parameters:
seed=from_clock random number seed (integer)
max=tr.dt maximum random time shift (ms)
scale=1.0 scale factor for shifts
Credits:
ARAMCO: Chris Liner 3/26/05
329
SURANGE - get max and min values for non-zero header entries
surange <stdin
Optional parameters:
key= Header key(s) to range (default=all)
Credits:
Geocon: Garry Perratt (output one header per line;
option to specify headers to range;
added first & last values where min<max)
Based upon original by:
SEP: Stew Levin
CWP: Jack K. Cohen
Note: the use of "signal" is inherited from BSD days and may
break on some UNIXs. It is dicy in that the responsibility
for program termination is lateraled back to the main.
330
SURECIP - sum opposing offsets in prepared data (see below)
Sum traces with equal positive and negative offsets (i.e. assume
reciprocity holds).
Usage:
suabshw <data >absdata
susort cdp offset <absdata | surecip >sumdata
Credits:
SEP: Shuki Ronen
CWP: Jack Cohen
Caveat:
The assumption is that this operation is not a mainstay processing
item. Hence the recommended implemention via the ’recip’ shell
script. If it becomes a mainstay, then a much faster code can
quickly drummed up by incorporating portions of suabshw and
susort.
331
SUREDUCE - convert traces to display in reduced time ",
Required parameters:
dt=tr.dt if not set in header, dt is mandatory
Optional parameters:
rv=8.0 reducing velocity in km/sec ",
332
SUREFCON - Convolution of user-supplied Forward and Reverse
refraction shots using XY trace offset in reverse shot
Required parameters:
sufile= file containing SU trace to use as reverse shot
xy= Number of traces offseted from the 1st trace in sufile
Optional parameters:
none
Notes:
This code implements the Refraction Convolution Section (RCS) method
of generalized reciprocal refraction traveltime analysis developed by
Derecke Palmer and Leoni Jones.
The time sampling interval on the output traces is half of that on the
traces in the input files.
Example:
333
section (RCS) method
method described in:
334
SURELANAN - REsiduaL-moveout semblance ANalysis for ANisotropic media
Required parameters:
reflector file: reflec =
number of points in the reflector file =
Optional Parameters:
nr1=51 number of r1-parameter samples
dr1=0.01 r1-parameter sampling interval
fr1=-0.25 first value of r1-parameter
nr2=51 number of r2-parameter samples
dr2=0.01 r2-parameter sampling interval
fr2=-0.25 first value of r2-parameter
dzratio=5 ratio of output to input depth sampling intervals
nsmooth=dzratio*2+1 length of semblance num and den smoothing window
verbose=0 =1 for diagnostic print on stderr
method=linear for linear interpolation of the interface
=mono for monotonic cubic interpolation of interface
=akima for Akima’s cubic interpolation of interface
=spline for cubic spline interpolation of interface
Note:
1. This program is part of Debashish Sarkar’s anisotropic model building
technique.
2. Input migrated traces should be sorted by cdp - surelan outputs a
group of semblance traces every time cdp changes. Therefore, the
output will be useful only if cdp gathers are input.
3. The residual-moveout semblance for cdp gathers is based
on z(h)*z(h) = z(0)*z(0) + r1*h^2 + r2*h^4/[h^2+z(0)^2] where z
depth and h is the half-offset.
335
SURELAN - compute residual-moveout semblance for cdp gathers based
on z(h)*z(h) = z(0)*z(0) + r*h*h where z depth and h offset.
Optional Parameters:
nr=51 number of r-parameter samples
dr=0.01 r-parameter sampling interval
fr=-0.25 first value of b-parameter
smute=1.5 samples with RMO stretch exceeding smute are zeroed
dzratio=5 ratio of output to input depth sampling intervals
nsmooth=dzratio*2+1 length of semblance num and den smoothing window
verbose=0 =1 for diagnostic print on stderr
Note:
1. This program is part of Zhenyue Liu’s velocity analysis technique.
2. Input migrated traces should be sorted by cdp - surelan outputs a
group of semblance traces every time cdp changes. Therefore, the
output will be useful only if cdp gathers are input.
3. The parameter r may take negative values. The range of r can be
controlled by maximum of (z(h)*z(h)-z(0)*z(0))/(h*h)
336
SURESAMP - Resample in time
Required parameters:
none
Optional Parameters:
nt=tr.ns number of time samples on output
dt= time sampling interval on output
default is:
tr.dt/10^6 seismic data
tr.d1 non-seismic data
tmin= time of first sample in output
default is:
tr.delrt/10^3 seismic data
tr.f1 non-seismic data
rf= resampling factor;
if defined, set nt=nt_in*rf and dt=dt_in/rf
verbose=0 =1 for advisory messages
337
Credits:
CWP: Dave (resamp algorithm), Jack (SU adaptation)
CENPET: Werner M. Heigl - modified for well log support
RISSC: Nils Maercklin 2006 - minor fixes, added rf option
Algorithm:
Resampling is done via 8-coefficient sinc-interpolation.
See "$CWPROOT/src/cwp/lib/intsinc8.c" for technical details.
Trace header fields accessed: ns, dt, delrt, d1, f1, trid
Trace header fields modified: ns, dt, delrt (only when set tmin)
d1, f1 (only when set tmin)
338
SURESSTAT - Surface consistent source and receiver statics calculation
Required parameters:
ssol= output file source statics
rsol= output file receiver statics
ntraces= number of traces in input data set (must be correct!)
Optional parameters:
ntpick=50 maximum static shift (samples)
niter=5 number of iterations
nshot=240 largest shot number (fldr=1 to nshot)
nr=335 largest receiver number (tracf=1 to nr)
nc=574 maximum number of cmp’s (for array allocation)
sfold=96 maximum shot gather fold
rfold=96 maximum receiver gather fold
cfold=48 maximum cmp gather fold
sub=0 subtract super trace 1 from super trace 2 (=1)
sub=0 strongly biases static to a value of 0
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)
verbose=0 print diagnostic output (verbose=1)
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).
339
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.)
Reference:
Credits:
CWP: Timo Tjan, 4 October 1994
340
SUSHAPE - Wiener shaping filter
Required parameters:
w= vector of input wavelet to be shaped or ...
...or ...
wfile= ... file containing input wavelet in SU (SEGY trace) format
d= vector of desired output wavelet or ...
...or ...
dfile= ... file containing desired output wavelet in SU format
dt=tr.dt if tr.dt is not set in header, then dt is mandatory
Optional parameters:
nshape=trace length of shaping filter
pnoise=0.001 relative additive noise level
showshaper=0 =1 to show shaping filter
Notes:
Credits:
CWP: Jack Cohen
CWP: John Stockwell, added wfile and dfile options
341
SUSHIFT - shifted/windowed traces in time
(defaults for tmin and tmax are calculated from the first trace.
verbose= 1 echos parameters to stdout
Background :
tmin and tmax must be given in seconds
The dt= and fill= options are intended for manipulating velocity
volumes in trace format. In particular models which were hung
from the water bottom when created & which then need to have the
water layer added." ,
Author:
Toralf Foerster
Institut fuer Ostseeforschung Warnemuende
Sektion Marine Geologie
Seestrasse 15
D-18119 Rostock, Germany
342
343
SUSHW - Set one or more Header Words using trace number, mod and
integer divide to compute the header word values or input
the header word values from a file
Notes:
Fields that are getparred must have the same number of entries as key
words being set. Any field that is not getparred is set to the default
value(s) above. Explicitly setting j=0 will set j to ULONG_MAX.
The value of each header word key is computed using the formula:
i = itr + d
val(key) = a + b * (i % j) + c * (i / j)
where itr is the trace number (first trace has itr=0, NOT 1)
Examples:
1. set every dt field to 4ms
sushw <indata key=dt a=4000 |...
2. set the sx field of the first 32 traces to 6400, the second 32 traces
to 6300, decrementing by -100 for each 32 trace groups
...| sushw key=sx a=6400 c=-100 j=32 |...
3. set the offset fields of each group of 32 traces to 200,400,...,6400
...| sushw key=offset a=200 b=200 j=32 |...
4. perform operations 1., 2., and 3. in one call
344
..| sushw key=dt,sx,offset a=4000,6400,200 b=0,0,200 c=0,-100,0 j=0,32,32 |
In this example, we set every dt field to 4ms. Then we set the first
32 shotpoint fields to 6400, the second 32 shotpoint fields to 6300 and
so forth. Next we set each group of 32 offset fields to 200, 400, ...,
6400.
Comment:
Users wishing to edit one or more header fields (as in geometry setting)
may do this via the following sequence:
sugethw < sudata output=geom key=key1,key2 ... > hdrfile
Now edit the ASCII file hdrfile with any editor, setting the fields
appropriately. Convert hdrfile to a binary format via:
a2b < hdrfile n1=nfields > binary_file
Then set the header fields via:
sushw < sudata infile=binary_file key1 key2 ... > sudata.edited
Caveat:
If the (number of traces)*(number of key words) exceeds the number of
values in the infile then the user may still set a single header field
on the remaining traces via the parameters key=keyword a,b,c,d,j.
Example:
sushw < sudata=key1,key2 ... infile=binary_file [Optional Parameters]
345
Credits:
SEP: Einar Kajartansson
CWP: Jack K. Cohen
CWP: John Stockwell, added multiple fields and infile= options
Caveat:
All constants are cast to doubles.
346
SUSORT - sort on any segy header keywords
Example:
To sort traces by cdp gather and within each gather
by offset with both sorts in ascending order:
Credits:
SEP: Einar, Stew
CWP: Shuki, Jack
Caveats:
Since the algorithm depends on sign reversal of the key value
to obtain a descending sort, the most significant figure may
be lost for unsigned data types. The old SEP support for tape
input was removed in version 1.16---version 1.15 is in the
Portability directory for those who may want to input SU data
stored on tape.
347
SUSORTY - make a small 2-D common shot off-end
data set in which the data show geometry
values to help visualize data sorting.
Optional parameters:
nt=100 number of time samples
nshot=10 number of shots
dshot=10 shot interval (m)
noff=20 number of offsets
doff=20 offset increment (m)
Notes:
Creates a common shot su data file for sort visualization
time samples quantity
---------------- ----------
first 25% shot coord
second 25% rec coord
third 25% offset
fourth 25% cmp coord
Credits:
CWP: Chris Liner 10.09.01
Trace header fields set: ns, dt, sx, gx, offset, cdp, tracl
348
SUSPECFK - F-K Fourier SPECtrum of data set
Optional parameters:
Credits:
349
SUSPECFX - Fourier SPECtrum (T -> F) of traces
Credits:
350
SUSPECK1K2 - 2D (K1,K2) Fourier SPECtrum of (x1,x2) data set
Optional parameters:
Notes:
Because the data are assumed to be purely spatial (i.e. non-seismic),
the data are assumed to have trace id (30), corresponding to (z,x) data
Credits:
CWP: John Stockwell, 26 April 1995, based on original code by
Dave Hale and Jack Cohen
351
SUSPIKE - make a small spike data set
Optional parameters:
nt=64 number of time samples
ntr=32 number of traces
dt=0.004 time sample rate in seconds
offset=400 offset
nspk=4 number of spikes
ix1= ntr/4 trace number (from left) for spike #1
it1= nt/4 time sample to spike #1
ix2 = ntr/4 trace for spike #2
it2 = 3*nt/4 time for spike #2
ix3 = 3*ntr/4; trace for spike #3
it3 = nt/4; time for spike #3
ix4 = 3*ntr/4; trace for spike #4
it4 = 3*nt/4; time for spike #4
Credits:
CWP: Shuki Ronen, Chris Liner
352
SUSPLIT - Split traces into different output files by keyword value
Required Parameters:
none
Optional Parameters:
key=cdp Key header word to split on (see segy.h)
stem=split_ Stem name for output files
middle=key middle of name of output files
suffix=.su Suffix for output files
numlength=3 Length of numeric part of filename
verbose=0 =1 to echo filenames, etc.
close=0 =1 to close files before opening new ones
Credits:
Geocon: Garry Perratt hacked together from various other codes
353
SUSTACK - stack adjacent traces having the same key header word
Required parameters:
none
Optional parameters:
key=cdp header key word to stack on
normpow=1.0 each sample is divided by the
normpow’th number of non-zero values
stacked (normpow=0 selects no division)
repeat=0 =1 repeats the stack trace nrepeat times
nrepeat=10 repeats stack trace nrepeat times in
output file
verbose=0 verbose = 1 echos information
Notes:
------
The offset field is set to zero on the output traces, unless
the user is stacking with key=offset. In that case, the value
of the offset field is left unchanged.
Credits:
SEP: Einar Kjartansson
CWP: Jack K. Cohen, Dave Hale
CENPET: Werner M. Heigl - added repeat trace functionality
Note:
The "valxxx" subroutines are in su/lib/valpkge.c. In particular,
"valcmp" shares the annoying attribute of "strcmp" that
if (valcmp(type, val, valnew) {
...
}
354
will be performed when val and valnew are different.
355
SUSTATICRRS - Elevation STATIC corrections, apply corrections from
headers or from a source and receiver statics file,
includes application of Residual Refraction Statics
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
356
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.
Credits:
CWP: Jamie Burns
357
CWP: Modified by Timo Tjan, 29 June 1995, to include input of
source and receiver statics from files.
References:
358
SUSTATIC - Elevation static corrections, apply corrections from
headers or from a source and receiver statics file
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
=3 to read from output files of suresstat
sign=1 =-1 to subtract statics from traces(up shift)
Options when hdrs=2 and hdrs=3:
sou_file= input file for source statics (ms)
rec_file= input file for receiver statics (ms)
ns=240 number of souces
nr=335 number of receivers
no=96 number of offsets
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=3, statics are read from the output files of suresstat, with
the same options as hdrs=2 (but use no=max traces per shot and assume
that ns=max shot number and nr=max receiver number).
For each shot number (trace header fldr) and each receiver number
(trace header tracf) the program will look up the appropriate static
correction. The geometry need not be regular as each trace is treated
independently.
359
Credits:
CWP: Jamie Burns
360
SUSTKVEL - convert constant dip layer interval velocity model to the
stacking velocity model required by sunmo
Required parameters:
v= interval velocities
h= layer thicknesses at the cmp
Optional parameters:
dip=0.0 (constant) dip of the layers (degrees)
outpar=/dev/tty output parameter file in the form
required by sunmo:
tv=zero incidence time pick vector
v=stacking velocities vector
Examples:
sustkvel v=5000,6000,8000,10000 h=1000,1200,1300,1500 outpar=stkpar
sunmo <data.cdp par=stkpar >data.nmo
Note: sustkvel does not have standard su syntax since it does not
operate on seismic data. Hence stdin and stdout are not used.
Credits:
CWP: Jack
Technical Reference:
The Common Depth Point Stack
William A. Schneider
Proc. IEEE, v. 72, n. 10, p. 1238-1254
361
1984
Formulas:
Note: All sums on i are from 1 to k
From Schneider:
Let h[i] be the ith layer thickness measured at the cmp and
v[i] the ith interval velocity.
Set:
t[i] = h[i]/v[i]
t0[k] = 2 Sum t[i] * cos(dip)
vs[k] = (1.0/cos(dip)) sqrt(Sum v[i]*v[i]*t[i] / Sum t[i])
Define:
t0by2[k] = Sum h[i]/v[i]
vh[k] = Sum v[i]*h[i]
Then:
t0[k] = 2 * t0by2[k] * cos(dip)
vs[k] = sqrt(vh[k] / t0by2[k]) / cos(dip)
362
SUSTOLT - Stolt migration for stacked data or common-offset gathers
Required Parameters:
cdpmin minimum cdp (integer number) in dataset
cdpmax maximum cdp (integer number) in dataset
dxcdp distance between adjacent cdp bins (m)
Optional Parameters:
noffmix=1 number of offsets to mix (for unstacked data only)
tmig=0.0 times corresponding to rms velocities in vmig (s)
vmig=1500.0 rms velocities corresponding to times in tmig (m/s)
smig=1.0 stretch factor (0.6 typical if vrms increasing)
vscale=1.0 scale factor to apply to velocities
fmax=Nyquist maximum frequency in input data (Hz)
lstaper=0 length of side tapers (# of traces)
lbtaper=0 length of bottom taper (# of samples)
verbose=0 =1 for diagnostic print
tmpdir= if non-empty, use the value as a directory path
prefix for storing temporary files; else if the
the CWP_TMPDIR environment variable is set use
its value for the path; else use tmpfile()
Notes:
If unstacked traces are input, they should be sorted into common-offset
gathers. One common-offset gather ends and another begins when the offset
field of the trace headers changes.
The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
the cdp location expressed in units of meters or feet.
The tmig and vmig arrays specify a velocity function of time that is
used to implement Stolt’s stretch for depth-variable velocity. The
stretch factor smig is often referred to as the "W" factor.
The times in tmig must be monotonically increasing.
363
Credits:
CWP: Dave Hale
364
SUSTRIP - remove the SEGY headers from the traces
Required parameters:
none
Optional parameters:
head=/dev/null file to save headers in
Notes:
Invoking head=filename will write the trace headers into filename.
You may paste the headers back onto the traces with supaste
See: sudoc supaste for more information
Credits:
SEP: Einar Kjartansson
CWP: Jack K. Cohen
365
SUSWAPBYTES - SWAP the BYTES in SU data to convert data from big endian
to little endian byte order, and vice versa
Credits:
CWP: adapted for SU by John Stockwell
based on a code supplied by:
Institute fur Geophysik, Hamburg: Jens Hartmann (June 1993)
366
SUSYNCZ - SYNthetic seismograms for piecewise constant V(Z) function
True amplitude (primaries only) modeling for 2.5D
Required parameters:
none
Optional Parameters:
ninf=4 number of interfaces (not including upper surface)
dip=5*i dips of interfaces in degrees (i=1,2,3,4)
zint=100*i z-intercepts of interfaces at x=0 (i=1,2,3,4)
v=1500+ 500*i velocities below surface & interfaces (i=0,1,2,3,4)
rho=1,1,1,1,1 densities below surface & interfaces (i=0,1,2,3,4)
nline=1 number of (identical) lines
ntr=32 number of traces
dx=10 trace interval
tdelay=0 delay in recording time after source initiation
dt=0.004 time interval
nt=128 number of time samples
Notes:
The original purpose of this code was to create some nontrivial
data for Brian Sumner’s CZ suite.
Example:
susyncz | sufilter | sugain tpow=1 | display_program
Trace header fields set: tracl, ns, dt, delrt, ntr, sx, gx
Credits:
CWP: Brian Sumner, 1983, 1985, Fortran design and code
CWP: Stockwell & Cohen, 1995, translation to C
367
368
SUSYNLVCW - SYNthetic seismograms for Linear Velocity function
for mode Converted Waves
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)
gamma=1.0 velocity ratio, upgoing/downgoing
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
sp=1 =1 to account for amplitude spreading
=0 for constant amplitudes throught out
tmin=10.0*dt minimum time of interest (sec)
ndpfz=5 number of diffractors per Fresnel zone
verbose=0 =1 to print some useful information
Notes:
369
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.
Note that gamma<1 implies P-SV mode conversion, gamma>1 implies SV-P,
and gamma=1 implies no mode conversion.
370
SUSYNLVFTI - SYNthetic seismograms for Linear Velocity function in a
Factorized Transversely Isotropic medium
Optional Parameters:
nt=101 number of time samples
dt=0.04 time sampling interval (sec)
ft=0.0 first time (sec)
kilounits=1 input length units are km or kilo-feet
=0 for m or ft
Note: Output (sx,gx,offset) are always m or ft
nxo=1 number of source-receiver offsets
dxo=0.05 offset sampling interval (kilounits)
fxo=0.0 first offset (kilounits, 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 (kilounits)
fxm=0.0 first midpoint (kilounits)
nxs=101 number of shotpoints (see notes below)
dxs=0.05 shotpoint sampling interval (kilounits)
fxs=0.0 first shotpoint (kilounits)
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 (kilounits/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=0 =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
371
Alternately use Tompson\’s parameters:
delta=0 Thomsen’s 1986 defined parameter
epsilon=0 Thomsen’s 1986 defined parameter
ntries=40 number of iterations in Snell’s law and offset searches
epsx=.001 lateral offset tolerance
epst=.0001 reflection time tolerance
nitmax=12 max number of iterations in travel time integrations
Notes:
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.
Concerning the choice of delta and epsilon. The difference between delta",
and epsilon should not exceed one. A possible break down of the program
is the result. This is caused primarly by the break down in the two point",
ray-tracing. Also keep the values of delta and epsilon between 2 and -2.
372
SUSYNLV - SYNthetic seismograms for Linear Velocity function
Optional Parameters:
nt=101 number of time samples
dt=0.04 time sampling interval (sec)
ft=0.0 first time (sec)
kilounits=1 input length units are km or kilo-feet
=0 for m or ft
Note: Output (sx,gx,offset) are always m or ft
nxo=1 number of source-receiver offsets
dxo=0.05 offset sampling interval (kilounits)
fxo=0.0 first offset (kilounits, 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 (kilounits)
fxm=0.0 first midpoint (kilounits)
nxs=101 number of shotpoints (see notes below)
dxs=0.05 shotpoint sampling interval (kilounits)
fxs=0.0 first shotpoint (kilounits)
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 (kilounits/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=0 =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.
373
More than one ref (reflector) may be specified. Do this by putting
additional ref= entries on the commandline. 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.
374
SUSYNVXZCS - SYNthetic seismograms of common shot in V(X,Z) media via
Kirchhoff-style modeling
Required Parameters:
<vfile file containing velocities v[nx][nz]
>outfile file containing seismograms of common ofset
nx= number of x samples (2nd dimension) in velocity
nz= number of z samples (1st dimension) in velocity
Optional Parameters:
nt=501 number of time samples
dt=0.004 time sampling interval (sec)
ft=0.0 first time (sec)
fpeak=0.2/dt peak frequency of symmetric Ricker wavelet (Hz)
nxg= number of receivers of input traces
dxg=15 receiver sampling interval (m)
fxg=0.0 first receiver (m)
nxd=5 skipped number of receivers
nxs=1 number of offsets
dxs=50 shot sampling interval (m)
fxs=0.0 first shot (m)
dx=50 x sampling interval (m)
fx=0. first x sample (m)
dz=50 z sampling interval (m)
nxb=nx/2 band width centered at midpoint (see note)
nxc=0 hozizontal range in which velocity is changed
nzc=0 vertical range in which velocity is changed
pert=0 =1 calculate time correction from v_p[nx][nz]
vpfile file containing slowness perturbation array v_p[nx][nz]
ref="1:1,2;4,2" reflector(s): "amplitude:x1,z1;x2,z2;x3,z3;...
smooth=0 =1 for smooth (piecewise cubic spline) reflectors
ls=0 =1 for line source; =0 for point source
tmin=10.0*dt minimum time of interest (sec)
ndpfz=5 number of diffractors per Fresnel zone
verbose=0 =1 to print some useful information
Notes:
This algorithm is based on formula (58) in Geo. Pros. 34, 686-703,
by N. Bleistein.
375
is done only in one of every NXD receivers; in skipped receivers,
interpolation is used to calculate traveltime and amplitude. ",
For each receiver, traveltime and amplitude are calculated in the
horizontal range of (xg-nxb*dx, xg+nxb*dx). Velocity is changed by
constant extropolation in two upper trianglar corners whose width is
nxc*dx and height is nzc*dz.
376
SUSYNVXZ - SYNthetic seismograms of common offset V(X,Z) media via
Kirchhoff-style modeling
Required Parameters:
<vfile file containing velocities v[nx][nz]
nx= number of x samples (2nd dimension)
nz= number of z samples (1st dimension)
Optional Parameters:
nxb=nx band centered at midpoint
nxd=1 skipped number of midponits
dx=100 x sampling interval (m)
fx=0.0 first x sample
dz=100 z sampling interval (m)
nt=101 number of time samples
dt=0.04 time sampling interval (sec)
ft=0.0 first time (sec)
nxo=1 number of offsets
dxo=50 offset sampling interval (m)
fxo=0.0 first offset (m)
nxm=101 number of midpoints
dxm=50 midpoint sampling interval (m)
fxm=0.0 first midpoint (m)
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
ls=0 =1 for line source; default is point source
tmin=10.0*dt minimum time of interest (sec)
ndpfz=5 number of diffractors per Fresnel zone
verbose=0 =1 to print some useful information
Notes:
This algorithm is based on formula (58) in Geo. Pros. 34, 686-703,
by N. Bleistein.
377
reflector amplitude: preceding the x,z coordinates of each reflector.
Default amplitude is 1.0 if amplitude: part of the string is omitted.
378
SUTAB - print non zero header values and data for non-graphic terminals
Required parameters:
none
Optional parameters:
itmin=0 first time sample (zero-based) to plot
itmax= (last sample) last time sample (zero-based) to plot
count= (all traces) number of traces to plot
Example:
sutab <DATA itmin=32 itmax=63 count=10
Requests tab plot of samples 32 to 63 on the first 10 traces of DATA.
Credits:
CWP: Shuki Ronen, Jack K. Cohen
379
SUTAPER - Taper the edge traces of a data panel to zero.
Optional Parameters:
ntr=tr.ntr number of traces. If tr.ntr is not set, then
ntr is mandatory
tr1=0 number of traces to be tapered at beginning
tr2=tr1 number of traces to be tapered at end
min=0. minimum amplitude factor of taper
tbeg=0 length of taper (ms) at trace start
tend=0 length of taper (ms) at trace end
taper=1 taper type
=1 linear (default)
=2 sine
=3 cosine
=4 gaussian (+/-3.8)
=5 gaussian (+/-2.0)
Notes:
To eliminate the taper, choose tbeg=0. and tend=0. and tr1=0
Credits:
380
SUTAUP - forwared and inverse T-X and F-K global slant stacks
Optional Parameters:
option=1 =1 for forward F-K domian computation
=2 for forward T-X domain computation
=3 for inverse F-K domain computation
=4 for inverse T-X domain computation
dt=tr.dt (from header) time sampling interval (secs)
nx=ntr (counted from data) number of horizontal samples (traces)
dx=1 horizontal sampling interval (m)
npoints=71 number of points for rho filter
pmin=0.0 minimum slope for Tau-P transform (s/m)
pmax=1/500 maximum slope for Tau-P transform (s/m)
np=nx number of slopes for Tau-P transform
ntau=nt number of time samples in Tau-P domain
fmin=3 minimum frequency of interest
Notes:
The cascade of a forward and inverse tau-p transform preserves the
relative amplitudes in a data panel, but not the absolute amplitudes
meaning that a scale factor must be applied to data output by such a
a cascade before the output may be compared to the original data.
This is a characteristic of the algorithm employed in this program.
(Suradon does not have this problem.)
Reference:
Levin, F., editor, 1991, Slant-Stack Processing, Geophysics Reprint
Series #14, SEG Press, Tulsa.
381
Trace header fields modified: dt,d2,f2
382
SUTIFOWLER VTI constant velocity prestack time migration
velocity analysis via Fowler’s method
Required Parameter:
ncdps= number of input cdp’s
Optional Parameters:
choose=1 1 do full prestack time migration
2 do only DMO
3 do only post-stack migrations
4 do only stacking velocity analysis
getcvstacks=0 flag to set to 1 if inputting precomputed cvstacks
(vmin, nvstack, and ncdps must match SUCVS4FOWLER job)
vminstack=vmin minimum velocity panel in m/s in input cvstacks
etamin=0. minimum eta (see paper by Tariq Alkhalifah)
etamax=0.5 maximum eta (see paper by Tariq Alkhalifah)
neta=1 number of eta values to image
d=0. Thomsen’s delta
vpvs=0.5 assumed vp/vs ratio (not critical -- default almost always ok)
dx=25. cdp x increment
vmin=1500. minimum velocity panel in m/s to output
vmax=8000. maximum velocity panel in m/s to output
nv=75 number of velocity panels to output
nvstack=180 number of stacking velocity panels to compute
( Let offmax be the maximum offset, fmax be
the maximum freq to preserve, and tmute be
the starting mute time in sec on offmax, then
the recommended value for nvstack would be
nvstack = 4 +(offmax*offmax*fmax)/(0.6*vmin*vmin*tmute)
---you may want to make do with less---)
nxpad=0 number of traces to padd for spatial fft
Ideally nxpad = (0.5*tmax*vmax+0.5*offmax)/dx
lmute=24 length of mute taper in ms
nonhyp=1 1 if do mute at 2*offset/vmin to avoid non-hyperbolic
moveout, 0 otherwise
lbtaper=0 length of bottom taper in ms
lstaper=0 length of side taper in traces
dtout=1.5*dt output sample rate in s, note: typically
fmax=salias*0.5/dtout
mxfold=120 maximum number of offsets/input cmp
salias=0.8 fraction of output frequencies to force within sloth
antialias limit. This controls muting by offset of
383
the input data prior to computing the cv stacks
for values of choose=1 or choose=2.
file=sutifowler root name for temporary files
p=not Enter a path name where to put temporary files.
specified Can enter multiple times to use multiple disk
systems.
The default uses information from the .VND file
in the current directory if it exists, or puts
unique temporary files in the current directory.
ngroup=20 Number of cmps per velocity analysis group.
printfile=stderr The output file for printout from this program.
Required trace header words on input are ns, dt, cdp, offset.
On output, trace headers are rebuilt from scratch with
ns - number of samples
dt - sample rate in usec
cdp - the output cmp number (0 based)
offset - the output velocity
tracf - the output velocity index (0 based)
fldr - index for velocity analysis group (0 based, groups of ngroup cdps)
ep - central cmp for velocity analysis group
igc - index for choice of eta (0 based)
igi - eta*100
sx=gx - x coordinate as icmp*dx
tracl=tracr -sequential trace count (1 based)
Note: The temporary files can be split over multiple disks by building
a .VND file in your working directory. The .VND file is ascii text
with the first line giving the number of directories followed by
successive lines with one line per directory name.
Note: The output data order has primary key equal to cdp, secondary
key equal to eta, and tertiary key equal to velocity.
Credits:
CWP: John Anderson (visitor to CSM from Mobil) Spring 1993
384
385
SUTIHALEDMO - TI Hale Dip MoveOut (based on Hale’s PhD thesis)
Required Parameters:
nxmax maximum number of midpoints in common offset gather
Optional Parameters:
option=1 1 = traditional Hale DMO (from PhD thesis)
2 = Bleistein’s true amplitude DMO
3 = Bleistein’s cos*cos weighted DMO
4 = Zhang’s DMO
5 = Tsvankin’s anisotropic DMO
6 = Tsvankin’s VTI DMO weak anisotropy approximation
dx=50. midpoint sampling interval between traces
in a common offset gather. (usually shot
interval in meters)
v=1500.0 velocity (in meters/sec)
(must enter a positive value for option=3)
(for excluding evanescent energy)
h=200.0 source-receiver half-offset (in meters)
ntpad=0 number of time samples to pad
nxpad=h/dx number of midpoints to pad
file=vnmo name of file with vnmo as a function of p
used for option=5--otherwise not used
(Generate this file by running program
sutivel with appropriate list of Thomsen’s
parameters.)
e=0. Thompsen’s epsilon
d=0. Thompsen’s delta
Note:
386
Test run: suspike | sutihaledmo nxmax=32 option=1 v=1500 | suxwigb &
387
SUTIVEL - SU Transversely Isotropic velocity table builder
computes vnmo or vphase as a function of Thomsen’s parameters and
theta and optionally interpolate to constant increments in slowness
Optional Parameters:
a=2500. alpha (vertical p velocity)
b=1250. beta (vertical sv velocity)
e=.20 epsilon (horiz p-wave anisotropy)
d=.10 delta (strange parameter)
maxangle=90.0 max angle in degrees
nangle=9001 number of angles to compute
verbose=0 set to 1 to see full listing
np=8001 number of slowness values to output
option=1 1=output vnmo(p) (result used for TI DMO)
2=output vnmo(theta) in degrees
3=output vnmo(theta) in radians
4=output vphase(p)
5=output vphase(theta) in degrees
6=output vphase(theta) in radians
7=output first derivative vphase(p)
8=output first derivative vphase(theta) in degrees
9=output first derivative vphase(theta) in radians
10=output second derivative vphase(p)
11=output second derivative vphase(theta) in degrees
12=output second derivative vphase(theta) in radians
13=( 1/vnmo(0)^2 -1/vnmo(theta)^2 )/p^2 test vs theta
(result should be zero for all theta for d=e)
14=return vnmo(p) for weak anisotropy
normalize=0 =1 means scale vnmo by cosine and scale vphase by
1/sqrt(1+2*e*sin(theta)*sin(theta)
(only useful for vphase when d=e for constant
result)
=0 means output vnmo or vphase unnormalized
388
SUTSQ -- time axis time-squared stretch of seismic traces
Required parameters:
none
Optional parameters:
tmin= .1*nt*dt minimum time sample of interest
(only needed for forward transform)
dt= .004 output sample rate
(only needed for inverse transform)
flag= 1 1=forward transform: time to time squared
-1=inverse transform: time squared to time
Caveats:
Amplitudes are not well preserved.
389
SUTTOZ - resample from time to depth
Optional Parameters:
nz=1+(nt-1)*dt*vmax/(2.0*dz) number of depth samples in output
dz=vmin*dt/2 depth sampling interval (defaults avoids aliasing)
fz=v(ft)*ft/2 first depth sample
t=0.0,... times corresponding to interval velocities in v
v=1500.0,... interval velocities corresponding to times in v
vfile= binary (non-ascii) file containing velocities v(t)
verbose=0 >0 to print depth sampling information
Notes:
Default value of nz set to avoid aliasing
The t and v arrays specify an interval velocity function of time.
Credits:
CWP: Dave Hale c. 1992
390
SUTVBAND - time-variant bandpass filter (sine-squared taper)
Required parameters:
dt = (from header) time sampling interval (sec)
tf= times for which f-vector is specified
f=f1,f2,f3,f4 Corner frequencies corresponding to the
times in tf. Specify as many f= as
there are entries in tf.
Example:
sutvband <data tf=.2,1.5 f=10,12.5,40,50 f=10,12.5,30,40 | ...
Credits:
CWP: Jack, Ken
391
SUTXTAPER - TAPER in (X,T) the edges of a data panel to zero.
Optional Parameters:
low=0. minimum amplitude factor of taper
tbeg=0 length of taper (ms) at trace start
tend=0 length of taper (ms) at trace end
taper=1 taper type
=1 linear (default)
=2 sine
=3 cosine
=4 gaussian (+/-3.8)
=5 gaussian (+/-2.0)
key=tr set key to compute x-domain taper weights
default is using internal tracecount (tr)
tr1=0 number of traces to be tapered at beg (key=tr)
tr2=tr1 number of traces to be tapered at end (key=tr)
Notes:
Taper type is used for trace (x-domain) tapering as well
as for time domain tapering.
The taper is applied to all traces <tr1 (or key<min) and
>tr2 (or key >max) and all time samples <tbeg and >tend.
Taper weights are amp*1 for traces n tr1<n<tr2 and computed
for all other traces corresponding to the taper typ.
If key is given the taper length is defined by dx, otherwise
the length of taper is tr1 and (ntr-tr2) respectively.
To eliminate the taper, choose tbeg=0. and tend=0. and tr1=0
If key is set, min,max values take precedence over tr1,tr2.
392
Rewrite: Tagir Galikeev, October 2002
Rewrite: Gerald Klein, IFM-GEOMAR, April 2004
393
SUUNPACK1 - unpack segy trace data from chars to floats
Credits:
CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner
Caveats:
This program is for single site use with supack1. See the
supack1 header comments.
Notes:
ungpow and unscale are defined in segy.h
trid = CHARPACK is defined in su.h and segy.h
394
SUUNPACK2 - unpack segy trace data from shorts to floats
Credits:
CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner
Caveats:
This program is for single site use with supack2. See the
supack2 header comments.
Notes:
ungpow and unscale are defined in segy.h
trid = SHORTPACK is defined in su.h and segy.h
395
SUUTM - UTM projection of longitude and latitude in SU trace headers
Optional parameters:
counit=(from header) input coordinate units code:
=1: length (meters or feet; no UTM projection)
=2: seconds of arc
=3: decimal degrees
=4: degrees, minutes, seconds
idx=23 reference ellipsoid index (default is WGS 1984)
a=(from idx) user-specified semimajor axis of ellipsoid
f=(from idx) user-specified flattening of ellipsoid
zkey= if set, header key to store UTM zone number
verbose=0 =1: echo ellipsoid parameters
Notes:
Universal Transverse Mercator (UTM) coordinates are defined between
latitudes 80S (-80) and 84N (84). Longitude values must be between
-180 degrees (west) and 179.999... degrees (east).
Reference ellipsoids:
An ellipsoid may be specified by its semimajor axis a and its
flattening f, or one of the following ellipsoids may be selected
by its index idx (semimajor axes in meters):
0 Sphere with radius of 6371000 m
1 Airy 1830
2 Australian National 1965
3 Bessel 1841 (Ethiopia, Indonesia, Japan, Korea)
4 Bessel 1841 (Namibia)
5 Clarke 1866
396
6 Clarke 1880
7 Everest (Brunei, E. Malaysia)
8 Everest (India 1830)
9 Everest (India 1956)
10 Everest (Pakistan)
11 Everest (W. Malaysia, Singapore 1948)
12 Everest (W. Malaysia 1969)
13 Geodetic Reference System 1980 (GRS 1980)
14 Helmert 1906
15 Hough 1960
16 Indonesian 1974
17 International 1924 / Hayford 1909
18 Krassovsky 1940
19 Modified Airy
20 Modified Fischer 1960
21 South American 1969
22 World Geodetic System 1972 (WGS 1972)
23 World Geodetic System 1984 (WGS 1984) / NAD 1983
UTM grid:
The Universal Transverse Mercator (UTM) system is a world wide
coordinate system defined between 80S and 84N. It divides the
Earth into 60 six-degree zones. Zone number 1 has its central
meridian at 177W (-177 degrees), and numbers increase eastward.
Author:
397
Nils Maercklin, RISSC, University of Naples, Italy, March 2007
References:
NIMA (2000). Department of Defense World Geodetic System 1984 -
its definition and relationships with local geodetic systems.
Technical Report TR8350.2. National Imagery and Mapping Agency,
Geodesy and Geophysics Department, St. Louis, MO. 3rd edition.
J. P. Snyder (1987). Map Projections - A Working Manual.
U.S. Geological Survey Professional Paper 1395, 383 pages.
U.S. Government Printing Office.
Trace header fields accessed: sx, sy, gx, gy, scalco, counit
Trace header fields modified: sx, sy, gx, gy, scalco, counit
398
SUVCAT - append one data set to another, with or without an ",
overlapping region. Data in the overlap may be
determined by one of several methods.
Required parameters:
none
Computational Notes:
399
Credits:
CWP: Jack K. Cohen, Michel Dietrich (Original SUVCAT)
Steven D. Sheaffer (modifed to include overlap)
IfG Kiel: Thies Beilecke (added taptype=3)
400
SUVEL2DF - compute stacking VELocity semblance for a single time in
over Vnmo and eta in 2-D
Required Parameters:
tn zero-offset time of reflection
offsetm Maximum offset considerd
Optional Parameters:
nv=50 number of velocities
dv=50.0 velocity sampling interval
fv=1500.0 first velocity
nvh=50 number of horizotal velocities
dvh=50.0 horizontal velocity sampling interval
fvh=1500.0 first horizontal velocity
xod=1.5 maximum offset-to-depth ratio to resolve
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
vavg=fv+0.5*(nv-1)*dv average velocity used in the search
Notes:
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
Credits:
401
CWP: Tariq Alkhalifah, February 1997
Trace header fields accessed: ns, dt, delrt, offset, cdp.
Trace header fields modified: ns, dt, offset.
402
SUVELAN_NCCS - compute stacking VELocity panel for cdp gathers
using Normalized CrossCorrelation Sum
Optional Parameters:
nx=tr.cdpt number of traces in cdp
nv=50 number of velocities
dv=50.0 velocity sampling interval
fv=1500.0 first velocity
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 smoothing window
verbose=0 =1 for diagnostic print on stderr
pwr=1.0 semblance value to the power
Notes:
Normalized CrossCorrelation sum: sum all possible crosscorrelation
trace pairs in a CMP gather for each trial velocity and zero-offset
two-way travel time inside a time window. This coherence measure is
normalized by dividing each crosscorrelation trace pair by the geometric
mean of the energy, inside the chosen time window, of each trace pair
involved in each crosscorrelation. Then, to achieve a maximum amplitude
of unity, the result is multiplied by 2/(M(M-1)), which is the inverse
of the total number of crosscorrelation. The normalization allows to
bring out weak reflection as long as these reflections have moveouts close
to a hyperbola.
Credits:
Trace header fields accessed: ns, dt, delrt, offset, cdp, cdpt
Trace header fields modified: ns, dt, offset, cdp
403
404
SUVELAN_NSEL - compute stacking VELocity panel for cdp gathers
using the Normalized Selective CrossCorrelation sum
Optional Parameters:
nx=tr.cdpt number of traces in cdp
dx=tr.d2 offset increment
nv=50 number of velocities
dv=100.0 velocity sampling interval
fv=1500.0 first velocity
tau=0.5 threshold for significance values
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 smoothing window
verbose=0 =1 for diagnostic print on stderr
pwr=1.0 semblance value to the power
Notes:
Normalized Selective CrossCorrelation Sum: is based on the coherence
measure known as crosscorrelation sum. The difference is that the selective
approach sum only crosscorrelation pairs with relatively large differential
moveout, thus increasing the resolving power in the velocity spectra
compared to that achieved by conventional methods. The normalization is
achieved in much the same way of normalizing the conventional
crosscorrelation sum.
That threshold is the parameter tau in this program, which varies between 0
to 1. A value of tau=0, means conventional crosscorrelation sum is applied
implying that all crosscorrelations are included in the sum. In contrast,
a value of tau=1 (not recomended) means that only the crosscorrelation
formed by the trace pair involving the shortest and longest offset is
included in the sum. Intermediate values will produce percentages of the
crosscorrelations included in the sum that will be shown in the screen
before computing the velocity spectra. Typical values for tau are between
0.2 and 0.6, producing approximated percentages of crosscorrelations summed
405
between 60% and 20%. The higher the value of tau the lower the percentage
and higher the increase in the resolving power of velocity spectra.
References:
Neidell, N.S., and Taner, M.T., 1971, Semblance and other
coherency measures for multichannel data: Geophysics, 36, 498-509.
Celis, V. T., 2002, Selective-correlation velocity analysis: CSM thesis.
406
SUVELAN - compute stacking velocity semblance for cdp gathers
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.
n-1
[ sum q(t,j) ]^2
j=0
s(t) = ------------------
n-1
n sum [q(t,j)]^2
407
j=0
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.
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)
408
SUVELAN_UCCS - compute stacking VELocity panel for cdp gathers
using UnNormalized CrossCorrelation Sum
Optional Parameters:
nx=tr.cdpt number of traces in cdp
nv=50 number of velocities
dv=50.0 velocity sampling interval
fv=1500.0 first velocity
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 smoothing window
verbose=0 =1 for diagnostic print on stderr
pwr=1.0 semblance value to the power
Notes:
Unnormalized crosscorrelation sum: sum all possible crosscorrelation trace
pairs in a CMP gather for each trial velocity and zero-offset two-way
travel time inside a time window. This unnormalized coherency measure
produces large spectral amplitudes for strong reflections and small
spectral amplitudes for weaker ones. If M is the number of traces in the
CMP gather M(M-1)/2 is the total number of crosscorrelations for each trial
velocity and zero-offset two-way traveltime.
Reference: Neidell, N.S., and Taner, M.T., 1971, Semblance and other
coherency measures for multichannel data: Geophysics, 36, 498-509.
409
SUVELAN_USEL - compute stacking velocity panel for cdp gathers
using the UnNormalized Selective CrossCorrelation Sum
Optional Parameters:
nx=tr.cdpt number of traces in cdp
dx=tr.d2 offset increment
nv=50 number of velocities
dv=50.0 velocity sampling interval
fv=1500.0 first velocity
tau=0.5 threshold for significance values
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 smoothing window
verbose=0 =1 for diagnostic print on stderr
pwr=1.0 semblance value to the power
Notes:
UnNormalized Selective CrossCorrelation sum: is based on the coherence
measure known as crosscorrelation sum. The difference is that the selective
approach sum only crosscorrelation pairs with relatively large differential
moveout, thus increasing the resolving power in the velocity spectra
compared to that achieved by conventional methods. The selection is made
using a parabolic approximation of the differential moveout and imposing a
threshold for those differential moveouts.
That threshold is the parameter tau in this program, which varies between
0 to 1. A value of tau=0, means conventional crosscorrelation sum is
applied implying that all crosscorrelations are included in the sum. In
contrast, a value of tau=1 (not recomended) means that only the
crosscorrelation formed by the trace pair involving the shortest and longest
offset is included in the sum. Intermediate values will produce percentages
of the crosscorrelations included in the sum that will be shown in the
screen before computing the velocity spectra. Typical values for tau are
between 0.2 and 0.6, producing approximated percentages of crosscorrelations
summed between 60% and 20%. The higher the value of tau the lower the
percentage and higher the increase in the resolving power of velocity
spectra.
410
recomended to mantaing the percentage of crosscorrelations included in the
sum above 25%. After computing the velocity spectra one might want to
adjust the level and number of contours before velocity picking.
References:
Neidell, N.S., and Taner, M.T., 1971, Semblance and other coherency
measures for multichannel data: Geophysics, 36, 498-509.
Celis, V. T., 2002, Selective-correlation velocity analysis: CSM thesis.
411
SUVIBRO - Generates a Vibroseis sweep (linear, linear-segment,
dB per Octave, dB per Hertz, T-power)
Optional Parameters:
dt=0.004 time sampling interval
sweep=1 linear sweep
=2 linear-segment
=3 decibel per octave
=4 decibel per hertz
=5 t-power
swconst=0.0 sweep constant (see note)
f1=10.0 sweep frequency at start
f2=60.0 sweep frequency at end
tv=10.0 sweep length
phz=0.0 initial phase (degrees)
fseg=10.0,60.0 frequency segments (see notes)
tseg=0.0,10.0 time segments (see notes)
t1=1.0 length of taper at start (see notes)
t2=1.0 length of taper at end (see notes)
taper=1 linear
=2 sine
=3 cosine
=4 gaussian (+/-3.8)
=5 gaussian (+/-2.0)
Notes:
The default tapers are linear envelopes. To eliminate the
taper, choose t1=t2=0.0.
Trace header fields set: ns, dt, tracl, sfs, sfe, slen, styp
412
SUVLENGTH - Adjust variable length traces to common length
Required parameters:
none
Optional parameters:
ns output number of samples (default: 1st trace ns)
413
SUWAVEFORM - generate a seismic wavelet
Required parameters:
one of the optional parameters listed below
Optional parameters:
type=akb wavelet type
akb: AKB wavelet defined by max frequency fpeak
berlage: Berlage wavelet
gauss: Gaussian wavelet defined by frequency fpeak
gaussd: Gaussian first derivative wavelet
ricker1: Ricker wavelet defined by frequency fpeak
ricker2: Ricker wavelet defined by half and period
spike: spike wavelet, shifted by time tspike
unit: unit wavelet, i.e. amplitude = 1 = const.
Notes:
If ns is not defined, the program determines the trace length
depending on the dominant signal period.
414
The Ricker wavelets can be defined either by the peak frequency
fpeak ("ricker1") or by its half-length, the period, and a
distortion factor ("ricker2"). "ricker" is an acceptable
alias for "ricker1".
Example:
A normalized, zero-phase Ricker wavelet with a peak frequency
of 15 Hz is generated and convolved with a spike dataset:
suwaveform type=ricker1 fpeak=15 | sugain pbal=1 > wavelet.su
suplane npl=1 | suconv sufile=wavelet.su | suxwigb
Caveat:
This program does not check for aliasing.
Author:
Nils Maercklin, RISSC, University of Napoli, Italy, 2006
References:
Aldridge, D. F. (1990). The Berlage wavelet.
Geophysics, vol. 55(11), p. 1508-1511.
Alford, R., Kelly, K., and Boore, D. (1947). Accuracy
of finite-difference modeling of the acoustic wave
equation. Geophysics, vol. 39, p. 834-842. (AKB wavelet)
Sheriff, R. E. (2002). Encyclopedic dictionary of
applied geophysics. Society of Exploration Geophysicists,
Tulsa. (Ricker wavelet, page 301)
415
Notes:
For more information on the wavelets type "sudoc waveforms"
or have a look at "$CWPROOT/src/cwp/lib/waveforms.c".
Credits:
CWP, the authors of the subroutines in "waveforms.c".
416
SUWEIGHT - weight traces by header parameter, such as offset
Required Parameters:
<none>
Optional parameters:
key=offset keyword of header field to weight traces by
a=1.0 constant weighting parameter (see notes below)
b=.0005 variable weighting parameter (see notes below)
Notes:
This code is initially written with offset weighting in mind, but may
be used for other, user-specified schemes.
If key2= header field is set then this program uses the weighting
values read from that header field, instead. Note, that because most
header fields are integers, the scale=.0001 permits 10001 in the header
to represent 1.0001.
Credits:
Author: CWP: John Stockwell February 1999.
Written for Chris Walker of UniqueStep Ltd., Bedford, U.K.
inv option added by Garry Perratt (Geocon).
417
header fields accessed: ns, keyword
418
SUWELLRF - convert WELL log depth, velocity, density data into a
uniformly sampled normal incidence Reflectivity Function of time
Required Parameters:
dvrfile= file containing depth, velocity, and density values
...or...
dvfile= file containing depth and velocity values
drfile= file containing depth and density values
...or...
dfile= file containing depth values
vfile= file containing velocity log values
rhofile= file containing density log values
nval= number of triplets of d,v,r values if dvrfile is set,
number of pairs of d,v and d,r values dvfile and drfile
are set, or number of values if dfile, vfile, and rhofile
are set.
Optional Parameters:
dtout=.004 desired time sampling interval (sec) in output
ntr=1 number of traces to output
Notes:
The format of the input file(s) is C-style binary float. These files
may be constructed from ascii file via:
419
Caveat:
This program is really only a first rough attempt at creating a well
log utility. User input and modifications are welcome.
420
SUWIND - window traces by key word
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
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 overrides the accept
parameter, so you can’t specify count if you want true
unconditional acceptance.
421
The skip= option allows the user to skip over traces, which helps
for selecting traces far from the beginning of the dataset.
Caveat: skip only works with disk input.
The ordered= option will speed up the process if the data are
sorted in according to the key.
The accept option is a bit strange--it does NOT mean accept ONLY
the traces on the accept list! It means accept these traces,
even if they would otherwise be rejected (except as noted in the
previous paragraph). To implement accept-only, you can use the
max=0 option (rejecting everything). For example, to accept
only the tracl values 4, 5 and 6:
... | suwind max=0 accept=4,5,6 | ...
Credits:
SEP: Einar Kjartansson
422
CWP: Shuki Ronen, Jack Cohen, Chris Liner
Warnemuende: Toralf Foerster
CENPET: Werner M. Heigl (modified to include well log data)
423
SUXCOR - correlation with user-supplied filter
Optional parameters:
vibroseis=0 =nsout for correlating vibroseis data
first=1 supplied trace is default first element of
correlation. =0 for it to be second.
panel=0 use only the first trace of sufile as filter
=1 xcor trace by trace an entire gather
ftwin=0 first sample on the first trace of the window
(only with panel=1)
ltwin=0 first sample on the last trace of the window
(only with panel=1)
ntwin=nt number of samples in the correlation window
(only with panel=1)
ntrc=48 number of traces on a gather
(only with panel=1)
Examples:
suplane | suwind min=12 max=12 >TRACE
suxcor<DATA sufile=TRACE |...
Here, the su data file, "DATA", is correlated trace by trace with the
the single su trace, "TRACE".
424
Correlating vibroseis data with a vibroseis sweep:
suxcor < data sufile=sweep vibroseis=nsout |...
or
suxcor < data sufile=sweep |
suwind itmin=nsweep itmax=nsweep+nsout | sushw key=delrt a=0.0 |...
Credits:
CWP: Jack K. Cohen, Michel Dietrich
CWP: modified by Ttjan to include cross correlation of panels
permitting spatially and temporally varying cross correlation.
UTK: modified by Rick Williams for vibroseis correlation option.
CAVEATS:
In the option, panel=1 the number of traces in the sufile must be
the same as the number of traces on the input.
425
Trace header fields modified: ns
426
SUXEDIT - examine segy diskfiles and edit headers
Credits:
SEP: Einar Kjartansson, Shuki Ronen, Stew Levin
CWP: Jack K. Cohen
427
SUZERO -- zero-out (or set constant) data within a time window
Required parameters
itmax= last time sample to zero out
Optional parameters
itmin=0 first time sample to zero out
value=0 value to set
Credits:
CWP: Chris
Geocon: Garry Perratt (added value= option)
428
SUZTOT - resample from depth to time
Optional Parameters:
nt=1+(nz-1)*2.0*dz/(vmax*dt) number of time samples in output
dt=2*dz/vmin time sampling interval (defaults avoids aliasing)
ft=2*fz/v(fz) first time sample
z=0.0,... depths corresponding to interval velocities in v
v=1500.0,... interval velocities corresponding to depths in v
vfile= binary (non-ascii) file containing velocities v(z)
verbose=0 >0 to print depth sampling information
Notes:
Default value of nt set to avoid aliasing
The z and v arrays specify an interval velocity function of depth.
Credits:
CWP: John Stockwell, 2005,
based on suttoz.c written by Dave Hale c. 1992
429
SUPSCONTOUR - PostScript CONTOUR plot of a segy data set
Optional parameters:
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2
Credits:
430
CWP: Dave Hale and Zhiming Li (pscontour, etc.)
Jack Cohen and John Stockwell (supscontour, etc.)
Delphi: Alexander Koek, added support for irregularly spaced traces
Aarhus University: Morten W. Pedersen copied everything from the xwigb
source and just replaced all occurencies of the word
Notes:
When the number of traces isn’t known, we need to count
the traces for pscontour. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
431
SUPSCUBECONTOUR - PostScript CUBE plot of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
432
Credits:
Notes:
When n2 isn’t getparred, we need to count the traces
for pscube. Although we compute ntr, we don’t allocate a 2-d array
and content ourselves with copying trace by trace from
the data "file" to the pipe into the plotting program.
Although we could use tr.data, we allocate a trace buffer
for code clarity.
433
SUPSCUBE - PostScript CUBE plot of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
434
Credits:
Notes:
When n2 isn’t getparred, we need to count the traces
for pscube. Although we compute ntr, we don’t allocate a 2-d array
and content ourselves with copying trace by trace from
the data "file" to the pipe into the plotting program.
Although we could use tr.data, we allocate a trace buffer
for code clarity.
435
SUPSGRAPH - PostScript GRAPH plot of a segy data set
Optional parameters:
style=seismic seismic is default here, =normal is alternate
(see psgraph selfdoc for style definitions)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
Credits:
436
CWP: Dave Hale and Zhiming Li (pswigp, etc.)
Jack Cohen and John Stockwell (supswigp, etc.)
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigp. You can make this value "known"
either by getparring nplot or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
437
SUPSIMAGE - PostScript IMAGE plot of a segy data set
Optional parameters:
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2
Credits:
438
CWP: Dave Hale and Zhiming Li (psimage, etc.)
Jack Cohen and John Stockwell (supsimage, etc.)
Notes:
When the number of traces isn’t known, we need to count
the traces for psimage. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
439
SUPSMAX - PostScript of the MAX, min, or absolute max value on each trace
of a SEGY (SU) data set
Optional parameters:
mode=max max value
=min min value
=abs absolute max value
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
440
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for psgraph. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
441
SUPSMOVIE - PostScript MOVIE plot of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
442
Credits:
Notes:
When n2 isn’t getparred, we need to count the traces
for psmovie. In this case:
we are using tmpfile because on many machines it is
implemented as a memory area instead of a disk file.
Although we compute ntr, we don’t allocate a 2-d array
and content ourselves with copying trace by trace from
the data "file" to the pipe into the plotting program.
Although we could use tr.data, we allocate a trace buffer
for code clarity.
443
SUPSWIGB - PostScript Bit-mapped WIGgle plot of a segy data set
Optional parameters:
key=(keyword) if set, the values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
This program is really just a wrapper for the plotting program: pswigb
See the pswigb selfdoc for the remaining parameters.
444
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2, keyword (if set)
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigb. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
445
SUPSWIGP - PostScript Polygon-filled WIGgle plot of a segy data set
Optional parameters:
key=(keyword) if set, values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
This program is really just a wrapper for the plotting program: pswigp
See the pswigp selfdoc for the remaining parameters.
446
On NeXT: supswigp < infile [optional parameters] | open
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2, key specified by key
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigp. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
447
SUXCONTOUR - X CONTOUR plot of Seismic UNIX tracefile via vector plot call
Optional parameters:
key=(keyword) if set, the values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
This program is really just a wrapper for the plotting program: xcontour
See the xcontour selfdoc for the remaining parameters.
Credits:
448
CWP: Dave Hale and Zhiming Li (xwigb, etc.)
Jack Cohen and John Stockwell (suxwigb, etc.)
Delphi: Alexander Koek, added support for irregularly spaced traces
Aarhus University: Morten W. Pedersen copied everything from the xwigb
source and just replaced all occurencies of the word
xwigb with xcountour ;-)
Notes:
When the number of traces isn’t known, we need to count
the traces for xcontour. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
449
SUXGRAPH - X-windows GRAPH plot of a segy data set
Optional parameters:
style=seismic seismic is default here, =normal is alternate
(see xgraph selfdoc for style definitions)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
Credits:
450
CWP: Dave Hale and Zhiming Li (pswigp, etc.)
Jack Cohen and John Stockwell (supswigp, etc.)
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigp. You can make this value "known"
either by getparring nplot or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
451
SUXIMAGE - X-windows IMAGE plot of a segy data set
Optional parameters:
452
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
Credits:
Notes:
When provide ftr and dtr and infile, suximage can be used to plot
multi-dimensional volumes efficiently. For example, for a Offset-CDP
dataset with 32 offsets, the command line
suximage infile=volume3d.su ftr=1 dtr=32 ... &
will display the zero-offset common offset data with ranrom access.
It is highly recommend to use infile= to view large datasets, since
using stdin only allows sequential access, which is very slow for
large datasets.
453
SUXMAX - X-windows graph of the MAX, min, or absolute max value on
each trace of a SEGY (SU) data set
Optional parameters:
mode=max max value
=min min value
=abs absolute max value
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
454
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for xgraph. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
455
SUXMOVIE - X MOVIE plot of a 2D or 3D segy data set
Optional parameters:
Notes:
For seismic data, the "fast dimension" is either time or
depth and the "slow dimension" is usually trace number.
The 3D data set is expected to have n3 sets of n2 traces representing
the horizontal coverage of n2*d2 in x and n3*d3 in y direction.
The data is read to memory with and piped to xmovie with the
respective sampling parameters.
456
See the xmovie selfdoc for the remaining parameters and X functions.
457
SUXPICKER - X-windows WIGgle plot PICKER of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
458
See the xpicker selfdoc for the remaining parameters.
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for xpicker. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
459
SUXWIGB - X-windows Bit-mapped WIGgle plot of a segy data set
This is a modified suxwigb that uses the depth or coordinate scaling
when such values are used as keys.
Optional parameters:
key=(keyword) if set, the values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
460
This program is really just a wrapper for the plotting program: xwigb
See the xwigb selfdoc for the remaining parameters.
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for xwigb. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
461
PSBBOX - change BoundingBOX of existing PostScript file
Optional Parameters:
llx= new llx
lly= new lly
urx= new urx
ury= new ury
verbose=1 =1 for info printed on stderr (0 for no info)
462
PSCONTOUR - PostScript CONTOURing of a two-dimensional function f(x1,x2)
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=d1 first sample in 1st dimension
x1=f1,f1+d1,... array of monotonic sampled values in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=d2 first sample in 2nd dimension
x2=f2,f2+d2,... array of monotonic sampled values in 2nd dimension
nc=5 number of contour values
dc=(zmax-zmin)/nc contour interval
fc=min+dc first contour
c=fc,fc+dc,... array of contour values
cwidth=1.0,... array of contour line widths
cgray=0.0,... array of contour grays (0.0=black to 1.0=white)
ccolor=none,... array of contour colors; none means use cgray
cdash=0.0,... array of dash spacings (0.0 for solid)
labelcf=1 first labeled contour (1,2,3,...)
labelcper=1 label every labelcper-th contour
nlabelc=nc number of labeled contours (0 no contour label)
nplaces=6 number of decimal places in contour label
xbox=1.5 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
wbox=6.0 width in inches of axes box
hbox=8.0 height in inches of axes box
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
463
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
labelcfont=Helvetica-Bold font name for contour labels
labelcsize=6 font size of contour labels
labelccolor=black color of contour labels
titlecolor=black color of title
axescolor=black color of axes
gridcolor=black color of grid
axeswidth=1 width (in points) of axes
ticwidth=axeswidth width (in points) of tic marks
gridwidth=axeswidth width (in points) of grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
Note.
The line width of unlabeled contours is designed as a quarter of that
of labeled contours.
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
Notes:
464
Values are labeled on contours
MODIFIED: Craig Artley, Colorado School of Mines, 12/16/93
Added color options (Courtesy of Dave Hale, Advance Geophysical).
Modified: Morten Wendell Pedersen, Aarhus University, 23/3-97
Added ticwidth,axeswidth, gridwidth parameters
465
PSCCONTOUR - PostScript Contour plot of a data CUBE
Required Parameters:
n1 number of samples in 1st (fastest) dimension
n2 number of samples in 2nd dimension
n3 number of samples in 3rd (slowest) dimension
Optional Parameters:
front name of file containing front panel
side name of file containing side panel
top name of file containing top panel
faces=0 =1 to read faces from stdin (data format 2)
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
d3=1.0 sampling interval in 3rd dimension
f3=0.0 first sample in 3rd dimension
d1s=1.0 factor by which to scale d1 before imaging
d2s=1.0 factor by which to scale d2 before imaging
d3s=1.0 factor by which to scale d3 before imaging
nc=5 number of contour values
dc=(zmax-zmin)/nc contour interval
fc=min+dc first contour
c=fc,fc+dc,... array of contour values
cwidth=1.0,... array of contour line widths
cgray=0.0,... array of contour grays (0.0=black to 1.0=white)
ccolor=none,... array of contour colors; none means use cgray
cdash=0.0,... array of dash spacings (0.0 for solid)
labelcf=1 first labeled contour (1,2,3,...)
labelcper=1 label every labelcper-th contour
nlabelc=nc number of labeled contours (0 no contour label)
nplaces=6 number of decimal places in contour label
466
xbox=1.5 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
size1=4.0 size in inches of 1st axes (vertical)
size2=4.0 size in inches of 2nd axes (horizontal)
size3=3.0 size in inches of 3rd axes (projected)
angle=45 projection angle of cube in degrees (0<angle<90)
(angle between 2nd axis and projected 3rd axis)
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
x3end=x3max value at which axis 3 ends
d3num=0.0 numbered tic interval on axis 3 (0.0 for automatic)
f3num=x3min first numbered tic on axis 3 (used if d3num not 0.0)
n3tic=1 number of tics per numbered tic on axis 3
grid3=none grid lines on axis 3 - none, dot, dash, or solid
label3= label on axis 3
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
titlecolor=black color of title
labelcfont=Helvetica-Bold font name for contour labels
labelcsize=6 font size of contour labels
labelccolor=black color of contour labels
axescolor=black color of axes
gridcolor=black color of grid
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
467
(Original codes pscontour and pscube)
468
PSCUBE - PostScript image plot with Legend of a data CUBE
Required Parameters:
n1 number of samples in 1st (fastest) dimension
n2 number of samples in 2nd dimension
n3 number of samples in 3rd (slowest) dimension
Optional Parameters:
front name of file containing front panel
side name of file containing side panel
top name of file containing top panel
faces=0 =1 to read faces from stdin (data format 2)
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
d3=1.0 sampling interval in 3rd dimension
f3=0.0 first sample in 3rd dimension
perc=100.0 percentile used to determine clip
clip=(perc percentile) clip used to determine bclip and wclip
bperc=perc percentile for determining black clip value
wperc=100.0-perc percentile for determining white clip value
bclip=clip data values outside of [bclip,wclip] are clipped
wclip=-clip data values outside of [bclip,wclip] are clipped
brgb=0.0,0.0,0.0 red, green, blue values corresponding to black
wrgb=1.0,1.0,1.0 red, green, blue values corresponding to white
bhls=0.0,0.0,0.0 hue, lightness, saturation corresponding to black
whls=0.0,1.0,0.0 hue, lightness, saturation corresponding to white
bps=12 bits per sample for color plots, either 12 or 24
d1s=1.0 factor by which to scale d1 before imaging
d2s=1.0 factor by which to scale d2 before imaging
d3s=1.0 factor by which to scale d3 before imaging
verbose=1 =1 for info printed on stderr (0 for no info)
469
xbox=1.5 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
size1=4.0 size in inches of 1st axes (vertical)
size2=4.0 size in inches of 2nd axes (horizontal)
size3=3.0 size in inches of 3rd axes (projected)
angle=45 projection angle of cube in degrees (0<angle<90)
(angle between 2nd axis and projected 3rd axis)
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
x3end=x3max value at which axis 3 ends
d3num=0.0 numbered tic interval on axis 3 (0.0 for automatic)
f3num=x3min first numbered tic on axis 3 (used if d3num not 0.0)
n3tic=1 number of tics per numbered tic on axis 3
grid3=none grid lines on axis 3 - none, dot, dash, or solid
label3= label on axis 3
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
titlecolor=black color of title
axescolor=black color of axes
gridcolor=black color of grid
legend=0 =1 display the color scale
if ==1, resize xbox,ybox,width,height
lstyle=vertleft Vertical, axis label on left side
=vertright (Vertical, axis label on right side)
=horibottom (Horizontal, axis label on bottom)
units= unit label for legend
legendfont=times_roman10 font name for title
following are defaults for lstyle=0. They are changed for other lstyles
lwidth=1.2 colorscale (legend) width in inches
lheight=height/3 colorscale (legend) height in inches
470
lx=1.0 colorscale (legend) x-position in inches
ly=(height-lheight)/2+xybox colorscale (legend) y-position in pixels
lbeg= lmin or wclip-5*perc value at which legend axis begins
lend= lmax or bclip+5*perc value at which legend axis ends
ldnum=0.0 numbered tic interval on legend axis (0.0 for automatic)
lfnum=lmin first numbered tic on legend axis (used if d1num not 0.0)
lntic=1 number of tics per numbered tic on legend axis
lgrid=none grid lines on legend axis - none, dot, dash, or solid
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
471
PSEPSI - add an EPSI formatted preview bitmap to an EPS file
Note:
This application requires
(1) that gs (the Ghostscript interpreter) exist, and
(2) that the input EPS file contain a BoundingBox and EndComments.
Ghostscript is used to build the preview bitmap, which is then
merged with the input EPS file to make the output EPSI file.
472
PSGRAPH - PostScript GRAPHer
Graphs n[i] pairs of (x,y) coordinates, for i = 1 to nplot.
Required Parameters:
n array containing number of points per plot
Available colors are all the common ones and many more. The complete
list of 68 colors is in the file $CWPROOT/src/psplot/basic.c.
Optional Parameters:
nplot=number of n’s number of plots
d1=0.0,... x sampling intervals (0.0 if x coordinates input)
f1=0.0,... first x values (not used if x coordinates input)
d2=0.0,... y sampling intervals (0.0 if y coordinates input)
f2=0.0,... first y values (not used if y coordinates input)
pairs=1,... =1 for data pairs in format 1.a, =0 for format 1.b
linewidth=1.0,... line widths (in points) (0.0 for no lines)
linegray=0.0,... line gray levels (black=0.0 to white=1.0)
linecolor=none,... line colors; none means use linegray
Typical use: linecolor=red,yellow,blue,...
lineon=1.0,... length of line segments for dashed lines (in points)
lineoff=0.0,... spacing between dashes (0.0 for solid line)
mark=0,1,2,3,... indices of marks used to represent plotted points
marksize=0.0,0.0,... size of marks (0.0 for no marks)
xbox=1.5 offset in inches of left side of axes box
473
ybox=1.5 offset in inches of bottom side of axes box
wbox=6.0 width in inches of axes box
hbox=8.0 height in inches of axes box
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
titlecolor=black color of title
axescolor=black color of axes
gridcolor=black color of grid
axeswidth=1 width (in points) of axes
ticwidth=axeswidth width (in points) of tic marks
gridwidth=axeswidth width (in points) of grid lines
style=normal normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
reverse=0 =1 to reverse sequence of plotting curves ",
Note: n1 and n2 are acceptable aliases for n and nplot, respectively.
mark index:
1. asterisk
2. x-cross
3. open triangle
4. open square
5. open circle
6. solid triangle
7. solid square
8. solid circle
474
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
Example:
psgraph n=50,100,20 d1=2.5,1,0.33 <datafile >psfile
plots three curves with equally spaced x values in one plot frame
x1-coordinates are x1(i) = f1+i*d1 for i = 1 to n (f1=0 by default)
number of x2’s and then x2-coordinates for each curve are read
sequentially from datafile.
475
PSIMAGE - PostScript IMAGE plot of a uniformly-sampled function f(x1,x2)
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
perc=100.0 percentile used to determine clip
clip=(perc percentile) clip used to determine bclip and wclip
bperc=perc percentile for determining black clip value
wperc=100.0-perc percentile for determining white clip value
bclip=clip data values outside of [bclip,wclip] are clipped
wclip=-clip data values outside of [bclip,wclip] are clipped
bclip and wclip will be set to be inside
[lbeg,lend] if lbeg and/or lend are supplied
threecolor=1 supply 3 color values instead of only two,
using not only black and white, but f.e. red,
green and blue
brgb=0.0,0.0,0.0 red, green, blue values corresponding to black
grgb=1.0,1.0,1.0 red, green, blue values corresponding to grey
wrgb=1.0,1.0,1.0 red, green, blue values corresponding to white
bhls=0.0,0.0,0.0 hue, lightness, saturation corresponding to black
ghls=0.0,1.0,0.0 hue, lightness, saturation corresponding to grey
whls=0.0,1.0,0.0 hue, lightness, saturation corresponding to white
bps=12 bits per sample for color plots, either 12 or 24
d1s=1.0 factor by which to scale d1 before imaging
d2s=1.0 factor by which to scale d2 before imaging
verbose=1 =1 for info printed on stderr (0 for no info)
xbox=1.5 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
width=6.0 width in inches of axes box
height=8.0 height in inches of axes box
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
476
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
titlecolor=black color of title
axescolor=black color of axes
gridcolor=black color of grid
axeswidth=1 width (in points) of axes
ticwidth=axeswidth width (in points) of tic marks
gridwidth=axeswidth width (in points) of grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
legend=0 =1 display the color scale
lnice=0 =1 nice legend arrangement
(overrides ybox,lx,width,height parameters)
lstyle=vertleft Vertical, axis label on left side
=vertright (Vertical, axis label on right side)
=horibottom (Horizontal, axis label on bottom)
units= unit label for legend
legendfont=times_roman10 font name for title
following are defaults for lstyle=0. They are changed for other lstyles
lwidth=1.2 colorscale (legend) width in inches
lheight=height/3 colorscale (legend) height in inches
lx=1.0 colorscale (legend) x-position in inches
ly=(height-lheight)/2+xybox colorscale (legend) y-position in pixels
lbeg= lmin or wclip-5*perc value at which legend axis begins
lend= lmax or bclip+5*perc value at which legend axis ends
ldnum=0.0 numbered tic interval on legend axis (0.0 for automatic)
lfnum=lmin first numbered tic on legend axis (used if d1num not 0.0)
lntic=1 number of tics per numbered tic on legend axis
lgrid=none grid lines on legend axis - none, dot, dash, or solid
477
npair=n1,n2,n2,... number(s) of pairs in each file
curvecolor=black,.. color of curve(s)
curvewidth=axeswidth width (in points) of curve(s)
NOTES:
The curve file is an ascii file with the points specified as x1 x2
pairs, one pair to a line. A "vector" of curve files and curve
colors may be specified as curvefile=file1,file2,etc.
and curvecolor=color1,color2,etc, and the number of pairs of values
in each file as npair=npair1,npair2,... .
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
478
PSLABEL - output PostScript file consisting of a single TEXT string
on a specified background. (Use with psmerge to label plots.)
Optional Parameters:
f=Times-Bold font for text string
(multiple specifications for each t)
size=30 size of characters in points (72 points/inch)
tcolor=black color of text string
bcolor=white color of background box
nsub=0 number of characters to subtract when
computing size of background box (not all
characters are the same size so the
background box may be too big at times.)
Example:
pslabel t="(a) " f=Times-Bold t="h" f=Symbol t="=0.04" nsub=3 > epsfile
Notes:
This program produces a (color if desired) PostScript text string that
can be positioned and pasted on a PostScript plot using psmerge
see selfdoc of psmerge for further information.
479
pinegreen,limegreen,yellowgreen,springgreen,olivegreen,rawsienna,sepia,
brown,tan,white,black,gray
All color specifications may also be made in X Window style Hex format
example: tcolor=#255
480
PSMANAGER - printer MANAGER for HP 4MV and HP 5Si Mx Laserjet
PostScript printing
Required Parameters:
none
Optional Parameters:
papersize=0 paper size (US Letter default)
=1 US Legal
=2 A4
=3 11x17
Notes:
The option manual=1 implies tray=1. The media options apply
only to the HP LaserJet 5Si MX model printer.
Examples:
overheads:
psmanager < postscript_file manual=1 media=1 | lpr
labels:
psmanager < postscript_file manual=1 media=5 | lpr
481
Notes: This code was reverse engineered using output from
the NeXTStep printer manager.
Reference:
PostScript Printer Description File Format Specification,
version 4.2, Adobe Systems Incorporated
482
PSMERGE - MERGE PostScript files
Required Parameters:
in= postscript file to merge
Optional Parameters:
origin=0.0,0.0 x,y origin in inches
scale=1.0,1.0 x,y scale factors
rotate=0.0 rotation angle in degrees
translate=0.0,0.0 x,y translation in inches
Notes:
More than one set of in, origin, scale, rotate, and translate
parameters may be specified. Output x and y coordinates are
determined by:
x = tx + (x-ox)*sx*cos(d) - (y-oy)*sy*sin(d)
y = ty + (x-ox)*sx*sin(d) + (y-oy)*sy*cos(d)
where tx,ty are translate coordinates, ox,oy are origin coordinates,
sx,sy are scale factors, and d is the rotation angle. Note that the
order of operations is shift (origin), scale, rotate, and translate.
483
PSMOVIE - PostScript MOVIE plot of a uniformly-sampled function f(x1,x2,x3)
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
perc=100.0 percentile used to determine clip
clip=(perc percentile) clip used to determine bclip and wclip
bperc=perc percentile for determining black clip value
wperc=100.0-perc percentile for determining white clip value
bclip=clip data values outside of [bclip,wclip] are clipped
wclip=-clip data values outside of [bclip,wclip] are clipped
d1s=1.0 factor by which to scale d1 before imaging
d2s=1.0 factor by which to scale d2 before imaging
verbose=1 =1 for info printed on stderr (0 for no info)
xbox=1.0 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
wbox=6.0 width in inches of axes box
hbox=8.0 height in inches of axes box
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
484
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
n3=1 number of samples in third dimension
title2= second title to annotate different frames
loopdsp=3 display loop type (1=loop over n1; 2=loop over n2;
3=loop over n3)
d3=1.0 sampling interval in 3rd dimension
f3=d3 first sample in 3rd dimension
NeXT: view movie via: psmovie < infile n1= [optional params...] | open
Note: currently only the Preview Application can handle the multipage
PostScript output by this program.
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
485
PSWIGB - PostScript WIGgle-trace plot of f(x1,x2) via Bitmap
Best for many traces. Use PSWIGP (Polygon version) for few traces.
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
x2=f2,f2+d2,... array of sampled values in 2nd dimension
bias=0.0 data value corresponding to location along axis 2
perc=100.0 percentile for determining clip
clip=(perc percentile) data values < bias+clip and > bias-clip are clipped
xcur=1.0 wiggle excursion in traces corresponding to clip
wt=1 =0 for no wiggle-trace; =1 for wiggle-trace
va=1 =0 for no variable-area; =1 for variable-area fill
=2 for variable area, solid/grey fill
SHADING: 2<= va <=5 va=2 lightgrey, va=5 black",
nbpi=72 number of bits per inch at which to rasterize
verbose=1 =1 for info printed on stderr (0 for no info)
xbox=1.5 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
wbox=6.0 width in inches of axes box
hbox=8.0 height in inches of axes box
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
486
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
titlecolor=black color of title
axescolor=black color of axes
gridcolor=black color of grid
axeswidth=1 width (in points) of axes
ticwidth=axeswidth width (in points) of tic marks
gridwidth=axeswidth width (in points) of grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
interp=0 no display interpolation
=1 use 8 point sinc interpolation
curve=curve1,curve2,... file(s) containing points to draw curve(s)
npair=n1,n2,n2,... number(s) of pairs in each file
curvecolor=black,.. color of curve(s)
curvewidth=axeswidth width (in points) of curve(s)
Notes:
The interp option may be useful for high nbpi values, however, it
tacitly assumes that the data are purely oscillatory. Non-oscillatory
data will not be represented correctly when this option is set.
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
487
PSWIGP - PostScript WIGgle-trace plot of f(x1,x2) via Polygons
Best for few traces. Use PSWIGB (Bitmap version) for many traces.
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
x2=f2,f2+d2,... array of sampled values in 2nd dimension
bias=0.0 data value corresponding to location along axis 2
perc=100.0 percentile for determining clip
clip=(perc percentile) data values < bias+clip and > bias-clip are clipped
xcur=1.0 wiggle excursion in traces corresponding to clip
fill=1 =0 for no fill;
>0 for pos. fill;
<0 for neg. fill
=2 for pos. fill solid, neg. fill grey
=-2for neg. fill solid, pos. fill grey
SHADING: 2<=abs(fill)<=5 2=lightgrey 5=black
linewidth=1.0 linewidth in points (0.0 for thinest visible line)
tracecolor=black color of traces; should contrast with background
backcolor=none color of background; none means no background
verbose=1 =1 for info printed on stderr (0 for no info)
xbox=1.5 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
wbox=6.0 width in inches of axes box
hbox=8.0 height in inches of axes box
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
488
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Helvetica font name for axes labels
labelsize=18 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
titlecolor=black color of title
axescolor=black color of axes
gridcolor=black color of grid
axeswidth=1 width (in points) of axes
ticwidth=axeswidth width (in points) of tic marks
gridwidth=axeswidth width (in points) of grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
The curve file is an ascii file with the points specified as x1 x2 pairs,
one pair to a line. A "vector" of curve files and curve colors may
be specified as curvefile=file1,file2,etc. and similarly
curvecolor=color1,color2,etc, and the number of pairs of values
in each file as npair=npair1,npair2,... .
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
489
LCMAP - List Color Map of root window of default screen
Usage: lcmap
490
LPROP - List PROPerties of root window of default screen of display
Usage: lprop
491
SCMAP - set default standard color map (RGB_DEFAULT_MAP)
Usage: scmap
492
XCONTOUR - X CONTOUR plot of f(x1,x2) via vector plot call
X Functionality:
Button 1 Zoom with rubberband box
Button 2 Show mouse (x1,x2) coordinates while pressed
q or Q key Quit
s key Save current mouse (x1,x2) location to file
p or P key Plot current window with pswigb (only from disk files)
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
x1=f1,f1+d1,... array of sampled values in 1nd dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
x2=f2,f2+d2,... array of sampled values in 2nd dimension
mpicks=/dev/tty file to save mouse picks in
verbose=1 =1 for info printed on stderr (0 for no info)
nc=5 number of contour values
dc=(zmax-zmin)/nc contour interval
fc=min+dc first contour
c=fc,fc+dc,... array of contour values
cwidth=1.0,... array of contour line widths
ccolor=none,... array of contour colors; none means use cgray
cdash=0.0,... array of dash spacings (0.0 for solid)
labelcf=1 first labeled contour (1,2,3,...)
labelcper=1 label every labelcper-th contour
nlabelc=nc number of labeled contours (0 no contour label)
nplaces=6 number of decimal places in contour labeling
xbox=50 x in pixels of upper left corner of window
ybox=50 y in pixels of upper left corner of window
wbox=550 width in pixels of window
hbox=700 height in pixels of window
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
493
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Erg14 font name for axes labels
title= title of plot
titlefont=Rom22 font name for title
windowtitle=xwigb title on window
labelcolor=blue color for axes labels
titlecolor=red color for title
gridcolor=blue color for grid lines
labelccolor=black color of contour labels ",
labelcfont=fixed font name for contour labels
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
Notes:
For some reason the contour might slight differ from ones generated
by pscontour (propably due to the pixel nature of the plot
coordinates)
All the coding is based on snippets taken from xwigb, ximage and pscontour
All I have done is put the parts together and put in some bugs ;-)
Since all the contours are drawn by Vector plot call’s everytime the
494
Window is exposed, the exposing can be darn slow
OOPS This should be history... Now I keep my window content with backing
store so I won’t have to redraw my window unless I really have to...
Since I put the contour labels everytime I draw one contour level the area
that contains the label will be crossed by the the next contour lines...
(this bug also seems to be present in pscontour)
To fix this I have to redraw all the labels after been through all
the contour calls
Right now I can’t see a way to fix this without actually to through
the entire label positioning again....Overkill I would say
The relative short length of the contour segments will propably mask the
cdash settings
which means it is disposable (but I know how to draw dashed lines :)
A way of fixing this could be to get all connected point and then use
XDrawlines or XDrawSegments... just an idea...No idea if it’ll work.
I need to check the Self Doc so if the right parameters are described
(I have been through it a couple of times but....)
Wish List:
The use of cgray’s unused until now... I guess I’ll need to allocate
a gray Colormap -> meaning that the code not will run at other display
495
than 8 bit Pseudocolor :( (with the use of present version of the colormap
library (code in $CWPROOT/src/xplot/lib ) )
496
XESPB - X windows display of Encapsulated PostScript as a single Bitmap
497
XEPSP - X windows display of Encapsulated PostScript
498
XIMAGE - X IMAGE plot of a uniformly-sampled function f(x1,x2)
X Functionality:
Button 1 Zoom with rubberband box
Button 2 Show mouse (x1,x2) coordinates while pressed
q or Q key Quit
s key Save current mouse (x1,x2) location to file
p or P key Plot current window with pswigb (only from disk files)
a or page up keys enhance clipping by 10%
c or page down keys reduce clipping by 10%
up,down,left,right keys move zoom window by half width/height
i or +(keypad) zoom in by factor 2
o or -(keypad) zoom out by factor 2
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
mpicks=/dev/tty file to save mouse picks in
perc=100.0 percentile used to determine clip
clip=(perc percentile) clip used to determine bclip and wclip
bperc=perc percentile for determining black clip value
wperc=100.0-perc percentile for determining white clip value
bclip=clip data values outside of [bclip,wclip] are clipped
wclip=-clip data values outside of [bclip,wclip] are clipped
balance=0 bclip & wclip individually
=1 set them to the same abs value
if specified via perc (avoids colorbar skew)
499
cmap=hsv\’n\’ or rgb\’m\’ \’n\’ is a number from 0 to 13
\’m\’ is a number from 0 to 11
cmap=rgb0 is equal to cmap=gray
cmap=hsv1 is equal to cmap=hue
(compatibility to older versions)
legend=0 =1 display the color scale
units= unit label for legend
legendfont=times_roman10 font name for title
verbose=1 =1 for info printed on stderr (0 for no info)
xbox=50 x in pixels of upper left corner of window
ybox=50 y in pixels of upper left corner of window
wbox=550 width in pixels of window
hbox=700 height in pixels of window
lwidth=16 colorscale (legend) width in pixels
lheight=hbox/3 colorscale (legend) height in pixels
lx=3 colorscale (legend) x-position in pixels
ly=(hbox-lheight)/3 colorscale (legend) y-position in pixels
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Erg14 font name for axes labels
title= title of plot
titlefont=Rom22 font name for title
windowtitle=ximage title on window
labelcolor=blue color for axes labels
titlecolor=red color for title
gridcolor=blue color for grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
blank=0 This indicates what portion of the lower range
to blank out (make the background color). The
value should range from 0 to 1.
500
plotfile=plotfile.ps filename for interactive ploting (P)
curve=curve1,curve2,... file(s) containing points to draw curve(s)
npair=n1,n2,n2,... number(s) of pairs in each file
curvecolor=color1,color2,... color(s) for curve(s)
blockinterp=0 whether to use block interpolation (0=no, 1=yes)
NOTES:
The curve file is an ascii file with the points specified as x1 x2
pairs separated by a space, one pair to a line. A "vector" of curve
files and curve colors may be specified as curvefile=file1,file2,etc.
and curvecolor=color1,color2,etc, and the number of pairs of values
in each file as npair=npair1,npair2,... .
Garry Perratt, Geocon, 08/04/05, modified perc handling to center colorbar if balan
Function Prototype:
void intl2b_block(int nxin, float dxin, float fxin,
int nyin, float dyin, float fyin, unsigned char *zin,
int nxout, float dxout, float fxout,
int nyout, float dyout, float fyout, unsigned char *zout);
501
Input:
nxin number of x samples input (fast dimension of zin)
dxin x sampling interval input
fxin first x sample input
nyin number of y samples input (slow dimension of zin)
dyin y sampling interval input
fyin first y sample input
zin array[nyin][nxin] of input samples (see notes)
nxout number of x samples output (fast dimension of zout)
dxout x sampling interval output
fxout first x sample output
nyout number of y samples output (slow dimension of zout)
dyout y sampling interval output
fyout first y sample output
Output:
zout array[nyout][nxout] of output samples (see notes)
Notes:
The arrays zin and zout must passed as pointers to the first element of
a two-dimensional contiguous array of unsigned char values.
502
XPICKER - X wiggle-trace plot of f(x1,x2) via Bitmap with PICKing
X Menu functionality:
Pick Filename Window default is pick_file
Load load an existing Pick Filename
Save save to Pick Filename
View only/Pick default is View, click to enable Picking
Add/Delete default is Add, click to delete picks
Cross off/on default is Cross off, click to enable Crosshairs
In View mode:
a or page up keys enhance clipping by 10%
c or page down keys reduce clipping by 10%
up,down,left,right keys move zoom window by half width/height
i or +(keypad) zoom in by factor 2
o or -(keypad) zoom out by factor 2
l lock the zoom while moving the coursor
u unlock the zoom
Notes:
Menu selections and toggles ("clicks") are made with button 1
Pick selections are made with button 3
Edit a pick selection by dragging it with button 3 down or
by making a new pick on that trace
Reaching the window limits while moving within changes the zoom
factor in this direction. The use of zoom locking(l) disables it
Required Parameters:
n1= number of samples in 1st (fast) dimension
Optional Parameters:
mpicks=pick_file name of output (input) pick file
d1=1.0 sampling interval in 1st dimension
f1=d1 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
503
d2=1.0 sampling interval in 2nd dimension
f2=d2 first sample in 2nd dimension
x2=f2,f2+d2,... array of sampled values in 2nd dimension
bias=0.0 data value corresponding to location along axis 2
perc=100.0 percentile for determining clip
clip=(perc percentile) data values < bias+clip and > bias-clip are clipped
xcur=1.0 wiggle excursion in traces corresponding to clip
wt=1 =0 for no wiggle-trace; =1 for wiggle-trace
va=1 =0 for no variable-area; =1 for variable-area fill
=2 for variable area, solid/grey fill
SHADING: 2<=va<=5 va=2 light grey, va=5 black
verbose=1 =1 for info printed on stderr (0 for no info)
xbox=50 x in pixels of upper left corner of window
ybox=50 y in pixels of upper left corner of window
wbox=550 width in pixels of window
hbox=700 height in pixels of window
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Erg14 font name for axes labels
title= title of plot
titlefont=Rom22 font name for title
labelcolor=blue color for axes labels
titlecolor=red color for title
gridcolor=blue color for grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
endian= =0 little endian, =1 big endian
interp=0 no sinc interpolation
=1 perform sinc interpolation
x2file= file of "acceptable" x2 values
x1x2=1 save picks in the order (x1,x2)
504
=0 save picks in the order (x2,x1)
Notes:
Xpicker will try to detect the endian value of the X-display and will
set it to the right value. If it gets obviously wrong information the
endian value will be set to the endian value of the machine that is
given at compile time as the value of CWPENDIAN defined in cwp.h
and set via the compile time flag ENDIANFLAG in Makefile.config.
The only time that you might want to change the value of the endian
variable is if you are viewing traces on a machine with a different
byte order than the machine you are creating the traces on AND if for
some reason the automaic detection of the display byte order fails.
Set endian to that of the machine you are viewing the traces on.
The interp flag is useful for making better quality wiggle trace for
making plots from screen dumps. However, this flag assumes that the
data are purely oscillatory. This option may not be appropriate for all
data sets.
If the x2file= option is set, then the values from the specified file
will define the set of "acceptable" values of x2 for xpicker to
output. The format is a single column of ASCII values. The number of
specified values is arbitrary.
See the selfdoc of suxpicker for information on using key fields from
the SU trace headers directly.
505
Department of Geology, University of Wisconsin 10/96
MODIFIED: P. Michaels, Boise State Univeristy 29 December 2000
Added solid/grey color scheme for peaks/troughs
NOTES:
Interactive picker improved to allow x-axis of picks to be
coordinated with "key=header" parameter set in driver routine
suxpicker. Multiple picks per trace are now allowed.
Input:
The command line of suxpicker is unchanged. The parameter"key=header"
set in suxpicker controls a) trace x-axis displayed via xpicker and
b) the header values in the first column of a pick file either read in
or written out from xpicker c) header values expected in optional file
or written out from xpicker c) header values expected in optional file
x2file= which reads into xpicker allowable trace x-axis values.
506
invoked, then these trace header x-axis values are the only allowable
x-axis pick values used in the pick "add" or "delete" menu operation.
Header values do not need to be sorted or 1 to 1 with input traces.
Further, pick file x-axis values can be read into xpicker via load
operation without having to match key_pickx1_val x-axis values and
can also be rewritten out an output pickfile. As indicated, only
the "add" and "delete" pick operations are influenced by existence
of this file.
Strategy:
a) malloc() and realloc() used to dynamically allocate memory
for array of x-axis value read in from optional file
x2file=. This is done in function read_keyval().
b) The pick file dimensions are set in main program via malloc()
and then initialized (*apick)[i].picked = FALSE) in function
init_picks(). The pick file is declared as pick_t **apick, in
order to use realloc() as needed in functions load_picks where the
pick file is read in and edit_picks where picks are added. The
call to realloc() and further initializing is performed in
function realloc_picks().
507
d) Code modifications are limited to above mentioned functions,
except for additional parameters passed to functions edit_picks,
load_picks, save_picks, and check_buttons.
508
XPSP - Display conforming PostScript in an X-window
509
XWIGB - X WIGgle-trace plot of f(x1,x2) via Bitmap
X Functionality:
Button 1 Zoom with rubberband box
Button 2 Show mouse (x1,x2) coordinates while pressed
q or Q key Quit
s key Save current mouse (x1,x2) location to file
p or P key Plot current window with pswigb (only from disk files)
a or page up keys enhance clipping by 10%
c or page down keys reduce clipping by 10%
up,down,left,right keys move zoom window by half width/height
i or +(keypad) zoom in by factor 2
o or -(keypad) zoom out by factor 2
l lock the zoom while moving the coursor
u unlock the zoom
1,2,...,9 Zoom/Move factor of the window size
Notes:
Reaching the window limits while moving within changes the zoom
factor in this direction. The use of zoom locking(l) disables it
Required Parameters:
n1 number of samples in 1st (fast) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
x2=f2,f2+d2,... array of sampled values in 2nd dimension
mpicks=/dev/tty file to save mouse picks in
bias=0.0 data value corresponding to location along axis 2
perc=100.0 percentile for determining clip
clip=(perc percentile) data values < bias+clip and > bias-clip are clipped
xcur=1.0 wiggle excursion in traces corresponding to clip
wt=1 =0 for no wiggle-trace; =1 for wiggle-trace
va=1 =0 for no variable-area; =1 for variable-area fill
=2 for variable area, solid/grey fill
SHADING: 2<=va<=5 va=2 light grey, va=5 black
verbose=1 =1 for info printed on stderr (0 for no info)
510
xbox=50 x in pixels of upper left corner of window
ybox=50 y in pixels of upper left corner of window
wbox=550 width in pixels of window
hbox=700 height in pixels of window
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Erg14 font name for axes labels
title= title of plot
titlefont=Rom22 font name for title
windowtitle=xwigb title on window
labelcolor=blue color for axes labels
titlecolor=red color for title
gridcolor=blue color for grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
endian= =0 little endian =1 big endian
interp=0 no interpolation in display
=1 use 8 point sinc interpolation
wigclip=0 If 0, the plot box is expanded to accommodate
the larger wiggles created by xcur>1. If this
flag is non-zero, the extra-large wiggles are
are clipped at the boundary of the plot box.
plotfile=plotfile.ps filename for interactive ploting (P)
curve=curve1,curve2,... file(s) containing points to draw curve(s)
npair=n1,n2,n2,... number(s) of pairs in each file
curvecolor=color1,color2,... color(s) for curve(s)
Notes:
Xwigb will try to detect the endian value of the X-display and will
set it to the right value. If it gets obviously wrong information the
endian value will be set to the endian value of the machine that is
given at compile time as the value of CWPENDIAN defined in cwp.h
511
and set via the compile time flag ENDIANFLAG in Makefile.config.
The only time that you might want to change the value of the endian
variable is if you are viewing traces on a machine with a different
byte order than the machine you are creating the traces on AND if for
some reason the automaic detection of the display byte order fails.
Set endian to that of the machine you are viewing the traces on.
The interp flag is useful for making better quality wiggle trace for
making plots from screen dumps. However, this flag assumes that the
data are purely oscillatory. This option may not be appropriate for all
data sets.
512
XGRAPH - X GRAPHer
Graphs n[i] pairs of (x,y) coordinates, for i = 1 to nplot.
X Functionality:
q or Q key Quit
Required Parameters:
n array containing number of points per plot
Optional Parameters:
nplot=number of n’s number of plots
d1=0.0,... x sampling intervals (0.0 if x coordinates input)
f1=0.0,... first x values (not used if x coordinates input)
d2=0.0,... y sampling intervals (0.0 if y coordinates input)
f2=0.0,... first y values (not used if y coordinates input)
pairs=1,... =1 for data pairs in format 1.a, =0 for format 1.b
linewidth=1,1,... line widths in pixels (0 for no lines)
linecolor=2,3,... line colors (black=0, white=1, 2,3,4 = RGB, ...)
mark=0,1,2,3,... indices of marks used to represent plotted points
marksize=0,0,... size of marks in pixels (0 for no marks)
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
reverse=0 =1 to reverse sequence of plotting curves ",
513
gridColor= color for grid lines
style= normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
Example:
xgraph n=50,100,20 d1=2.5,1,0.33 <datafile
plots three curves with equally spaced x values in one plot frame
x1-coordinates are x1(i) = f1+i*d1 for i = 1 to n (f1=0 by default)
number of x2’s and then x2-coordinates for each curve are read
sequentially from datafile.
514
XMOVIE - image one or more frames of a uniformly sampled function f(x1,x2)
X Functionality:
Button 1 Zoom with rubberband box
Button 2 reverse the direction of the movie.
Button 3 stop and start the movie.
q or Q key Quit
s or S key stop display and switch to Step mode
b or B key set frame direction to Backward
f or F key set frame direction to Forward
n or N key same as ’f’
c or C key set display mode to Continuous mode
Required Parameters:
n1= number of samples in 1st (fast) dimension
n2= number of samples in 2nd (slow) dimension
Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
perc=100.0 percentile used to determine clip
clip=(perc percentile) clip used to determine bclip and wclip
bperc=perc percentile for determining black clip value
wperc=100.0-perc percentile for determining white clip value
bclip=clip data values outside of [bclip,wclip] are clipped
wclip=-clip data values outside of [bclip,wclip] are clipped
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
fframe=1 value corresponding to first frame
dframe=1 frame sampling interval
loop=0 =1 to loop over frames after last frame is input
=2 to run movie back and forth
interp=1 =0 for a non-interpolated, blocky image
verbose=1 =1 for info printed on stderr (0 for no info)
idm=0 =1 to set initial display mode to stepmode
515
windowtitle= title on window and icon
width= width in pixels of window
height= height in pixels of window
nTic1= number of tics per numbered tic on axis 1
grid1= grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
nTic2= number of tics per numbered tic on axis 2
grid2= grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelFont= font name for axes labels
title= title of plot
titleFont= font name for title
titleColor= color for title
axesColor= color for axes
gridColor= color for grid lines
style= normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
sleep= delay between frames in microseconds
Color options:
cmap=gray gray, hue, saturation, or default colormaps may be specified
bhue=0 hue mapped to bclip (hue and saturation maps)
whue=240 hue mapped to wclip (hue and saturation maps)
sat=1 saturation (hue map only)
bright=1 brightness (hue and saturation maps)
white=(bclip+wclip)/2 data value mapped to white (saturation map only)
Notes:
Colors are specified using the HSV color wheel model:
Hue: 0=360=red, 60=yellow, 120=green, 180=cyan, 240=blue, 300=magenta
Saturation: 0=white, 1=pure color
Value (brightness): 0=black, 1=maximum intensity
For the saturation mapping (cmap=sat), data values between white and bclip
are mapped to bhue, with saturation varying from white to the pure color.
Values between wclip and white are similarly mapped to whue.
For the hue mapping (cmap=hue), data values between wclip and bclip are
mapped to hues between whue and bhue. Intermediate hues are found by
moving counterclockwise around the circle from bhue to whue. To reverse
the polarity of the image, exchange bhue and whue. Equivalently,
exchange bclip and wclip (setting perc=0 is an easy way to do this).
Hues in excess of 360 degrees can be specified in order to reach the
opposite side of the color circle, or to wrap around the circle more
than once.
516
The title string may contain a C printf format string containing a
conversion character for the frame number. The frame number is
computed from dframe and fframe. E.g., try setting title="Frame %g".
517
XRECTS - plot rectangles on a two-dimensional grid
Required Parameters:
x1min minimum x1 coordinate
x1max maximum x1 coordinate
x2min minimum x2 coordinate
x2max maximum x2 coordinate
Optional Parameters:
color=red color used for rectangules
518
FFTLAB - Motif-X based graphical 1D Fourier Transform
Usage: fftlab
Caveat: you must have the Motif Developer’s package to install this code
519
SUPSCONTOUR - PostScript CONTOUR plot of a segy data set
Optional parameters:
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2
Credits:
520
CWP: Dave Hale and Zhiming Li (pscontour, etc.)
Jack Cohen and John Stockwell (supscontour, etc.)
Delphi: Alexander Koek, added support for irregularly spaced traces
Aarhus University: Morten W. Pedersen copied everything from the xwigb
source and just replaced all occurencies of the word
Notes:
When the number of traces isn’t known, we need to count
the traces for pscontour. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
521
SUPSCUBECONTOUR - PostScript CUBE plot of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
522
Credits:
Notes:
When n2 isn’t getparred, we need to count the traces
for pscube. Although we compute ntr, we don’t allocate a 2-d array
and content ourselves with copying trace by trace from
the data "file" to the pipe into the plotting program.
Although we could use tr.data, we allocate a trace buffer
for code clarity.
523
SUPSCUBE - PostScript CUBE plot of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
524
Credits:
Notes:
When n2 isn’t getparred, we need to count the traces
for pscube. Although we compute ntr, we don’t allocate a 2-d array
and content ourselves with copying trace by trace from
the data "file" to the pipe into the plotting program.
Although we could use tr.data, we allocate a trace buffer
for code clarity.
525
SUPSGRAPH - PostScript GRAPH plot of a segy data set
Optional parameters:
style=seismic seismic is default here, =normal is alternate
(see psgraph selfdoc for style definitions)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
Credits:
526
CWP: Dave Hale and Zhiming Li (pswigp, etc.)
Jack Cohen and John Stockwell (supswigp, etc.)
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigp. You can make this value "known"
either by getparring nplot or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
527
SUPSIMAGE - PostScript IMAGE plot of a segy data set
Optional parameters:
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2
Credits:
528
CWP: Dave Hale and Zhiming Li (psimage, etc.)
Jack Cohen and John Stockwell (supsimage, etc.)
Notes:
When the number of traces isn’t known, we need to count
the traces for psimage. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
529
SUPSMAX - PostScript of the MAX, min, or absolute max value on each trace
of a SEGY (SU) data set
Optional parameters:
mode=max max value
=min min value
=abs absolute max value
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
530
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for psgraph. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
531
SUPSMOVIE - PostScript MOVIE plot of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
532
Credits:
Notes:
When n2 isn’t getparred, we need to count the traces
for psmovie. In this case:
we are using tmpfile because on many machines it is
implemented as a memory area instead of a disk file.
Although we compute ntr, we don’t allocate a 2-d array
and content ourselves with copying trace by trace from
the data "file" to the pipe into the plotting program.
Although we could use tr.data, we allocate a trace buffer
for code clarity.
533
SUPSWIGB - PostScript Bit-mapped WIGgle plot of a segy data set
Optional parameters:
key=(keyword) if set, the values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
This program is really just a wrapper for the plotting program: pswigb
See the pswigb selfdoc for the remaining parameters.
534
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2, keyword (if set)
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigb. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
535
SUPSWIGP - PostScript Polygon-filled WIGgle plot of a segy data set
Optional parameters:
key=(keyword) if set, values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
This program is really just a wrapper for the plotting program: pswigp
See the pswigp selfdoc for the remaining parameters.
536
On NeXT: supswigp < infile [optional parameters] | open
Trace header fields accessed: ns, ntr, tracr, tracl, delrt, trid,
dt, d1, d2, f1, f2, key specified by key
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigp. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
537
SUXCONTOUR - X CONTOUR plot of Seismic UNIX tracefile via vector plot call
Optional parameters:
key=(keyword) if set, the values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
This program is really just a wrapper for the plotting program: xcontour
See the xcontour selfdoc for the remaining parameters.
Credits:
538
CWP: Dave Hale and Zhiming Li (xwigb, etc.)
Jack Cohen and John Stockwell (suxwigb, etc.)
Delphi: Alexander Koek, added support for irregularly spaced traces
Aarhus University: Morten W. Pedersen copied everything from the xwigb
source and just replaced all occurencies of the word
xwigb with xcountour ;-)
Notes:
When the number of traces isn’t known, we need to count
the traces for xcontour. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
539
SUXGRAPH - X-windows GRAPH plot of a segy data set
Optional parameters:
style=seismic seismic is default here, =normal is alternate
(see xgraph selfdoc for style definitions)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
Credits:
540
CWP: Dave Hale and Zhiming Li (pswigp, etc.)
Jack Cohen and John Stockwell (supswigp, etc.)
Notes:
When the number of traces isn’t known, we need to count
the traces for pswigp. You can make this value "known"
either by getparring nplot or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
541
SUXIMAGE - X-windows IMAGE plot of a segy data set
Optional parameters:
542
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
Credits:
Notes:
When provide ftr and dtr and infile, suximage can be used to plot
multi-dimensional volumes efficiently. For example, for a Offset-CDP
dataset with 32 offsets, the command line
suximage infile=volume3d.su ftr=1 dtr=32 ... &
will display the zero-offset common offset data with ranrom access.
It is highly recommend to use infile= to view large datasets, since
using stdin only allows sequential access, which is very slow for
large datasets.
543
SUXMAX - X-windows graph of the MAX, min, or absolute max value on
each trace of a SEGY (SU) data set
Optional parameters:
mode=max max value
=min min value
=abs absolute max value
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to over-ride the header values if
not.
544
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for xgraph. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
545
SUXMOVIE - X MOVIE plot of a 2D or 3D segy data set
Optional parameters:
Notes:
For seismic data, the "fast dimension" is either time or
depth and the "slow dimension" is usually trace number.
The 3D data set is expected to have n3 sets of n2 traces representing
the horizontal coverage of n2*d2 in x and n3*d3 in y direction.
The data is read to memory with and piped to xmovie with the
respective sampling parameters.
546
See the xmovie selfdoc for the remaining parameters and X functions.
547
SUXPICKER - X-windows WIGgle plot PICKER of a segy data set
Optional parameters:
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
548
See the xpicker selfdoc for the remaining parameters.
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for xpicker. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
549
SUXWIGB - X-windows Bit-mapped WIGgle plot of a segy data set
This is a modified suxwigb that uses the depth or coordinate scaling
when such values are used as keys.
Optional parameters:
key=(keyword) if set, the values of x2 are set from header field
specified by keyword
n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
=.004 for seismic (if not set)
=1.0 for nonseismic (if not set)
d2=tr.d2 sampling interval in the slow dimension
=1.0 (if not set)
f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
=1.0 for seismic (if not set)
=d2 for nonseismic (if not set)
Note that for seismic time domain data, the "fast dimension" is
time and the "slow dimension" is usually trace number or range.
Also note that "foreign" data tapes may have something unexpected
in the d2,f2 fields, use segyclean to clear these if you can afford
the processing time or use d2= f2= to override the header values if
not.
If key=keyword is set, then the values of x2 are taken from the header
field represented by the keyword (for example key=offset, will show
traces in true offset). This permit unequally spaced traces to be plotted.
Type sukeyword -o to see the complete list of SU keywords.
550
This program is really just a wrapper for the plotting program: xwigb
See the xwigb selfdoc for the remaining parameters.
Credits:
Notes:
When the number of traces isn’t known, we need to count
the traces for xwigb. You can make this value "known"
either by getparring n2 or by having the ntr field set
in the trace header. A getparred value takes precedence
over the value in the trace header.
551
SXPLOT - X Window plot a triangulated sloth function s(x1,x2)
Optional Parameters:
edgecolor=cyan color to draw fixed edges
tricolor=yellow color to draw non-fixed edges of triangles
=none non-fixed edges of triangles are not shown
bclip=minimum sloth sloth value corresponding to black
wclip=maximum sloth sloth value corresponding to white
x1beg=x1min value at which x1 axis begins
x1end=x1max value at which x1 axis ends
x2beg=x2min value at which x2 axis begins
x2end=x2max value at which x2 axis ends
cmap=gray gray, hue, or default colormaps may be specified
552
GBBEAM - Gaussian beam synthetic seismograms for a sloth model
Required Parameters:
xg= x coordinates of receiver surface
zg= z coordinates of receiver surface
Optional Parameters:
ng=101 number of receivers (uniform distributed along surface)
krecord=1 integer index of receiver surface (see notes below)
ang=0.0 array of angles corresponding to amplitudes in amp
amp=1.0 array of amplitudes corresponding to angles in ang
bw=0 beamwidth at peak frequency
nt=251 number of time samples
dt=0.004 time sampling interval
ft=0.0 first time sample
reftrans=0 =1 complex refl/transm. coefficients considered
prim =1, only single-reflected rays are considered ",
=0, only direct hits are considered
atten=0 =1 add noncausal attenuation
=2 add causal attenuation
lscale= if defined restricts range of extrapolation
aperture= maximum angle of receiver aperture
fpeak=0.1/dt peak frequency of ricker wavelet
infofile ASCII-file to store useful information
NOTES:
Only rays that terminate with index krecord will contribute to the
synthetic seismograms at the receiver (xg,zg) locations. The
receiver locations are determined by cubic spline interpolation
of the specified (xg,zg) coordinates.
553
NORMRAY - dynamic ray tracing for normal incidence rays in a sloth model
Optional Parameters:
caustic 0: show all rays 1: show only caustic rays
nonsurface 0: show rays which reach surface 1: show all rays
surface 0: shot ray from subsurface 1: from surface
nrays number of location to shoot rays
dangle increment of ray angle for one location
nangle number of rays shot from one location
ashift shift first taking off angle
xs1 x of shooting location
zs1 z of shooting location
nangle=101 number of takeoff angles
fangle=-45 first takeoff angle (in degrees)
rayfile file of ray x,z coordinates of ray-edge intersections
nxz=101 number of (x,z) in optional rayfile (see notes below)
wavefile file of ray x,z coordinates uniformly sampled in time
nt=101 number of (x,z) in optional wavefile (see notes below)
infofile ASCII-file to store useful information
fresnelfile used if you want to plot the fresnel volumes.
default is <fresnelfile.bin>
outparfile contains parameters for the plotting software.
default is <outpar>
krecord if specified, only rays incident at interface with index
krecord are displayed and stored
prim =1, only single-reflected rays are plotted ",
=0, only direct hits are displayed
ffreq=-1 FresnelVolume frequency
refseq=1,0,0 index of reflector followed by sequence of reflection (1)
transmission(0) or ray stops(-1).
The default rayend is at the model boundary.
NOTE:refseq must be defined for each reflector
NOTES:
The rayends file contains ray parameters for the locations at which
the rays terminate.
554
The time sampling interval in the wavefile is tmax/(nt-1),
where tmax is the maximum time for all rays.
Notes:
This code can shoot rays from specified interface by users, normally you
need to use gbmodel2 to generate interface parameters for this code, both
code have a parameter named nrays, it should be same. If you just want to
shoot rays from one specified location, you need to specify xs1,zs1,
otherwise, leave them alone. If you want to shoot rays from surface, you need
to define surface equal to 1. The rays from one location will be
approximately symetric with direction Normal_direction - ashift.(if nangle is
odd, it is symetric, even, almost symetric. The formula for the first take
off angle is: angle=normal_direction-nangle/2*dangle-ashift. If you only want to
see caustics, you specify caustic=1, if you want to see rays which does not
reach surface, you specify nonsurface=1.
/
555
TRI2UNI - convert a TRIangulated model to UNIformly sampled model
Required Parameters:
n1= number of samples in the first (fast) dimension
n2= number of samples in the second dimension
Optional Parameters:
d1=1.0 sampling interval in first (fast) dimension
d2=1.0 sampling interval in second dimension
f1=0.0 first value in dimension 1 sampled
f2=0.0 first value in dimension 2 sampled
Note:
The triangulated/uniformly-sampled quantity is assumed to be sloth=1/v^2
556
TRIMODEL - make a triangulated sloth (1/velocity^2) model
Optional Parameters:
xmin=0.0 minimum horizontal coordinate (x)
xmax=1.0 maximum horizontal coordinate (x)
zmin=0.0 minimum vertical coordinate (z)
zmax=1.0 maximum vertical coordinate (z)
xedge= x coordinates of an edge
zedge= z coordinates of an edge
sedge= sloth along an edge
kedge= array of indices used to identify edges
normray 0:do not generate parameters 1: does it
normface specify which interface to shoot rays
nrays number of locations to shoot rays
sfill= x, z, x0, z0, s00, dsdx, dsdz to fill a region
densfill= x, z, dens to fill a region
qfill= x, z, Q-factor to fill a region
maxangle=5.0 maximum angle (deg) between adjacent edge segments
Notes:
More than set of xedge, zedge, and sedge parameters may be
specified, but the numbers of these parameters must be equal.
557
AUTHOR: Dave Hale, Colorado School of Mines, 02/12/91
MODIFIED: Andreas Rueger, Colorado School of Mines, 01/18/93
Fill regions with attenuation Q-factors and density values.
MODIFIED: Craig Artley, Colorado School of Mines, 03/27/94
Corrected bug in computing s00 in makeSlothForTri() function.
MODIFIED: Boyi Ou, Colorado School of Mines, 4/14/95
Make code to generate interface parameters for shooting rays
from specified interface
NOTE:
When you use normface to specify interface, the number of interface might
not be the number of interface in the picture, for example, you build a one
interface model, this interface is very long, so in the shell, you use three
part of xedge,zedge,sedge to make this interface, so when you use normface to
specify interface, this interface is just part of whole interface. If you
want see the normal rays from entire interface, you need to maek normal ray
picture few times, and merge them together.
558
TRIRAY - dynamic RAY tracing for a TRIangulated sloth model
Optional Parameters:
xs=(max-min)/2 x coordinate of source (default is halfway across model)
zs=min z coordinate of source (default is at top of model)
nangle=101 number of takeoff angles
fangle=-45 first takeoff angle (in degrees)
langle=45 last takeoff angle (in degrees)
rayfile= file of ray x,z coordinates of ray-edge intersections
nxz=101 number of (x,z) in optional rayfile (see notes below)
wavefile= file of ray x,z coordinates uniformly sampled in time
nt=101 number of (x,z) in optional wavefile (see notes below)
infofile= ASCII-file to store useful information
fresnelfile= used if you want to plot the fresnel volumes.
default is <fresnelfile.bin>
outparfile= contains parameters for the plotting software.
default is <outpar>
krecord= if specified, only rays incident at interface with index
krecord are displayed and stored
prim= =1, only single-reflected rays are plotted
=0, only direct hits are displayed
ffreq=-1 FresnelVolume frequency
refseq=1,0,0 index of reflector followed by sequence of reflection (1)
transmission(0) or ray stops(-1).
The default rayend is at the model boundary.
NOTE:refseq must be defined for each reflector
NOTES:
The rayends file contains ray parameters for the locations at which
the rays terminate.
559
for the plotting software.
560
TRISEIS - Gaussian beam synthetic seismograms for a sloth model
Required Parameters:
xs= x coordinates of source surface
zs= z coordinates of source surface
xg= x coordinates of receiver surface
zg= z coordinates of receiver surface
Optional Parameters:
ns=1 number of sources uniformly distributed along s surface
ds= increment between source locations (see notes below)
fs=0.0 first source location (relative to start of s surface)
ng=101 number of receivers uniformly distributed along g surface
dg= increment between receiver locations (see notes below)
fg=0.0 first receiver location (relative to start of g surface)
dgds=0.0 change in receiver location with respect to source location
krecord=1 integer index of receiver surface (see notes below)
kreflect=-1 integer index of reflecting surface (see notes below)
prim =1, only single-reflected rays are considered ",
=0, only direct hits are considered
bw=0 beamwidth at peak frequency
nt=251 number of time samples
dt=0.004 time sampling interval
ft=0.0 first time sample
nangle=101 number of ray takeoff angles
fangle=-45 first ray takeoff angle (in degrees)
langle=45 last ray takeoff angle (in degrees)
reftrans=0 =1 complex refl/transm. coefficients considered
atten=0 =1 add noncausal attenuation
=2 add causal attenuation
lscale= if defined restricts range of extrapolation
fpeak=0.1/dt peak frequency of ricker wavelet
aperture= maximum angle of receiver aperture
NOTES:
Only rays that terminate with index krecord will contribute to the
synthetic seismograms at the receiver (xg,zg) locations. The
source and receiver locations are determined by cubic spline
interpolation of the specified (xs,zs) and (xg,zg) coordinates.
The default source location increment (ds) is determined to span
the source surface defined by (xs,zs). Likewise for dg.
561
AUTHOR: Dave Hale, Colorado School of Mines, 02/09/91
MODIFIED: Andreas Rueger, Colorado School of Mines, 08/18/93
Modifications include: 2.5-D amplitudes, correction for ref/transm,
timewindow, lscale, aperture, beam width, etc.
562
UNI2TRI - convert UNIformly sampled model to a TRIangulated model
Required Parameters:
n1= number of samples in first (fast) dimension
n2= number of samples in second dimension
Optional Parameters:
d1=1.0 sampling interval in dimension 1
d2=1.0 sampling interval in dimension 2
f1=0.0 first value in dimension 1
f2=0.0 first value in dimesion 2
ifile= triangulated model file used as initial model
errmax= maximum sloth error (see notes below)
verbose=1 =0 for silence
=1 to report maximum error at each stage to stderr
=2 to also write the normalized error to efile
efile=emax.dat filename for error file (for verbose=2)
mm=0 output every mm-th intermediate model (0 for none)
mfile=intmodel intermediate models written to intmodel%d
method=3 =1 add 1 vertex at maximum error
=2 add vertex to every triangle that exceeds errmax
=3 method 2, but avoid closely spaced vertices
tol=10 closeness criterion for (in samples)
sfill= x, z, x0, z0, s00, dsdx, dsdz to fill a region
Notes:
Triangles are constructed until the maximum error is
not greater than the user-specified errmax. The default errmax
is 1% of the maximum value in the sampled input file.
After the uniform values have been triangulated, the optional sfill
parameters are used to fill closed regions bounded by fixed edges.
Let (x,z) denote any point inside a closed region. Values inside
this region is determined by s(x,z) = s00+(x-x0)*dsdx+(z-z0)*dsdz.
The (x,z) component of the sfill parameter is used to identify a
closed region.
563
AUTHOR: Craig Artley, Colorado School of Mines, 03/31/94
NOTE: After a program outlined by Dave Hale, 12/27/90.
564
SPSPLOT - plot a triangulated sloth function s(x,z) via PostScript
Optional Parameters:
gedge=0.0 gray to draw fixed edges (in interval [0.0,1.0])
gtri=1.0 gray to draw non-fixed edges of triangles
gmin=0.0 min gray to shade triangles (in interval [0.0,1.0])
gmax=1.0 max gray to shade triangles (in interval [0.0,1.0])
sgmin=minimum s(x,z) s(x,y) corresponding to gmin
sgmax=maximum s(x,z) s(x,y) corresponding to gmax
xbox=1.5 offset in inches of left side of axes box
ybox=1.5 offset in inches of bottom side of axes box
wbox=6.0 width in inches of axes box
hbox=8.0 height in inches of axes box
xbeg=xmin value at which x axis begins
xend=xmax value at which x axis ends
dxnum=0.0 numbered tic interval on x axis (0.0 for automatic)
fxnum=xmin first numbered tic on x axis (used if dxnum not 0.0)
nxtic=1 number of tics per numbered tic on x axis
gridx=none grid lines on x axis - none, dot, dash, or solid
labelx= label on x axis
zbeg=zmin value at which z axis begins
zend=zmax value at which z axis ends
dznum=0.0 numbered tic interval on z axis (0.0 for automatic)
fznum=zmin first numbered tic on z axis (used if dynum not 0.0)
nztic=1 number of tics per numbered tic on z axis
gridz=none grid lines on z axis - none, dot, dash, or solid
labelz= label on z axis
labelfont=Helvetica font name for axes labels
labelsize=12 font size for axes labels
title= title of plot
titlefont=Helvetica-Bold font name for title
titlesize=24 font size for title
titlecolor=black color of title
axescolor=black color of axes
gridcolor=black color of grid
style=seismic normal (z axis horizontal, x axis vertical) or
seismic (z axis vertical, x axis horizontal)
565
AUTHOR: Dave Hale, Colorado School of Mines, 10/18/90
MODIFIED: Craig Artley, Colorado School of Mines, 03/27/94
Tweaks to improve PostScript header, add basic color support.
566
Shells:
______
ARGV - give examples of dereferencing char **argv
Usage: argv
______
COPYRIGHT - insert CSM COPYRIGHT lines at top of files in working directory
______
CPALL , RCPALL - for local and remote directory tree/file transfer
______
CWPFIND - look for files with patterns in CWPROOT/src/cwp/lib
______
DIRTREE - show DIRectory TREE
Usage: dirtree
567
______
FILETYPE - list all files of given type
Examples:
filetype text - list printable files
filetype stripped - list unstripped files
______
Grep - recursively call egrep in pwd
______
NEWCASE - Changes the case of all the filenames in a directory, dir
______
OVERWRITE - copy stdin to stdout after EOF
______
PRECEDENCE - give table of C precedences from Kernighan and Ritchie
Usage: precedence
______
REPLACE - REPLACE string1 with string2 in files
568
______
THIS_YEAR - print the current year
Usage: this_year
______
TIME_NOW - prints time in ZULU format with no spaces
Usage: time_now
______
TODAYS_DATE - prints today’s date in ZULU format with no spaces
Usage: todays_date
______
USERNAMES - get list of all login names
Usage: usernames
______
VARLIST - list variables used in a Fortran program
______
WEEKDAY - prints today’s WEEKDAY designation
Usage: weekday
569
______
ZAP - kill processes by name
Typical usages:
zap ximage
zap ’xmovie|xgraph’
570
______
GENDOCS - generate complete list of selfdocs in latex form
______
STRIPTOTXT - put files from $CWPROOT/src/doc/Stripped into a new
directory in the form $CWPROOT/src/TXT/NAME.txt
Usage: striptotxt
______
UPDATEDOCALL - put self-docs in ../doc/Stripped
Usage: updatedocall
______
UPDATEDOC - put self-docs in ../doc/Stripped and ../doc/Headers
Notes:
Paths include: cwp/main cwp/lib cwp/shell par/main par/lib par/shell
xplot/main xplot/lib psplot/main psplot/lib psplot/shell
Xtcwp/main Xtcwp/lib su/main su/lib su/shell su/graphics/psplot
su/graphics/xplot tri/main tri/lib xtri tri/graphics/psplot
tetra/lib tetra/main
comp/dct/lib comp/dct/main comp/dct/libutil comp/dwpt/1d/lib
comp/dwpt/1d/main comp/dwpt/2d/lib comp/dwpt/2d/main
______
UPDATEHEAD - update ../doc/Headers/Headers.all
571
Usage: updatehead
Notes:
572
______
LOOKPAR - show getpar lines in SU code with defines evaluated
______
MAXDIFF - find absolute maximum difference in two segy data sets
______
RECIP - sum opposing (reciprocal) offsets in cdp sorted data
______
RMAXDIFF - find percentage maximum difference in two segy data sets
______
SUAGC - perform agc on SU data
______
SUBAND - Trapezoid-like Sin squared tapered Bandpass filter via SUFILTER
Note: this shell mimmics the old program SUBAND, supersceded by SUFILTER
See selfdoc of: sufilter for more information
______
SUDIFF, SUSUM, SUPROD, SUQUO, SUPTDIFF, SUPTSUM,
SUPTPROD, SUPTQUO - difference, sum, product, quotient of two SU data
sets via suop2
Usage:
573
sudiff file1 file2 > stdout
susum file1 file2 > stdout
...etc
______
SUDOC - get DOC listing for code
______
SUENV - Instantaneous amplitude, frequency, and phase via: SUATTRIBUTES
Note: this shell mimmics the old program SUENV, supersceded by SUATTRIBUTES
See selfdoc of: suattributes for more information
______
SUFIND - get info from self-docs
______
SUFIND - get info from self-docs
574
______
SUGENDOCS - generate complete list of selfdocs in latex form
______
SUHELP - list the CWP/SU programs and shells
Usage: suhelp
______
SUKEYWORD -- guide to SU keywords in segy.h
______
SUNAME - get name line from self-docs
Note: dummy selfdocs have been included in all cwp and shell programs
that don’t have automatic selfdocs.
______
UNGLITCH - zonk outliers in data
Note: this shell just invokes: sugain < stdin qclip=.99 > stdout
See selfdoc of: sugain for further information
575
______
MERGE2 - put 2 standard size PostScript figures on one page
Notes: Translation values are hard-coded numbers that work well for
standard size (8.5 x 11) figures.
See selfdoc of: psmerge for details
______
MERGE4 - put 4 standard size PostScript plots on one page
Note: Translation values are hard-coded numbers that work well for
standard size (8.5 x 11) figures.
See selfdoc of: psmerge for further information
576
Libs:
577
fontwidth return maximum width for specified font and size
fontcapheight return maximum capheight for specified font and size
fontxheight return maximum xheight for specified font and size
fontdescender return maximum descender for specified font and size
polyline draw a segmented line
markto draw a mark at specified location
rectclip set a rectangular clipping path
rectfill draw a filled rectangle
strokerect stroke a rectangle
Function Prototypes:
void beginps (void);
void endps (void);
void begineps (void);
void endeps (void);
void newpage (const char *label, int ordinal);
void boundingbox (int llx, int lly, int urx, int ury);
void showpage (void);
void gsave (void);
void grestore (void);
void newpath (void);
void closepath (void);
void clip(void);
void translate (float tx, float ty);
void scale (float sx, float sy);
void rotate (float angle);
void concat (float m[]);
void setgray (float gray);
void setrgbcolor (float red, float green, float blue);
void setcolor (const char *name);
void setlinewidth (float width);
void setlinejoin (int code);
void setdash (float dash[], int ndash, float offset);
void moveto (float x, float y);
void rmoveto (float x, float y);
void lineto (float x, float y);
void rlineto (float x, float y);
void arc (float x, float y, float r, float ang1, float ang2);
void stroke (void);
void fill (void);
void show (const char *str);
void justshow (float just, const char *str);
void image (int w, int h, int bps, float m[], unsigned char *samples);
578
void rgbimage (int w, int h, int bpc, float m[], unsigned char *samples);
void setfont (const char *fontname, float fontsize);
void fontbbox (const char *fontname, float fontsize, float bbox[]);
float fontheight (const char *fontname, float fontsize);
float fontwidth (const char *fontname, float fontsize);
float fontcapheight (const char *fontname, float fontsize);
float fontxheight (const char *fontname, float fontsize);
float fontdescender (const char *fontname, float fontsize);
float fontascender (const char *fontname, float fontsize);
void polyline (const float *x, const float *y, int n);
void markto (float x, float y, int index, float size);
void rectclip (float x, float y, float width, float height);
void rectfill (float x, float y, float width, float height);
void rectstroke (float x, float y, float width, float height);
justshow:
Input:
just justification factor
str string
image:
Input:
w width of image (in samples)
h height of image (in samples)
bps number of bits per sample
m array[6] containing image matrix
samples array[w*h] of sample values
rgbimage:
Input:
w width of image (in samples)
h height of image (in samples)
bpc number of bits per component
m array[6] containing image matrix
samples array[3*w*h] of sample values
polyline:
Input:
x array[n] of x-coordinates
y array[n] of y-coordinates
n number of points
markto:
579
Input:
x x-coordinate of mark
y y-coordinate of mark
index type of mark to draw
size size of mark
rectclip:
Input:
x x-coordinate of clipping path origin
y y-coordinate of clipping path origin
width width of clipping path
height height of clipping path
rectfill:
Input:
x x-coordinate of rectangle origin
y y-coordinate of rectangle origin
width width of rectangle
height height of rectangle
strokerect:
Input:
x x-coordinate of rectangle origin
y y-coordinate of rectangle origin
width width of rectangle
height height of rectangle
Notes:
The majority of these routines are self explanatory. They are just
C wrappers that echo PostScript graphics commands.
justshow:
The justification factor positions the string relative to the current point.
just" may assume any value, but the common uses are:
-1.0 right-justify the string
-0.5 center the string on the current point
0.0 left-justify the string (like using "show")
image:
Level 1 PostScript implementations support 1, 2, 4, and 8 bits per
sample. Level 2 adds support for 12 bits per sample.
Samples are hex-encoded, and output lines are limited to 78 characters.
580
rgbimage:
In general, Level 1 PostScript implementations do not support rgbimage.
Level 2 supports 1, 2, 4, 8, and 12 bits per color component. The
samples array should contain three color components (in R,G,B... order)
for each sample value. Samples are hex-encoded, and output lines are
limited to 78 characters.
polyline:
The path is stroked every 200 points.
References:
581
PSAXESBOX3 - Functions draw an axes box via PostScript, estimate bounding box
these are versions of psAxesBox and psAxesBox3 for psmovie.
Function Prototypes:
void psAxesBox3(
float x, float y, float width, float height,
float x1Beg, float x1End, float p1Beg, float p1End,
float d1Num, float f1Num, int n1Tic, int grid1, char *label1,
float x2Beg, float x2End, float p2Beg, float p2End,
float d2Num, float f2Num, int n2Tic, int grid2, char *label2,
char *labelFont, float labelSize,
char *title, char *titleFont, float titleSize,
int style, char *title2);
void psAxesBBox3(
float x, float y, float width, float height,
char *labelFont, float labelSize,
char *titleFont, float titleSize,
int style, int bbox[]);
Input:
x x coordinate of lower left corner of box
y y coordinate of lower left corner of box
width width of box
height height of box
x1Beg axis value at beginning of axis 1
x1End axis value at end of axis 1
p1Beg pad value at beginning of axis 1
p1End pad value at end of axis 1
d1Num numbered tic increment for axis 1 (0.0 for automatic)
f1Num first numbered tic for axis 1
n1Tic number of horizontal tics per numbered tic for axis 1
grid1 grid code for axis 1: NONE, DOT, DASH, or SOLID
label1 label for axis 1
x2Beg axis value at beginning of axis 2
x2End axis value at end of axis 2
p2Beg pad value at beginning of axis 2
p2End pad value at end of axis 2
d2Num vertical numbered tic increment (0.0 for automatic)
f2Num first numbered vertical tic
n2Tic number of vertical tics per numbered tic
582
grid2 grid code for vertical axis: NONE, DOT, DASH, or SOLID
label2 vertical axis label
labelFont name of font to use for axes labels
labelSize size of font to use for axes labels
title axes box title
titleFont name of font to use for title
titleSize size of font to use for title
style NORMAL (axis 1 on bottom, axis 2 on left)
SEISMIC (axis 1 on left, axis 2 on top)
title2 second title
psAxesBBox3:
Input:
x x coordinate of lower left corner of box
y y coordinate of lower left corner of box
width width of box
height height of box
labelFont name of font to use for axes labels
labelSize size of font to use for axes labels
titleFont name of font to use for title
titleSize size of font to use for title
style NORMAL (axis 1 on bottom, axis 2 on left)
SEISMIC (axis 1 on left, axis 2 on top)
Output:
bbox bounding box (bbox[0:3] = llx, lly, ulx, uly)
Notes:
psAxesBox3:
psAxesBox will determine the numbered tic increment and first
numbered tic automatically, if the specified increment is zero.
psAxesBBox3:
psAxesBBox uses font sizes to estimate the bounding box for
an axes box drawn with psAxesBox. To be on the safe side,
psAxesBBox overestimates.
583
psAxesBBox assumes that the axes labels and titles do not extend
beyond the corresponding edges of the axes box.
References:
(see references in basic.c)
Author: Dave Hale, Colorado School of Mines, 06/27/89
modified by Zhiming Li, CSM, 7/1/90
584
PSAXESBOX - Functions to draw PostScript axes and estimate bounding box
Function Prototypes:
void psAxesBox(
float x, float y, float width, float height,
float x1Beg, float x1End, float p1Beg, float p1End,
float d1Num, float f1Num, int n1Tic, int grid1, char *label1,
float x2Beg, float x2End, float p2Beg, float p2End,
float d2Num, float f2Num, int n2Tic, int grid2, char *label2,
char *labelFont, float labelSize,
char *title, char *titleFont, float titleSize,
char *titleColor, char *axesColor, char *gridColor,
float ticwidth, float axeswidth, float gridwidth,
int style);
void psAxesBBox(
float x, float y, float width, float height,
char *labelFont, float labelSize,
char *titleFont, float titleSize,
int style, int bbox[]);
psAxesBox:
Input:
x x coordinate of lower left corner of box
y y coordinate of lower left corner of box
width width of box
height height of box
x1Beg axis value at beginning of axis 1
x1End axis value at end of axis 1
p1Beg pad value at beginning of axis 1
p1End pad value at end of axis 1
d1Num numbered tic increment for axis 1 (0.0 for automatic)
f1Num first numbered tic for axis 1
n1Tic number of horizontal tics per numbered tic for axis 1
grid1 grid code for axis 1: NONE, DOT, DASH, or SOLID
label1 label for axis 1
x2Beg axis value at beginning of axis 2
x2End axis value at end of axis 2
p2Beg pad value at beginning of axis 2
p2End pad value at end of axis 2
585
d2Num vertical numbered tic increment (0.0 for automatic)
f2Num first numbered vertical tic
n2Tic number of vertical tics per numbered tic
grid2 grid code for vertical axis: NONE, DOT, DASH, or SOLID
label2 vertical axis label
labelFont name of font to use for axes labels
labelSize size of font to use for axes labels
title axes box title
titleFont name of font to use for title
titleSize size of font to use for title
titleColor color to use for title
axesColor color to use for axes and axes labels
gridColor color to use for grid lines
axeswidth width (in points) of axes
ticwidth width (in points) of tic marks
gridwidth width (in points) of grid lines
style NORMAL (axis 1 on bottom, axis 2 on left)
SEISMIC (axis 1 on left, axis 2 on top)
psAxesBBox:
Input:
x x coordinate of lower left corner of box
y y coordinate of lower left corner of box
width width of box
height height of box
labelFont name of font to use for axes labels
labelSize size of font to use for axes labels
titleFont name of font to use for title
titleSize size of font to use for title
style NORMAL (axis 1 on bottom, axis 2 on left)
SEISMIC (axis 1 on left, axis 2 on top)
Output:
bbox bounding box (bbox[0:3] = llx, lly, ulx, uly)
Notes:
psAxesBox:
psAxesBox will determine the numbered tic increment and first numbered
tic automatically, if the specified increment is zero. Axis numbering
is in scientific notation, if necessary and is plotted to four
significant digits.
586
requires more space than implied by the axes values. For example, the
first and last seismic wiggle traces plotted inside an axes box will
typically extend beyond the axes values corresponding to the first and
last traces. However, all tics will lie with the limits specified in
the axes values (x1Beg, x1End, x2Beg, x2End).
psAxesBBox:
psAxesBBox uses font sizes to estimate the bounding box for
an axes box drawn with psAxesBox. To be on the safe side,
psAxesBBox overestimates.
psAxesBBox assumes that the axes labels and titles do not extend
beyond the corresponding edges of the axes box.
References:
(see References for basic.c)
Author: Dave Hale, Colorado School of Mines, 06/27/89
Modified: Ken Larner, Colorado School of Mines, 08/30/90
Modified: Dave Hale, Advance Geophysical, 10/18/92
Added color parameters for title, axes, and grid.
Modified: Morten Wendell Pedersen, Aarhus University, 23/3-97
Added ticwidth,axeswidth, gridwidth parameters
587
PSCAXESBOX - Draw an axes box for cube via PostScript
Function Prototype:
void psCubeAxesBox(
float x, float y, float size1, float size2, float size3, float angle,
float x1Beg, float x1End, float p1Beg, float p1End,
float d1Num, float f1Num, int n1Tic, int grid1, char *label1,
float x2Beg, float x2End, float p2Beg, float p2End,
float d2Num, float f2Num, int n2Tic, int grid2, char *label2,
float x3Beg, float x3End, float p3Beg, float p3End,
float d3Num, float f3Num, int n3Tic, int grid3, char *label3,
char *labelFont, float labelSize,
char *title, char *titleFont, float titleSize,
char *titleColor, char *axesColor, char *gridColor);
Input:
x x coordinate of lower left corner of box
y y coordinate of lower left corner of box
size1 size of 1st dimension of the input cube
size2 size of 2nd dimension of the input cube
size3 size of 3rd dimension of the input cube
angle projection angle of the cube
x1Beg axis value at beginning of axis 1
x1End axis value at end of axis 1
p1Beg pad value at beginning of axis 1
p1End pad value at end of axis 1
d1Num numbered tic increment for axis 1 (0.0 for automatic)
f1Num first numbered tic for axis 1
n1Tic number of tics for axis 1
grid1 grid code for axis 1: NONE, DOT, DASH, or SOLID
label1 label for axis 1
x2Beg axis value at beginning of axis 2
x2End axis value at end of axis 2
p2Beg pad value at beginning of axis 2
p2End pad value at end of axis 2
d2Num numbered tic increment for axis 2 (0.0 for automatic)
f2Num first numbered tic for axis 2
n2Tic number of tics for axis 2
grid2 grid code for axis 2: NONE, DOT, DASH, or SOLID
label2 label for axis 2
x3Beg axis value at beginning of axis 3
588
x3End axis value at end of axis 3
p3Beg pad value at beginning of axis 3
p3End pad value at end of axis 3
d3Num numbered tic increment for axis 3 (0.0 for automatic)
f3Num first numbered tic for axis 3
n3Tic number of tics for axis 3
grid3 grid code for axis 3: NONE, DOT, DASH, or SOLID
label3 label for axis 3
labelFont name of font to use for axes labels
labelSize size of font to use for axes labels
title axes box title
titleFont name of font to use for title
titleSize size of font to use for title
titleColor color to use for title
axesColor color to use for axes and axes labels
gridColor color to use for grid lines
Authors: Zhiming Li & Dave Hale, Colorado School of Mines, 6/90
Modified: Craig Artley, Colorado School of Mines, 3/12/93
Changed name to psCubeAxesBox (from psAxes3), fixed minor bugs.
Modified: Craig Artley, Colorado School of Mines, 12/16/93
Added color parameters for title, axes, and grid.
589
PSCONTOUR - draw contour of a two-dimensional array via PostScript
Function Prototype:
void psContour (float c, int nx, float x[], int ny, float y[], float z[],
float lcs, char *lcf, char *lcc, float *w, int nplaces);
Input:
c contour value
nx number of x-coordinates
x array of x-coordinates (see notes below)
ny number of y-coordinates
y array of y-coordinates (see notes below)
lcs font size of contour label
lcf font name of contour label
lcc color of contour label
LSB flag arrays (see Notes):
z array of nx*ny z(x,y) values (see notes below)
w array of nx*ny z(x,y) values (see notes below)
Notes:
The two-dimensional array z is actually passed as a one-dimensional
array containing nx*ny values, stored with nx fast and ny slow.
590
The w array is used to restrict the range of contour labeling that
occurs only if w<1.
north (0)
(ix,iy+1) --------- (ix+1,iy+1)
| cell |
west (3) | ix,iy | east (1)
| |
(ix,iy) --------- (ix+1,iy)
south (2)
Reference:
Cottafava, G. and Le Moli, G., 1969, Automatic contour map:
Commuincations of the ACM, v. 12, n. 7, July, 1969.
591
PSDRAWCURVE - Functions to draw a curve from a set of points
592
PSLEGENDBOX - Functions to draw PostScript axes and estimate bounding box
Function Prototypes:
void psLegendBox(
float x, float y, float width, float height,
float x1Beg, float x1End, float p1Beg, float p1End,
float d1Num, float f1Num, int n1Tic, int grid1, char *label1,
char *labelFont, float labelSize,
char *axesColor, char *gridColor,
int style);
void psLegendBBox(
float x, float y, float width, float height,
char *labelFont, float labelSize,
int style, int bbox[]);
psLegendBox:
Input:
x x coordinate of lower left corner of box
y y coordinate of lower left corner of box
width width of box
height height of box
x1Beg axis value at beginning of axis 1
x1End axis value at end of axis 1
p1Beg pad value at beginning of axis 1
p1End pad value at end of axis 1
d1Num numbered tic increment for axis 1 (0.0 for automatic)
f1Num first numbered tic for axis 1
n1Tic number of horizontal tics per numbered tic for axis 1
grid1 grid code for axis 1: NONE, DOT, DASH, or SOLID
label1 label for axis 1
labelFont name of font to use for axes labels
labelSize size of font to use for axes labels
axesColor color to use for axes and axes labels
gridColor color to use for grid lines
style VERTLEFT (Vertical, axis label on left side)
VERTRIGHT (Vertical, axis label on right side)
HORIBOTTOM (Horizontal, axis label on bottom)
593
psLegendBBox:
Input:
x x coordinate of lower left corner of box
y y coordinate of lower left corner of box
width width of box
height height of box
labelFont name of font to use for axes labels
labelSize size of font to use for axes labels
style VERTLEFT (Vertical, axis label on left side)
VERTRIGHT (Vertical, axis label on right side)
HORIBOTTOM (Horizontal, axis label on bottom)
Output:
bbox bounding box (bbox[0:3] = llx, lly, ulx, uly)
Notes:
psLegendBox:
psLegendBox will determine the numbered tic increment and first numbered
tic automatically, if the specified increment is zero. Axis numbering
is in scientific notation, if necessary and is plotted to four
significant digits.
psLegendBBox:
psLegendBBox uses font sizes to estimate the bounding box for
an Legend box drawn with psLegendBox. To be on the safe side,
psLegendBBox overestimates.
psLegendBBox assumes that the Legend labels and titles do not extend
beyond the corresponding edges of the Legend box.
References:
(see References for basic.c)
Author: Dave Hale, Colorado School of Mines, 06/27/89
Modified: Ken Larner, Colorado School of Mines, 08/30/90
Modified: Dave Hale, Advance Geophysical, 10/18/92
Added color parameters for title, axes, and grid.
594
Modified: Torsten Schoenfelder, Koeln, Germany, 07/06/97
Display a legend for ps file, move axis from left to right
Modified: Torsten Schoenfelder, Koeln, Germany, 10/02/98
Corrected width of bbox to include legend title
595
PSWIGGLE - draw wiggle-trace with (optional) area-fill via PostScript
Function Prototype:
void psWiggle (int n, float z[], float zmin, float zmax, float zbase,
float yzmin, float yzmax, float xfirst, float xlast, int fill);
Inputs:
n number of samples to draw
z array to draw
zmin z values below zmin will be clipped
zmax z values above zmax will be clipped
zbase z values between zbase and either zmin or zmax will be filled
yzmin y-coordinate corresponding to zmin
yzmax y-coordinate corresponding to zmax
xfirst x-coordinate corresponding to z[0]
xlast x-coordinate corresponding to z[n-1]
fill = 0 for no fill
> 0 for fill between zbase and zmax
< 0 for fill between zbase and zmin
+2 for fill solid between zbase and zmax grey between zbase and zmin
-2 for fill solid between zbase and zmin grey between zbase and zmax
SHADING: 2<= abs(fill) <=5 abs(fill)=2 light grey abs(fill)=5 black
NOTES:
psWiggle reduces PostScript output by eliminating linetos when
z values are essentially constant. The tolerance for detecting
constant" z values is ZEPS*(zmax-zmin), where ZEPS is a fraction
defined below.
596
AXESBOX - Functions to draw axes in X-windows graphics
Function Prototypes:
void xDrawAxesBox (Display *dpy, Window win,
int x, int y, int width, int height,
float x1beg, float x1end, float p1beg, float p1end,
float d1num, float f1num, int n1tic, int grid1, char *label1,
float x2beg, float x2end, float p2beg, float p2end,
float d2num, float f2num, int n2tic, int grid2, char *label2,
char *labelfont, char *title, char *titlefont,
char *axescolor, char *titlecolor, char *gridcolor,
int style);
void xSizeAxesBox (Display *dpy, Window win,
char *labelfont, char *titlefont, int style,
int *x, int *y, int *width, int *height);
xDrawAxesBox:
Input:
dpy display pointer
win window
x x coordinate of upper left corner of box
y y coordinate of upper left corner of box
width width of box
height height of box
x1beg axis value at beginning of axis 1
x1end axis value at end of axis 1
p1beg pad value at beginning of axis 1
p1end pad value at end of axis 1
d1num numbered tic increment for axis 1 (0.0 for automatic)
f1num first numbered tic for axis 1
n1tic number of tics per numbered tic for axis 1
grid1 grid code for axis 1: NONE, DOT, DASH, or SOLID
label1 label for axis 1
x2beg axis value at beginning of axis 2
x2end axis value at end of axis 2
p2beg pad value at beginning of axis 2
p2end pad value at end of axis 2
d2num numbered tic increment for axis 2 (0.0 for automatic)
f2num first numbered tic for axis 2
n2tic number of tics per numbered tic for axis 2
597
grid2 grid code for axis 2: NONE, DOT, DASH, or SOLID
label2 label for axis 2
labelfont name of font to use for axes labels
title axes box title
titlefont name of font to use for title
axescolor name of color to use for axes
titlecolor name of color to use for title
gridcolor name of color to use for grid
int style NORMAL (axis 1 on bottom, axis 2 on left)
SEISMIC (axis 1 on left, axis 2 on top)
xSizeAxesBox:
Input:
dpy display pointer
win window
labelfont name of font to use for axes labels
titlefont name of font to use for title
int style NORMAL (axis 1 on bottom, axis 2 on left)
SEISMIC (axis 1 on left, axis 2 on top)
Output:
x x coordinate of upper left corner of box
y y coordinate of upper left corner of box
width width of box
height height of box
{
XFontStruct *fa,*ft;
Notes:
xDrawAxesBox:
will determine the numbered tic incremenet and first
numbered tic automatically, if the specified increment is zero.
xSizeAxesBox:
is intended to be used prior to xDrawAxesBox.
598
An "optimal" axes box is one that more or less fills the window,
with little wasted space around the edges of the window.
599
COLORMAP - Functions to manipulate X colormaps:
Function Prototypes:
Status xCreateRGBDefaultMap (Display *dpy, XStandardColormap *scmap);
unsigned long xGetFirstPixel (Display *dpy);
unsigned long xGetLastPixel (Display *dpy);
Colormap xCreateRGBColormap (Display *dpy, Window win,
char *str_cmap, int verbose)
Colormap xCreateHSVColormap (Display *dpy, Window win,
char *str_cmap, int verbose)
xCreateRGBDefaultMap:
Input:
dpy display
Output:
scmap the standard colormap structure
xGetFirstPixel, xGetLastPixel:
Input:
dpy display
Notes:
PROBLEM
-------
600
one colormap can be installed in the display hardware at a time.
(Again, only 256 colors may be displayed at one time.) The window
manager is responsible for installing a window’s colormap when that
window becomes the key window.
SOLUTION
--------
601
Applications that require a contiguous range of read/write pixels
should allocate these pixels in their window’s private colormaps.
They should determine which contiguous pixels to allocate from
parameters in the standard colormap XA_RGB_DEFAULT_MAP. In particular,
the first pixel in the range of contiguous pixels should be
base_pixel
and the last pixel in the range should be
base_pixel+red_max*red_mult+green_max*green_mult+blue_max*blue_mult,
where base_pixel, red_max, etc. are members in the XStandardColormap
structure. On an 8-bit display, this range will typically provide 216
contiguous pixels, which may be set to a gray scale, color scale, or
whatever. This leaves 40 colors for drawing text, axes, etc.
602
may not contain the true colors. The colors used by the other
applications did not exist when the custom colormap was created.
One solution to this problem might be to initially allocate a
set of "common" colors in the default colormap before launching
any applications. This will increase the likelihood that typical
colors will be consistent among various colormaps.
xCreateRGBDefaultMap:
This function returns 0 if the XA_RGB_DEFAULT_MAP property does not exist
and cannot be created. At least 8 contiguous color cells must be free
in the default colormap to create the XA_RGB_DEFAULT_MAP. If created, the
red_max, green_max, and blue_max values returned in scmap will be equal.
xGetFirstPixel, xGetLastPixel:
If it does not already exist, XA_RGB_DEFAULT_MAP will be created.
If XA_RGB_DEFAULT_MAP does not exist and cannot be created, then
this function returns 0.
xCreateRGBColormap, xCreateHSVColormap:
The returned colormap is only created; the window’s colormap attribute
is not changed, and the colormap is not installed by this function.
The returned colormap is a copy of the window’s current colormap, but
with an RGB color scale allocated in the range of contiguous cells
determined by XA_RGB_DEFAULT_MAP. If it does not already exist,
XA_RGB_DEFAULT_MAP will be created.
603
DRAWCURVE - Functions to draw a curve from a set of points
604
IMAGE - Function for making the image in an X-windows image plot
Function Prototype:
XImage *xNewImage (Display *dpy, unsigned long pmin, unsigned long pmax,
int width, int height, float blank, unsigned char *bytes);
Input:
dpy display pointer
pmin minimum pixel value (corresponding to byte=0)
pmax maximum pixel value (corresponding to byte=255)
width number of bytes in x dimension
height number of bytes in y dimension
blank portion for blanking (0 to 1)
bytes unsigned bytes to be mapped to an image
605
LEGENDBOX - draw a labeled axes box for a legend (i.e. colorscale)
Function Prototype:
void xDrawLegendBox (Display *dpy, Window win,
int x, int y, int width, int height,
float bclip, float wclip, char *units, char *legendfont,
char *labelfont, char *title, char *titlefont,
char *axescolor, char *titlecolor, char *gridcolor,
int style);
Input:
dpy display pointer
win window
x x coordinate of upper left corner of box
y y coordinate of upper left corner of box
width width of box
height height of box
units label for legend
legendfont name of font to use for legend labels
labelfont name of font to use for axes labels
title axes box title
titlefont name of font to use for title
axescolor name of color to use for axes
titlecolor name of color to use for title
gridcolor name of color to use for grid
int style NORMAL (axis 1 on bottom, axis 2 on left)
SEISMIC (axis 1 on left, axis 2 on top)
Notes:
xDrawLegendBox will determine the numbered tic incremenet and first
numbered tic automatically, if the specified increment is zero.
606
RUBBERBOX - Function to draw a rubberband box in X-windows plots
Function Prototype:
void xRubberBox (Display *dpy, Window win, XEvent event,
int *x, int *y, int *width, int *height);
Input:
dpy display pointer
win window ID
event event of type ButtonPress
Output:
x x of upper left hand corner of box in pixels
y y of upper left hand corner of box in pixels
width width of box in pixels
height height of box in pixels
Notes:
xRubberBox assumes that event is a ButtonPress event for the 1st button;
i.e., it tracks motion of the pointer while the 1st button is down, and
it sets x, y, w, and h and returns after a ButtonRelease event for the
1st button.
607
WINDOW - Function to create a window in X-windows graphics
Function Prototype:
Window xNewWindow (Display *dpy, int x, int y, int width, int height,
int border, int background, char *name);
Input:
dpy display pointer
x x in pixels of upper left corner
y y in pixels of upper left corner
width width in pixels
height height in pixels
border border pixel
background background pixel
name name of window (also used for icon)
Notes:
The parent window is the root window.
The border_width is 4 pixels.
608
XCONTOUR - draw contour of a two-dimensional array via X vectorplot calls
Function Prototype:
void xContour(Display *dpy, Window win,GC gcc, GC gcl,
float *cp,int nx, float x[], int ny, float y[], float z[],
char lcflag,char *lcf,char *lcc, float *w, int nplaces)
Input:
c contour value
nx number of x-coordinates
x array of x-coordinates (see notes below)
ny number of y-coordinates
y array of y-coordinates (see notes below)
lcf font name of contour label
lcc color of contour label
Least Significat Bits:
z array of nx*ny z(x,y) values (see notes below)
w array of nx*ny z(x,y) values (see notes below)
Notes:
The two-dimensional array z is actually passed as a one-dimensional
array containing nx*ny values, stored with nx fast and ny slow.
Since XDrawLine requires a start and end point, the use of a manually update
of the position variables x0 and y0 is used instead of conmove.
609
north (0)
(ix,iy+1) --------- (ix+1,iy+1)
| cell |
west (3) | ix,iy | east (1)
| |
(ix,iy) --------- (ix+1,iy)
south (2)
Reference:
Cottafava, G. and Le Moli, G., 1969, Automatic contour map:
Commuincations of the ACM, v. 12, n. 7, July, 1969.
610
AXES - the Axes Widget
Function Prototype:
Boolean XtcwpPointInAxesRectangle (Widget w, Position x, Position y);
void XtcwpSetAxesValues (Widget w, float x1beg, float x1end, float x2beg,
float x2end);
XtcwpSetAxesValues:
Input:
w axes widget
x1beg axis value at beginning of axis 1
x1end axis value at end of axis 1
x2beg axis value at beginning of axis 2
x2end axis value at end of axis 2
XtcwpSetAxesPads:
Input:
w axes widget
p1beg axis pad at beginning of axis 1
p1end axis pad at end of axis 1
p2beg axis pad at beginning of axis 2
p2end axis pad at end of axis 2
Notes:
XtcwpPointInAxesRectangle:
This function is useful for determining whether or not input events
occured with the pointer inside the axes rectangle. I.e., the input
callback function will typically call this function.
XtcwpSetAxesPads:
611
Pad values must be specified in the same units as the corresponding
axes values. These pads are useful when the contents of the axes box
require more space than implied by the axes values. For example, the
first and last seismic wiggle traces plotted inside an axes box
will typically extend beyond the axes values corresponding to the
first and last traces. However, all tics will lie within the limits
specified in the axes values (x1beg, x1end, x2beg, and x2end).
612
COLORMAP - Functions to manipulate X colormaps:
Function Prototypes:
Status XtcwpCreateRGBDefaultMap (Display *dpy, XStandardColormap *scmap);
unsigned long XtcwpGetFirstPixel (Display *dpy);
unsigned long XtcwpGetLastPixel (Display *dpy);
Colormap XtcwpCreateRGBColormap (Display *dpy, Window win);
Colormap XtcwpCreateGrayColormap (Display *dpy, Window win);
Colormap XtcwpCreateHueColormap (Display *dpy, Window win);
Colormap XtcwpCreateSatColormap (Display *dpy, Window win,
float fhue, float lhue, float wfrac, float bright)
XtcwpCreateRGBDefaultMap:
Input:
dpy display
Output:
scmap the standard colormap structure
XtcwpGetFirstPixel, XtcwpGetLastPixel:
Input:
dpy display
XtcwpCreateSatColormap:
613
Input:
dpy display
win window
fhue first hue in colormap (saturation=1)
lhue last hue in colormap (saturation=1)
wfrac fractional position of white within the colormap (saturation=0)
bright brightness
Notes:
PROBLEM
-------
614
application (perhaps for imaging) does not conflict with the pixels
used by other applications to draw text, clock hands, etc.
SOLUTION
--------
615
pixels to allocate for contiguous pixels.
XtcwpCreateRGBDefaultMap:
This function returns 0 if the XA_RGB_DEFAULT_MAP property does not exist
and cannot be created. At least 8 contiguous color cells must be free
in the default colormap to create the XA_RGB_DEFAULT_MAP. If created, the
red_max, green_max, and blue_max values returned in scmap will be equal.
XtcwpGetFirstPixel, XtcwpGetLastPixel:
If it does not already exist, XA_RGB_DEFAULT_MAP will be created.
If XA_RGB_DEFAULT_MAP does not exist and cannot be created, then
this function returns 0.
616
XtcwpCreateRGBColormap, XtcwpCreateGrayColormap, XtcwpCreateHueColormap,
XtcwpCreateSatColormap:
The returned colormap is only created; the window’s colormap attribute
is not changed, and the colormap is not installed by this function.
The returned colormap is a copy of the window’s current colormap, but
with an RGB color scale allocated in the range of contiguous cells
determined by XA_RGB_DEFAULT_MAP. If it does not already exist,
XA_RGB_DEFAULT_MAP will be created.
617
FX - Functions to support floating point coordinates in X
Function Prototypes:
int FMapFX (FGC fgc, float fx);
int FMapFY (FGC fgc, float fy);
int FMapFWidth (FGC fgc, float fwidth);
int FMapFHeight (FGC fgc, float fheight);
618
int FMapFAngle (FGC fgc, float fangle);
void FMapFPoint (FGC fgc, float fx, float fy, int *x_return, int *y_return);
void FMapFPoints (FGC fgc, FXPoint fpoints[], int npoints,
XPoint points_return[]);
float FMapX (FGC fgc, int x);
float FMapY (FGC fgc, int y);
float FMapWidth (FGC fgc, int width);
float FMapHeight (FGC fgc, int height);
float FMapAngle (FGC fgc, int angle);
void FMapPoint (FGC fgc, int x, int y, float *fx_return, float *fy_return);
void FMapPoints (FGC fgc, XPoint points[], int npoints,
FXPoint fpoints_return[]);
void FSetGC (FGC fgc, GC gc);
void FSetMap (FGC fgc, int x, int y, int width, int height,
float fx, float fy, float fwidth, float fheight);
void FSetClipRectangle(FGC fgc, float fxa, float fya, float fxb, float fyb);
void FClipOn (FGC fgc);
void FClipOff (FGC fgc);
int FClipPoint (FGC fgc, float fx, float fy);
int FClipLine (FGC fgc, float fx1, float fy1, float fx2, float fy2,
float *fx1c, float *fy1c, float *fx2c, float *fy2c);
int FClipRectangle (FGC fgc, float fx, float fy, float fwidth, float fheight,
float *fxc, float *fyc, float *fwidthc, float *fheightc);
FGC FXCreateFGC (GC gc, int x, int y, int width, int height,
float fx, float fy, float fwidth, float fheight);
void FXFreeFGC (FGC fgc);
void FXDrawPoint (Display *display, Drawable d, FGC fgc, float fx, float fy);
void FXDrawPoints (Display *display, Drawable d, FGC fgc,
FXPoint fpoints[], int npoints, int mode);
void FXDrawLine (Display *display, Drawable d, FGC fgc,
float fx1, float fy1, float fx2, float fy2);
void FXDrawLines (Display *display, Drawable d, FGC fgc,
FXPoint fpoints[], int npoints, int mode);
void FXDrawRectangle (Display *display, Drawable d, FGC fgc,
float fx, float fy, float fwidth, float fheight);
void FXDrawArc (Display *display, Drawable d, FGC fgc,
float fx, float fy, float fwidth, float fheight,
float fangle1, float fangle2);
void FXDrawString (Display *display, Drawable d, FGC fgc,
float fx, float fy, char *string, int length);
void FXFillRectangle (Display *display, Drawable d, FGC fgc,
float fx, float fy, float fwidth, float fheight);
619
Notes:
The functions defined below are designed to resemble the equivalent
X functions. For example, FXDrawLine() is analogous to XDrawLine.
Each of the FXDraw<xxx>() functions requires an FGC instead of a GC
(graphics context). An FGC contains a GC, along with the information
required to transform floating point coordinates to integer (pixel)
coordinates.
620
MISC - Miscellaneous X-Toolkit functions
Function Prototype:
void XtcwpDrawString90 (Display *dpy, Drawable d, GC gc,
int x, int y, char *string, int count);
Input:
dpy X display
d X drawable
gc X graphics context
x,y coordinates of baseline starting position of the string
string array[count] of characters to be drawn
count number of characters in string
621
RESCONV - general purpose resource type converters
Function Prototype:
void XtcwpStringToFloat (XrmValue *args, int *nargs,
XrmValue *fromVal, XrmValue *toVal);
622
RUBBERBOX - Function to draw a rubberband box in X-windows plots
Function Prototype:
void XtcwpRubberbox (Display *dpy, Window win, XEvent event,
int *x, int *y, int *width, int *height);
Input:
dpy display pointer
win window ID
event event of type ButtonPress
Output:
x x of upper left hand corner of box in pixels
y y of upper left hand corner of box in pixels
width width of box in pixels
height height of box in pixels
Notes:
XtcwpRubberbox assumes that event is a ButtonPress event for the 1st button;
i.e., it tracks motion of the pointer while the 1st button is down, and
it sets x, y, w, and h and returns after a ButtonRelease event for the
1st button.
623
RADIOBUTTONS - convenience functions creating and using radio buttons
Function Prototypes:
Widget XtcwpCreateStringRadioButtons (Widget parent, char *label,
int nstrings, char **strings, int first,
void (*callback)(int selected, void *clientdata), void *clientdata);
Input:
parent parent widget
label label for this collection of radio bottons
nstrings number of strings
strings array[nstrings] of character strings, one per button
first index of button to be initially selected
callback function called when radio buttons change state
clientdata pointer to client data to be passed to callback
Notes:
This code depends on the Motif Developer’s Package.
An integer index of the selected button (along with the clientdata pointer)
is passed to the callback function.
624
SAMPLES - Motif-based Graphics Functions
samplesCreate
samplesDraw
samplesSetN
samplesSetData
samplesSetPlotValue
samplesSetEditMode
samplesSetOrigin
Function Prototypes:
Samples *samplesCreate (Widget parent, char *title,
void (*editDone)(Samples *s));
void samplesDraw (Samples *s);
void samplesSetN (Samples *s, int n);
void samplesSetData (Samples *s, float *d);
void samplesSetPlotValue (Samples *s, float pv);
void samplesSetEditMode (Samples *s, EditMode m);
void samplesSetOrigin (Samples *s, int i);
Notes:
Watch this space.
625
fgethdr - get segy tape identification headers from the file by file pointer
Input:
fp file pointer
Output:
chdr 3200 bytes of segy character header
bhdr 400 bytes of segy binary header
Authors: zhiming li and j. dulac , unocal
modified for CWP/SU: R. Beardsley
626
FGETTR - Routines to get an SU trace from a file
Function Prototype:
int fgettr(FILE *fp, segy *tp);
int fvgettr(FILE *fp, segy *tp);
int fgettra(FILE *fp, segy *tp, int itr);
Returns:
fgettr, fvgettr:
int: number of bytes read on current trace (0 after last trace)
fgettra:
int: number of traces in disk file
Usage example:
segy tr;
...
while (gettr(&tr)) {
tr.offset = abs(tr.offset);
puttr(&tr);
}
...
Authors: SEP: Einar Kjartansson, Stew Levin CWP: Shuki Ronen, Jack Cohen
627
Set lastfp on nread <=0 return, too.
Revised: 28 Mar, 2006 Stewart A. Levin Landmark Graphics
Reworked XDR to support random seeks on > 2GB files
and to read big endian SHORTPACK data on little endian machines.
628
FPUTTR - Routines to put an SU trace to a file
Function Prototype:
void fputtr(FILE *fp, segy *tp);
void fvputtr(FILE *fp, segy *tp);
Returns:
void
Notes:
Usage example:
segy tr;
...
while (gettr(&tr)) {
tr.offset = abs(tr.offset);
puttr(&tr);
}
...
Authors: SEP: Einar Kjartansson, Stew Levin CWP: Shuki Ronen, Jack Cohen
629
HDRPKGE - routines to access the SEGY header via the hdr structure.
getindex get the index of a trace header word from the name
Function Prototypes:
void gethval(const segy *tr, int index, Value *valp);
void puthval(segy *tr, int index, Value *valp);
void putbhval(bhed *bh, int index, Value *valp);
void getbhval(const bhed *bh, int index, Value *valp);
void gethdval(const segy *tr, char *key, Value *valp);
void puthdval(segy *tr, char *key, Value *valp);
char *hdtype(const char *key);
char *getkey(const int index);
int getindex(const char *key);
void swaphval(segy *tr, int index);
void swapbhval(bhed *bh, int index);
void gettapehval(tapesegy *tapetr, int index, Value *valp);
void puttapehval(tapesegy *tapetr, int index, Value *valp);
void gettapebhval(tapebhed *tapetr, int index, Value *valp);
void puttapebhval(tapebhed *tapetr, int index, Value *valp);
void printheader(const segy *tp);
Notes:
This package includes only those routines that directly access
630
the "hdr" or "bhdr" structures. It does not include routines
such as printfval, printftype, printfhead that use the routines
in this package to indirectly access these structures.
Note that while gethdval and puthdval are more convenient to use
than gethval and puthval, they incur an inefficiency in the
common case of iterating code over a set of traces with a fixed
key or keys. In such cases, it is advisable to set the index
or indices outside the loop using getindex.
swaphval:
Byte-swapping is needed for converting SU data from big-endian to little-
endian formats, and vice versa. The swap_.... subroutines are based
on subroutines provided by Jens Hartmann of the Institut fur Geophysik
in Hamburg. These are found in .../cwp/lib/swapbyte.c.
Authors: SEP: Einar Kjartansson CWP: Jack Cohen, Shuki Ronen
swaphval: CWP: John Stockwell
631
TABPLOT - TABPLOT selected sample points on selected trace
Function Prototype:
void tabplot(segy *tp, int itmin, int itmax);
Input:
tp pointer to a segy
itmin minimum time sample printed
itmax maximum time sample printed
632
VALPKGE - routines to handle variables of type Value
Function Prototypes:
int vtoi(register cwp_String type, Value val);
long vtol(register cwp_String type, Value val);
float vtof(register cwp_String type, Value val);
double vtod(register cwp_String type, Value val);
void atoval(cwp_String type, cwp_String keyval, Value *valp);
Value valtoabs(cwp_String type, Value val);
int valcmp(register cwp_String type, Value val1, Value val2);
void printfval(register cwp_String type, Value val);
void fprintfval(FILE *stream, register cwp_String type, Value val);
void scanfval(register cwp_String type, Value *valp);
Notes:
A Value is defined by the following in .../su/include/su.h:
633
The use of the valpkge routines, as well as the hdrpkge routines,
permits the user to change the definition of the types of the
various fields of the segy data type, without breaking codes that
look at part or all of these fields.
634
ABEL - Functions to compute the discrete ABEL transform:
Function prototypes:
void *abelalloc (int n);
void abelfree (void *at);
void abel (void *at, float f[], float g[]);
Input:
ns number of samples in the data to be transformed
f[] array of floats, the function being transformed
Output:
at pointer to Abel transformer returned by abelalloc(int n)
g[] array of floats, the transformed data returned by
abel(*at,f[],g[])
Notes:
The Abel transform is defined by:
Infinity
g(y) = 2 Integral dx f(x)/sqrt(1-(y/x)^2)
|y|
References:
Hansen, E. W., 1985, Fast Hankel transform algorithm: IEEE Trans. on
Acoustics, Speech and Signal Processing, v. ASSP-33, n. 3, p. 666-671.
(Beware of several errors in the equations in this paper!)
Authors: Dave Hale and Lydia Deng, Colorado School of Mines, 06/01/90
635
AIRY - Approximate the Airy functions Ai(x), Bi(x) and their respective
derivatives Ai’(x), Bi’(x)
Function Prototypes:
float airya (float x);
float airyap (float x);
float airyb (float x);
float airybp (float x);
Input:
x value at which to evaluate Ai(x)
Returned:
airya Ai(x)
airypa Ai’(x)
airyb Bi(x)
airybp Bi’(x)
Reference:
The approximation is derived from tables and formulas in Abramowitz
and Stegun, p. 475-477.
636
ALLOC - Allocate and free multi-dimensional arrays
637
alloc6ushort allocate a 6-d array of unsigned shorts
free6ushort free a 6-d array of unsiged shorts
alloc1double allocate a 1-d array of doubles
realloc1double re-allocate a 1-d array of doubles
free1double free a 1-d array of doubles
alloc2double allocate a 2-d array of doubles
free2double free a 2-d array of doubles
alloc3double allocate a 3-d array of doubles
free3double free a 3-d array of doubles
alloc1complex allocate a 1-d array of complexs
realloc1complex re-allocate a 1-d array of complexs
free1complex free a 1-d array of complexs
alloc2complex allocate a 2-d array of complexs
free2complex free a 2-d array of complexs
alloc3complex allocate a 3-d array of complexs
free3complex free a 3-d array of complexs
Function Prototypes:
void *alloc1 (size_t n1, size_t size);
void *realloc1 (void *v, size_t n1, size_t size);
void free1 (void *p);
void **alloc2 (size_t n1, size_t n2, size_t size);
void free2 (void **p);
void ***alloc3 (size_t n1, size_t n2, size_t n3, size_t size);
void free3 (void ***p);
void ****alloc4 (size_t n1, size_t n2, size_t n3, size_t n4, size_t size);
void free4 (void ****p);
size_t size);
int *alloc1int (size_t n1);
int *realloc1int (int *v, size_t n1);
void free1int (int *p);
int **alloc2int (size_t n1, size_t n2);
void free2int (int **p);
int ***alloc3int (size_t n1, size_t n2, size_t n3);
void free3int (int ***p);
638
float *alloc1float (size_t n1);
float *realloc1float (float *v, size_t n1);
void free1float (float *p);
float **alloc2float (size_t n1, size_t n2);
void free2float (float **p);
float ***alloc3float (size_t n1, size_t n2, size_t n3);
void free3float (float ***p);
float ****alloc4float (size_t n1, size_t n2, size_t n3, size_t n4);
void free4float (float ****p);
size_t n6);
int ****alloc4int (size_t n1, size_t n2, size_t n3, size_t n4);
void free4int (int ****p);
size_t n5);
size_t n5);
size_t n5,size_t n6);
double *alloc1double (size_t n1);
double *realloc1double (double *v, size_t n1);
void free1double (double *p);
double **alloc2double (size_t n1, size_t n2);
void free2double (double **p);
double ***alloc3double (size_t n1, size_t n2, size_t n3);
void free3double (double ***p);
complex *alloc1complex (size_t n1);
complex *realloc1complex (complex *v, size_t n1);
void free1complex (complex *p);
complex **alloc2complex (size_t n1, size_t n2);
void free2complex (complex **p);
complex ***alloc3complex (size_t n1, size_t n2, size_t n3);
void free3complex (complex ***p);
Notes:
The functions defined below are intended to simplify manipulation
of multi-dimensional arrays in scientific programming in C. These
functions are useful only because true multi-dimensional arrays
639
in C cannot have variable dimensions (as in FORTRAN). For example,
the following function IS NOT valid in C:
void badFunc(a,n1,n2)
float a[n2][n1];
{
a[n2-1][n1-1] = 1.0;
}
However, the following function IS valid in C:
void goodFunc(a,n1,n2)
float **a;
{
a[n2-1][n1-1] = 1.0;
}
Therefore, the functions defined below do not allocate true
multi-dimensional arrays, as described in the C specification.
Instead, they allocate and initialize pointers (and pointers to
pointers) so that, for example, a[i2][i1] behaves like a 2-D array.
640
For example, to allocate and zero an n1 by n2 two-dimensional array
of floats, one could use
a = alloc2(n1,n2,sizeof(float));
zeroFloatArray(n1*n2,a[0]);
where zeroFloatArray is a function defined as
void zeroFloatArray(int n, float *a)
{
int i;
for (i=0; i<n; i++)
a[i] = 0.0;
}
641
ANTIALIAS - Butterworth anti-aliasing filter
Function Prototype:
void antialias (float frac, int phase, int n, float p[], float q[]);
Input:
frac current sampling interval / future interval (should be <= 1)
phase =0 for zero-phase filter; =1 for minimum-phase filter
n number of samples
p array[n] of input samples
Output:
q array[n] of output (anti-alias filtered) samples
Notes:
The anti-alias filter is a recursive (Butterworth) filter. For zero-phase
anti-alias filtering, the recursive filter is applied forwards and backwards.
642
AXB - Functions to solve a linear system of equations Ax=b by LU
decomposition, invert a square matrix or directly multiply an
inverse matrix by another matrix (without explicitely computing
the inverse).
Function prototypes:
void LU_decomposition (int nrows, float **matrix, int *idx, float *d);
void backward_substitution (int nrows, float **matrix, int *idx, float *b);
void inverse_matrix (int nrows, float **matrix);
void inverse_matrix_multiply (int nrows1, float **matrix1, int ncols2,
int nrows2, float **matrix2, float **out_matrix);
LU_decomposition:
Input:
nrows number of rows of matrix to invert
matrix matrix of coefficients in linear system Ax=b
Output:
matrix matrix containing LU decomposition (original matrix destroyed)
idx vector recording the row permutations effected by partial
pivoting
d +/- 1 depending on whether the number of row interchanges
was even or odd
backward_substitution
Input:
nrows number of rows (and columns) of input matrix
matrix matrix of coefficients (after LU decomposition)
idx permutation vector obtained from routine LU_decomposition
b right hand side vector in equation Ax=b
Output:
b vector with the solution
643
inverse_matrix
Input:
nrows number of rows (and columns) of input matrix
matrix matrix to invert
Output:
matrix inverse of input matrix
inverse_matrix_multiply
nrows1 number of rows (and columns) of matrix to invert
matrix1 square matrix to invert
ncols2 number of coulmns of second matrix
nrows2 number of rows of second matrix
matrix second matrix (multiplicator)
Output Parameters:
out_matrix matrix containing the product of the inverse of the first
matrix by the second one.
Note:
matrix1 and matrix2 are not destroyed, (not clobbered)
Notes:
To solve the set of linear equations Ax=b, first do the LU decomposition of
A (which will clobber A with its LU decomposition) and then do the backward
substitution with this new matrix and the right-hand side vector b. The vector
b will be clobbered with the solution. Both, the original matrix and vector B,
will have been destroyed.
The LU decomposition is carried out with the Crout’s method with implicit
partial pivoting that guaratees that the maximum pivot is used in every
step of the algorithm.
Once a linear system Ax=b has been solved, to solve another linear system
with the same matrix A but with different vetor b, ONLY the back substitution
has to be repeated with the new b (remember that the matrix in backsubstitution
is not the original matrix but its LU decomposition)
644
Refferences:
Press, Teukolsky, Vettering and Flannery, Numerical Recipes in C:
The art of scientific computing. Cambridge University Press.
second edition. (1992).
Golub and Van Loan, Matrix Computations. John Hopkins University Press.
Second Edition. (1989).
Horn and Johnson, Matrix Analysis. Cambridge University Press. (1985).
Credits:
Adapted from discussions in Numerical Recipes, by Gabriel Alvarez (1995)
645
BIGMATRIX - Functions to manipulate 2-dimensional matrices that are too big
to fit in real memory, but that are small enough to fit in
virtual memory:
Function Prototypes:
void *bmalloc (int nbpe, int n1, int n2);
void bmfree (void *bm);
void bmread (void *bm, int dir, int k1, int k2, int n, void *v);
void bmwrite (void *bm, int dir, int k1, int k2, int n, void *v);
bmalloc:
Input:
nbpe number of bytes per matrix element
n1 number of elements in 1st (fastest) dimension
n2 number of elements in 2nd (slowest) dimension
Returned:
bm pointer to big matrix
bmfree:
Input:
bm pointer to big matrix state (returned by bmalloc)
bmread:
Input:
bm pointer to big matrix state (returned by bmalloc)
d = 1 or 2: direction in which to read matrix elements
k1 1st dimension index of first matrix element to read
k2 2nd dimension index of first matrix element to read
n number of elements to read
Output:
v array[n] to contain matrix elements read
bmwrite:
Input:
bm pointer to big matrix state (returned by bmalloc)
d = 1 or 2: direction in which to write matrix elements
646
k1 1st dimension index of first matrix element to write
k2 2nd dimension index of first matrix element to write
n number of elements to write
v array[n] containing matrix elements to write
Notes:
The bm functions provide access to a big 2-dimensional matrix along
either the 1st or 2nd dimensions. Although, the matrix must be small
enough to fit in virtual memory, it may be too large to fit in real memory.
These functions provide equally efficient (or equally inefficient) access
to vectors in a big matrix along either the 1st or 2nd dimensions.
void *bm;
float *v;
bm = bmalloc(sizeof(float),n1,n2);
for (i2=0; i2<n2; i2++) {
(read n1 floats from input file into array v);
bmwrite(bm,1,0,i2,n1,(char*)v);
}
for (i1=0; i1<n1; i1++) {
bmread(bm,2,i1,0,n2,(char*)v);
(write n2 floats in array v to output file);
}
bmfree(bm);
647
BUTTERWORTH - Functions to design and apply Butterworth filters:
Function Prototypes:
void bfhighpass (int npoles, float f3db, int n, float p[], float q[]);
void bflowpass (int npoles, float f3db, int n, float p[], float q[]);
void bfdesign (float fpass, float apass, float fstop, float astop,
int *npoles, float *f3db);
bfdesign:
Input:
fpass frequency in pass band at which amplitude is >= apass
apass amplitude in pass band corresponding to frequency fpass
fstop frequency in stop band at which amplitude is <= astop
astop amplitude in stop band corresponding to frequency fstop
Output:
npoles number of poles
f3db frequency at which amplitude is sqrt(0.5) (-3 db)
Output:
q filtered array[n] (may be equivalent to p)
Notes:
(1) Nyquist frequency equals 0.5
(3) if (fpass<fstop)
648
bfdesign:
Butterworth filter: compute number of poles and -3 db frequency
for a low-pass or high-pass filter, given a frequency response
constrained at two frequencies.
649
COMPLEX - Functions to manipulate complex numbers
Structure:
typedef struct _complexStruct { complex number
float r,i;
} complex;
Function Prototypes:
complex cadd (complex a, complex b);
complex csub (complex a, complex b);
complex cmul (complex a, complex b);
complex cdiv (complex a, complex b);
float rcabs (complex z);
complex cmplx (float re, float im);
complex conjg (complex z);
complex cneg (complex z);
complex cinv (complex z);
complex csqrt (complex z);
complex cexp (complex z);
complex crmul (complex a, float x);
Notes:
The function "rcabs" was originally called "fcabs". This produced
a collision on some systems so a new name was chosen.
Reference:
Adapted from Press et al, 1988, Numerical Recipes in C (Appendix E).
650
Added function cinv().
651
COMPLEXD - Functions to manipulate double-precision complex numbers
Structure:
typedef struct _dcomplexStruct { dcomplex number
double r,i;
} dcomplex;
Function Prototypes:
dcomplex dcadd (dcomplex a, dcomplex b);
dcomplex dcsub (dcomplex a, dcomplex b);
dcomplex dcmul (dcomplex a, dcomplex b);
dcomplex dcdiv (dcomplex a, dcomplex b);
double drcabs (dcomplex z);
dcomplex dcmplx (double re, double im);
dcomplex dconjg (dcomplex z);
dcomplex dcneg (dcomplex z);
dcomplex dcinv (dcomplex z);
dcomplex dcsqrt (dcomplex z);
dcomplex dcexp (dcomplex z);
dcomplex dcrmul (dcomplex a, double x);
Notes:
The function "drcabs" was originally called "fcabs". This produced
a collision on some systems so a new name was chosen.
Reference:
Adapted from Press et al, 1988, Numerical Recipes in C (Appendix E).
652
Added function dcinv().
653
COMPLEXF - Subroutines to perform operations on complex numbers.
This set of functions complement the one in complex.c
of the CWP library
654
COMPLEXFD - Subroutines to perform operations on double complex numbers.
This set of functions complement the one in complexd.c
of the CWP library
655
CONVOLUTION - Compute z = x convolved with y
Input:
lx length of x array
ifx sample index of first x
x array[lx] to be convolved with y
ly length of y array
ify sample index of first y
y array[ly] with which x is to be convolved
lz length of z array
ifz sample index of first z
Output:
z array[lz] containing x convolved with y
Function Prototype:
void conv (int lx, int ifx, float *x, int ly, int ify, float *y,
int lz, int ifz, float *z);
Notes:
The operation z = x convolved with y is defined to be
ifx+lx-1
z[i] = sum x[j]*y[i-j] ; i = ifz,...,ifz+lz-1
j=ifx
The x samples are contained in x[0], x[1], ..., x[lx-1]; likewise for
the y and z samples. The sample indices of the first x, y, and z values
determine the location of the origin for each array. For example, if
z is to be a weighted average of the nearest 5 samples of y, one might
use
...
x[0] = x[1] = x[2] = x[3] = x[4] = 1.0/5.0;
conv(5,-2,x,lx,0,y,ly,0,z);
...
In this example, the filter x is symmetric, with index of first sample = -2.
656
CUBICSPLINE - Functions to compute CUBIC SPLINE interpolation coefficients
Input:
n number of samples
x array[n] of monotonically increasing or decreasing abscissae
y array[n] of ordinates
Output:
yd array[n][4] of cubic interpolation coefficients (see notes)
Notes:
The computed cubic spline coefficients are as follows:
yd[i][0] = y(x[i]) (the value of y at x = x[i])
yd[i][1] = y’(x[i]) (the 1st derivative of y at x = x[i])
yd[i][2] = y’’(x[i]) (the 2nd derivative of y at x = x[i])
yd[i][3] = y’’’(x[i]) (the 3rd derivative of y at x = x[i])
657
monotonic interpolant for monotonic data. 1st derivatives are set
to zero wherever first divided differences change sign.
The method used by "csplin" yields continuous 1st and 2nd derivatives.
References:
See Akima, H., 1970, A new method for
interpolation and smooth curve fitting based on local procedures,
Journal of the ACM, v. 17, n. 4, p. 589-602.
For more information, see Fritsch, F. N., and Carlson, R. E., 1980,
Monotone piecewise cubic interpolation: SIAM J. Numer. Anal., v. 17,
n. 2, p. 238-246.
Also, see the book by Kahaner, D., Moler, C., and Nash, S., 1989,
Numerical Methods and Software, Prentice Hall. This function was
derived from SUBROUTINE PCHEZ contained on the diskette that comes
with the book.
For more general information on spline functions of all types see the book by:
Greville, T.N.E, 1969, Theory and Applications of Spline Functions,
Academic Press.
658
DBLAS - Double precision Basic Linear Algebra subroutines
(adapted from LINPACK FORTRAN):
Function Prototypes:
int idamax (int n, double *sx, int incx);
double dasum (int n, double *sx, int incx);
void daxpy (int n, double sa, double *sx, int incx, double *sy, int incy);
void dcopy (int n, double *sx, int incx, double *sy, int incy);
double ddot (int n, double *sx, int incx, double *sy, int incy);
double dnrm2 (int n, double *sx, int incx);
void dscal (int n, double sa, double *sx, int incx);
void dswap (int n, double *sx, int incx, double *sy, int incy);
idmax:
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
Returned:
index of element with maximum absolute value (idamax)
dasum:
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
Returned:
sum of absolute values (dasum)
daxpy:
Input:
n number of elements in arrays
659
sa the scalar multiplier
sx array[n] of elements to be scaled and added
incx increment between elements of sx
sy array[n] of elements to be added
incy increment between elements of sy
Output:
sy array[n] of accumulated elements
dcopy:
Input:
n number of elements in arrays
sx array[n] of elements to be copied
incx increment between elements of sx
incy increment between elements of sy
Output:
sy array[n] of copied elements
ddot:
Input:
n number of elements in arrays
sx array[n] of elements
incx increment between elements of sx
sy array[n] of elements
incy increment between elements of sy
dnrm2:
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
dscal:
Input:
n number of elements in array
sa the scalar multiplier
sx array[n] of elements
incx increment between elements
660
Output:
sx array[n] of scaled elements
661
DGE - Double precision Gaussian Elimination matrix subroutines adapted
from LINPACK FORTRAN:
Function Prototypes:
void dgefa (double **a, int n, int *ipvt, int *info);
void dgeco (double **a, int n, int *ipvt, double *rcond, double *z);
void dgesl (double **a, int n, int *ipvt, double *b, int job);
dgfa:
Input:
a matrix[n][n] to be factored (see notes below)
n dimension of a
Output:
a matrix[n][n] factored (see notes below)
ipvt indices of pivot permutations (see notes below)
info index of last zero pivot (or -1 if no zero pivots)
dgeco:
Input:
a matrix[n][n] to be factored (see notes below)
n dimension of a
Output:
a matrix[n][n] factored (see notes below)
ipvt indices of pivot permutations (see notes below)
rcond reciprocal of condition number (see notes below)
Workspace:
z array[n]
dgesl:
Input:
a matrix[n][n] that has been LU factored (see notes below)
n dimension of a
ipvt indices of pivot permutations (see notes below)
b right-hand-side vector[n]
job =0 to solve Ax = b
662
=1 to solve A’x = b
Output:
b solution vector[n]
Notes:
These functions were adapted from LINPACK FORTRAN. Because two-dimensional
arrays cannot be declared with variable dimensions in C, the matrix a
is actually a pointer to an array of pointers to floats, as declared
above and used below.
Both the factored matrix a and the pivot indices ipvt are required
to solve linear systems of equations via dgesl.
dgeco:
Given the reciprocal of the condition number, rcond, and the double
epsilon, DBL_EPSILON, the number of significant decimal digits, nsdd,
in the solution of a linear system of equations may be estimated by:
nsdd = (int)log10(rcond/DBL_EPSILON)
663
PFAFFT - Functions to perform Prime Factor (PFA) FFT’s, in place
Function Prototypes:
int npfa_d (int nmin);
int npfao_d (int nmin, int nmax);
int npfar_d (int nmin);
int npfaro_d (int nmin, int nmax);
void pfacc_d (int isign, int n, real_complex z[]);
void pfacr_d (int isign, int n, real_complex cz[], real rz[]);
void pfarc_d (int isign, int n, real rz[], real_complex cz[]);
void pfamcc_d (int isign, int n, int nt, int k, int kt, real_complex z[]);
void pfa2cc_d (int isign, int idim, int n1, int n2, real_complex z[]);
void pfa2cr_d (int isign, int idim, int n1, int n2, real_complex cz[], real rz[]);
void pfa2rc_d (int isign, int idim, int n1, int n2, real rz[], real_complex cz[]);
npfa_d:
Input:
nmin lower bound on returned value (see notes below)
npfao_d
Input:
nmin lower bound on returned value (see notes below)
nmax desired (but not guaranteed) upper bound on returned value
npfar_d
Input:
nmin lower bound on returned value
664
Returned: valid n for real-to-real_complex/real_complex-to-real prime factor fft
npfaro_d:
Input:
nmin lower bound on returned value
nmax desired (but not guaranteed) upper bound on returned value
pfacc_d:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n length of transform (see notes below)
z array[n] of real_complex numbers to be transformed in place
Output:
z array[n] of real_complex numbers transformed
pfacr_d:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n length of transform (see notes below)
cz array[n/2+1] of real_complex values (may be equivalenced to rz)
Output:
rz array[n] of real values (may be equivalenced to cz)
pfarc_d:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n length of transform; must be even (see notes below)
rz array[n] of real values (may be equivalenced to cz)
Output:
cz array[n/2+1] of real_complex values (may be equivalenced to rz)
pfamcc_d:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n number of real_complex elements per transform (see notes below)
nt number of transforms
k stride in real_complex elements within transforms
665
kt stride in real_complex elements between transforms
z array of real_complex elements to be transformed in place
Output:
z array of real_complex elements transformed
pfa2cc_d:
Input:
isign sign of isign is the sign of exponent in fourier kernel
idim dimension to transform, either 1 or 2 (see notes)
n1 1st (fast) dimension of array to be transformed (see notes)
n2 2nd (slow) dimension of array to be transformed (see notes)
z array[n2][n1] of real_complex elements to be transformed in place
Output:
z array[n2][n1] of real_complex elements transformed
pfa2cr_d:
Input:
isign sign of isign is the sign of exponent in fourier kernel
idim dimension to transform, which must be either 1 or 2 (see notes)
n1 1st (fast) dimension of array to be transformed (see notes)
n2 2nd (slow) dimension of array to be transformed (see notes)
cz array of real_complex values (may be equivalenced to rz)
Output:
rz array of real values (may be equivalenced to cz)
pfa2rc_d:
Input:
isign sign of isign is the sign of exponent in fourier kernel
idim dimension to transform, which must be either 1 or 2 (see notes)
n1 1st (fast) dimension of array to be transformed (see notes)
n2 2nd (slow) dimension of array to be transformed (see notes)
rz array of real values (may be equivalenced to cz)
Output:
cz array of real_complex values (may be equivalenced to rz)
Notes:
Table of valid n and cost for prime factor fft. For each n, cost
was estimated to be the inverse of the number of ffts done in 1 sec
on an IBM RISC System/6000 Model 320H, by Dave Hale, 08/04/91.
666
(Redone by Jack Cohen for 15 sec to rebuild NTAB table on advice of
David and Gregory Chudnovsky, 05/03/94).
Cost estimates are least accurate for very small n. An alternative method
for estimating cost would be to count multiplies and adds, but this
method fails to account for the overlapping of multiplies and adds
that is possible on some computers, such as the IBM RS/6000 family.
npfa_d:
The returned n will be composed of mutually prime factors from
the set {2,3,4,5,7,8,9,11,13,16}. Because n cannot exceed
720720 = 5*7*9*11*13*16, 720720 is returned if nmin exceeds 720720.
npfao_d:
The returned n will be composed of mutually prime factors from
the set {2,3,4,5,7,8,9,11,13,16}. Because n cannot exceed
720720 = 5*7*9*11*13*16, 720720 is returned if nmin exceeds 720720.
If nmin does not exceed 720720, then the returned n will not be
less than nmin. The optimal n is chosen to minimize the estimated
cost of performing the fft, while satisfying the constraint, if
possible, that n not exceed nmax.
pfacc:
n must be factorable into mutually prime factors taken
from the set {2,3,4,5,7,8,9,11,13,16}. in other words,
n = 2**p * 3**q * 5**r * 7**s * 11**t * 13**u
where
0 <= p <= 4, 0 <= q <= 2, 0 <= r,s,t,u <= 1
is required for pfa to yield meaningful results. this
restriction implies that n is restricted to the range
1 <= n <= 720720 (= 5*7*9*11*13*16)
pfacr:
Because pfacr uses pfacc to do most of the work, n must be even
and n/2 must be a valid length for pfacc. The simplest way to
obtain a valid n is via n = npfar(nmin). A more optimal n can be
obtained with npfaro.
667
pfarc:
Because pfarc uses pfacc to do most of the work, n must be even
and n/2 must be a valid length for pfacc. The simplest way to
obtain a valid n is via n = npfar(nmin). A more optimal n can be
obtained with npfaro.
pfamcc:
To perform a two-dimensional transform of an n1 by n2 real_complex array
(assuming that both n1 and n2 are valid "n"), stored with n1 fast
and n2 slow:
pfamcc(isign,n1,n2,1,n1,z); (to transform 1st dimension)
pfamcc(isign,n2,n1,n1,1,z); (to transform 2nd dimension)
pfa2cc:
Only one (either the 1st or 2nd) dimension of the 2-D array is transformed.
pfa2cr:
If idim equals 1, then n2 transforms of n1/2+1 real_complex elements to n1 real
elements are performed; else, if idim equals 2, then n1 transforms of n2/2+1
real_complex elements to n2 real elements are performed.
668
obtain a valid n is via n = npfar(nmin). A more optimal n can be
obtained with npfaro.
pfa2rc:
If idim equals 1, then n2 transforms of n1 real elements to n1/2+1 real_complex
elements are performed; else, if idim equals 2, then n1 transforms of n2
real elements to n2/2+1 real_complex elements are performed.
References:
Temperton, C., 1985, Implementation of a self-sorting
in-place prime factor fft algorithm: Journal of
Computational Physics, v. 58, p. 283-299.
669
CWP_Exit - exit subroutine for CWP/SU codes
670
FRANNOR - functions to generate a pseudo-random float normally distributed
with N(0,1); i.e., with zero mean and unit variance.
Function Prototypes:
float frannor (void);
void srannor (int seed);
frannor:
Input: (none)
Returned: normally distributed random float
srannor:
Input:
seed different seeds yield different sequences of random numbers.
Notes:
Adapted from subroutine rnor in Kahaner, Moler and Nash (1988)
which in turn was based on an algorithm by
Marsaglia and Tsang (1984).
References:
Numerical Methods and Software", D.
Kahaner, C. Moler, S. Nash, Prentice Hall, 1988.
671
FRANUNI - Functions to generate a pseudo-random float uniformly distributed
on [0,1); i.e., between 0.0 (inclusive) and 1.0 (exclusive)
Function Prototypes:
float franuni (void);
void sranuni (int seed);
franuni:
Input: (none)
Returned: pseudo-random float
sranuni:
seed different seeds yield different sequences of random numbers.
Notes:
Adapted from subroutine uni in Kahaner, Moler, and Nash (1988).
This book references a set of unpublished notes by
Marsaglia.
References:
Numerical Methods and Software", D. Kahaner, C. Moler, S. Nash,
Prentice Hall, 1988.
672
HANKEL - Functions to compute discrete Hankel transforms
Function Prototypes:
void *hankelalloc (int nfft);
void hankelfree (void *ht);
void hankel0 (void *ht, float f[], float h[]);
void hankel1 (void *ht, float f[], float h[]);
hankelalloc:
Input:
nfft valid length for real to complex fft (see notes below)
Returned:
pointer to Hankel transformer
hankelfree:
Input:
ht pointer to Hankel transformer (as returned by hankelalloc)
hankel0:
Input:
ht pointer to Hankel transformer (as returned by hankelalloc)
f array[nfft/2+1] to be transformed
Output:
h array[nfft/2+1] transformed
hankel1:
Input:
ht pointer to Hankel transformer (as returned by hankelalloc)
f array[nfft/2+1] to be transformed
Output:
h array[nfft/2+1] transformed
Notes:
The zeroth-order Hankel transform is defined by:
673
Infinity
h0(k) = Integral dr r j0(k*r) f(r)
0
Infinity
h1(k) = Integral dr r j1(k*r) f(r)
0
References:
Hansen, E. W., 1985, Fast Hankel transform algorithm: IEEE Trans. on
Acoustics, Speech and Signal Processing, v. ASSP-33, n. 3, p. 666-671.
(Beware of several errors in the equations in this paper!)
674
HILBERT - Compute Hilbert transform y of x
Function Prototype:
void hilbert (int n, float x[], float y[]);
Input:
n length of x and y
x array[n] to be Hilbert transformed
Output:
y array[n] containing Hilbert transform of x
Notes:
The Hilbert transform is computed by convolving x with a
windowed (approximate) version of the ideal Hilbert transformer.
675
HOLBERG1D - Compute coefficients of Holberg’s 1st derivative filter
Function Prototype:
void holbergd1 (float e, int n, float d[]);
Input:
e maximum relative error in group velocity
n number of coefficients in filter (must be 2, 4, 6, or 8)
Output:
d array[n] of coefficients
Notes:
Coefficients are output in a form suitable for convolution. The
derivative is centered halfway between coefficients d[n/2-1] and d[n/2].
Coefficients are computed via the power series method of Kindelan et al.,
1990, On the construction and efficiency of staggered numerical
differentiators for the wave equation: Geophysics 55, 107-110.
See also, Holberg, 1987, Computational aspects of the choice of
operator and sampling interval for numerical differentiation in
large-scale simulation of wave phenomena: Geophys. Prosp., 35, 629-655
Reference:
Kindelan et al., 1990,
On the construction and efficiency of staggered numerical
differentiators for the wave equation: Geophysics 55, 107-110.
676
INTCUB - evaluate y(x), y’(x), y’’(x), ... via piecewise cubic interpolation
Function Prototype:
void intcub (int ideriv, int nin, float xin[], float ydin[][4],
Input:
ideriv =0 if y(x) desired; =1 if y’(x) desired, ...
nin length of xin and ydin arrays
xin array[nin] of monotonically increasing or decreasing x values
ydin array[nin][4] of y(x), y’(x), y’’(x), and y’’’(x)
nout length of xout and yout arrays
xout array[nout] of x values at which to evaluate y(x), y’(x), ...
Output:
yout array[nout] of y(x), y’(x), ... values
Notes:
xin values must be monotonically increasing or decreasing.
Extrapolation of the function y(x) for xout values outside the range
spanned by the xin values is performed using the derivatives in
ydin[0][0:3] or ydin[nin-1][0:3], depending on whether xout is closest
to xin[0] or xin[nin-1], respectively.
Reference:
See: Greville, T. N., Theory and Application of Spline Functions, Academic Press
for a general discussion of spline functions.
677
INTL2B - bilinear interpolation of a 2-D array of bytes
Function Prototype:
void intl2b (int nxin, float dxin, float fxin,
int nyin, float dyin, float fyin, unsigned char *zin,
int nxout, float dxout, float fxout,
int nyout, float dyout, float fyout, unsigned char *zout);
Input:
nxin number of x samples input (fast dimension of zin)
dxin x sampling interval input
fxin first x sample input
nyin number of y samples input (slow dimension of zin)
dyin y sampling interval input
fyin first y sample input
zin array[nyin][nxin] of input samples (see notes)
nxout number of x samples output (fast dimension of zout)
dxout x sampling interval output
fxout first x sample output
nyout number of y samples output (slow dimension of zout)
dyout y sampling interval output
fyout first y sample output
Output:
zout array[nyout][nxout] of output samples (see notes)
Notes:
The arrays zin and zout must passed as pointers to the first element of
a two-dimensional contiguous array of unsigned char values.
678
INTLINC - evaluate complex y(x) via linear interpolation of y(x[0]), y(x[1]), ...
Function Prototype:
void intlinc (int nin, float xin[], complex yin[], complex yinl, complex yinr,
int nout, float xout[], complex yout[]);
Input:
nin length of xin and yin arrays
xin array[nin] of monotonically increasing or decreasing x values
yin array[nin] of input y(x) values
yinl value used to extraplate y(x) to left of input yin values
yinr value used to extraplate y(x) to right of input yin values
nout length of xout and yout arrays
xout array[nout] of x values at which to evaluate y(x)
Output:
yout array[nout] of linearly interpolated y(x) values
Notes:
xin values must be monotonically increasing or decreasing.
Extrapolation of the function y(x) for xout values outside the range
spanned by the xin values in performed as follows:
679
INTLIN - evaluate y(x) via linear interpolation of y(x[0]), y(x[1]), ...
Function Prototype:
void intlin (int nin, float xin[], float yin[], float yinl, float yinr,
int nout, float xout[], float yout[]);
Input:
nin length of xin and yin arrays
xin array[nin] of monotonically increasing or decreasing x values
yin array[nin] of input y(x) values
yinl value used to extraplate y(x) to left of input yin values
yinr value used to extraplate y(x) to right of input yin values
nout length of xout and yout arrays
xout array[nout] of x values at which to evaluate y(x)
Output:
yout array[nout] of linearly interpolated y(x) values
Notes:
xin values must be monotonically increasing or decreasing.
Extrapolation of the function y(x) for xout values outside the range
spanned by the xin values in performed as follows:
680
INTSINC8 - Functions to interpolate uniformly-sampled data via 8-coeff. sinc
approximations:
Function Prototypes:
void ints8c (int nxin, float dxin, float fxin, complex yin[],
complex yinl, complex yinr, int nxout, float xout[], complex yout[]);
void ints8r (int nxin, float dxin, float fxin, float yin[],
float yinl, float yinr, int nxout, float xout[], float yout[]);
Input:
nxin number of x values at which y(x) is input
dxin x sampling interval for input y(x)
fxin x value of first sample input
yin array[nxin] of input y(x) values: yin[0] = y(fxin), etc.
yinl value used to extrapolate yin values to left of yin[0]
yinr value used to extrapolate yin values to right of yin[nxin-1]
nxout number of x values a which y(x) is output
xout array[nxout] of x values at which y(x) is output
Output:
yout array[nxout] of output y(x): yout[0] = y(xout[0]), etc.
Notes:
Because extrapolation of the input function y(x) is defined by the
left and right values yinl and yinr, the xout values are not restricted
to lie within the range of sample locations defined by nxin, dxin, and
fxin.
The maximum error for frequiencies less than 0.6 nyquist is less than
one percent.
681
INTTABLE8 - Interpolation of a uniformly-sampled complex function y(x)
via a table of 8-coefficient interpolators
Function Prototype:
void intt8c (int ntable, float table[][8],
int nxin, float dxin, float fxin, complex yin[],
complex yinl, complex yinr, int nxout, float xout[], complex yout[]);
void intt8r (int ntable, float table[][8],
int nxin, float dxin, float fxin, float yin[],
float yinl, float yinr, int nxout, float xout[], float yout[]);
Input:
ntable number of tabulated interpolation operators; ntable>=2
table array of tabulated 8-point interpolation operators
nxin number of x values at which y(x) is input
dxin x sampling interval for input y(x)
fxin x value of first sample input
yin array of input y(x) values: yin[0] = y(fxin), etc.
yinl value used to extrapolate yin values to left of yin[0]
yinr value used to extrapolate yin values to right of yin[nxin-1]
nxout number of x values a which y(x) is output
xout array of x values at which y(x) is output
Output:
yout array of output y(x) values: yout[0] = y(xout[0]), etc.
NOTES:
ntable must not be less than 2.
682
Likewise, for d = 1.0,
are the weights applied to the 8 input samples nearest xout. In general,
for d = (float)itable/(float)(ntable-1), table[itable][0:7] are the
weights applied to the 8 input samples nearest xout. If the actual sample
distance d does not exactly equal one of the values for which interpolators
are tabulated, then the interpolator corresponding to the nearest value of
d is used.
683
LINEAR_REGRESSION - Compute linear regression of (y1,y2,...,yn) against
(x1,x2,...,xn)
Function Prototype:
void linear_regression(float *y, float *x, int n, float coeff[4]);
Input:
y array of y values
x array of x values
n length of y and x arrays
Output:
coeff[4] where:
y(x)
| * . fit is y(x) = a x + b
| .
| . *
| * .
| . *
------------------- x
n Sum[x*y] - Sum[x]*Sum[y]
a = --------------------------
n Sum[x*x] - Sum[x]*Sum[x]
Sum[y] - a*Sum[x]
b = -----------------
n
cc = std definition
se = std definition
684
MKDIFF - Make an n-th order DIFFerentiator via Taylor’s series method.
Function Prototype:
void mkdiff (int n, float a, float h, int l, int m, float d[]);
Input:
n order of desired derivative (n>=0 && n<=m-l is required)
a fractional distance from integer sampling index (see notes)
h sampling interval
l sampling index of first coefficient (see notes below)
m sampling index of last coefficient (see notes below)
Output:
d array[m-l+1] of coefficients for n’th order differentiator
Notes:
The abscissae x of a sampled function f(x) can always be expressed as
x = (j+a)*h, where j is an integer, a is a fraction, and h is the
sampling interval. To approximate the n’th order derivative fn(x)
of the sampled function f(x) at x = (j+a)*h, use the m-l+1 coefficients
in the output array d[] as follows:
685
MKHDIFF - Compute filter approximating the bandlimited HalF-DIFFerentiator.
Function Prototype:
void mkhdiff (float h, int l, float d[]);
Input:
h sampling interval
l half-length of half-differentiator (length = 1+2*l is odd)
Output:
d array[1+2*l] of coefficients for half-differentiator
Notes:
The half-differentiator is defined by
pi
d[l+j] = sqrt(1/h)/(2pi) * integral dw sqrt(-iw)*exp(-iwj)
-pi
pi
= sqrt(2/h)/(2pi) * integral dw sqrt(w)*(cos(wj)-sin(wj))
0
686
MKSINC - Compute least-squares optimal sinc interpolation coefficients.
Function Prototype:
void mksinc (float d, int lsinc, float sinc[]);
Input:
d fractional distance to interpolation point; 0.0<=d<=1.0
lsinc length of sinc approximation; lsinc%2==0 and lsinc<=20
Output:
sinc array[lsinc] containing interpolation coefficients
Notes:
The coefficients are a least-squares-best approximation to the ideal
sinc function for frequencies from zero up to a computed maximum
frequency. For a given interpolator length, lsinc, mksinc computes
the maximum frequency, fmax (expressed as a fraction of the nyquist
frequency), using the following empirically derived relation (from
a Western Geophysical Technical Memorandum by Ken Larner):
fmax = min(0.066+0.265*log(lsinc),1.0)
lsinc-1
y(i+d) = sum sinc[j]*y(i+j+1-lsinc/2)
j=0
687
MNEWT - Solve non-linear system of equations f(x) = 0 via Newton’s method
Function Prototype:
int mnewt (int maxiter, float ftol, float dxtol, int n, float *x, void *aux,
void (*fdfdx)(int n, float *x, float *f, float **dfdx, void *aux));
Input:
maxiter maximum number of iterations
ftol converged when sum of absolute values of f less than ftol
dxtol converged when sum of absolute values of dx less than dxtol
n number of equations
x array[n] containing initial guess of solution
aux pointer to auxiliary parameters to be passed to fdfdx
fdfdx pointer to function to evaluate f(x) and f’(x)
Output:
x array[n] containing solution
688
PFAFFT - Functions to perform Prime Factor (PFA) FFT’s, in place
Function Prototypes:
int npfa (int nmin);
int npfao (int nmin, int nmax);
int npfar (int nmin);
int npfaro (int nmin, int nmax);
void pfacc (int isign, int n, complex z[]);
void pfacr (int isign, int n, complex cz[], float rz[]);
void pfarc (int isign, int n, float rz[], complex cz[]);
void pfamcc (int isign, int n, int nt, int k, int kt, complex z[]);
void pfa2cc (int isign, int idim, int n1, int n2, complex z[]);
void pfa2cr (int isign, int idim, int n1, int n2, complex cz[], float rz[]);
void pfa2rc (int isign, int idim, int n1, int n2, float rz[], complex cz[]);
npfa:
Input:
nmin lower bound on returned value (see notes below)
npfao
Input:
nmin lower bound on returned value (see notes below)
nmax desired (but not guaranteed) upper bound on returned value
npfar
Input:
nmin lower bound on returned value
689
Returned: valid n for real-to-complex/complex-to-real prime factor fft
npfaro:
Input:
nmin lower bound on returned value
nmax desired (but not guaranteed) upper bound on returned value
pfacc:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n length of transform (see notes below)
z array[n] of complex numbers to be transformed in place
Output:
z array[n] of complex numbers transformed
pfacr:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n length of transform (see notes below)
cz array[n/2+1] of complex values (may be equivalenced to rz)
Output:
rz array[n] of real values (may be equivalenced to cz)
pfarc:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n length of transform; must be even (see notes below)
rz array[n] of real values (may be equivalenced to cz)
Output:
cz array[n/2+1] of complex values (may be equivalenced to rz)
pfamcc:
Input:
isign sign of isign is the sign of exponent in fourier kernel
n number of complex elements per transform (see notes below)
nt number of transforms
k stride in complex elements within transforms
690
kt stride in complex elements between transforms
z array of complex elements to be transformed in place
Output:
z array of complex elements transformed
pfa2cc:
Input:
isign sign of isign is the sign of exponent in fourier kernel
idim dimension to transform, either 1 or 2 (see notes)
n1 1st (fast) dimension of array to be transformed (see notes)
n2 2nd (slow) dimension of array to be transformed (see notes)
z array[n2][n1] of complex elements to be transformed in place
Output:
z array[n2][n1] of complex elements transformed
pfa2cr:
Input:
isign sign of isign is the sign of exponent in fourier kernel
idim dimension to transform, which must be either 1 or 2 (see notes)
n1 1st (fast) dimension of array to be transformed (see notes)
n2 2nd (slow) dimension of array to be transformed (see notes)
cz array of complex values (may be equivalenced to rz)
Output:
rz array of real values (may be equivalenced to cz)
pfa2rc:
Input:
isign sign of isign is the sign of exponent in fourier kernel
idim dimension to transform, which must be either 1 or 2 (see notes)
n1 1st (fast) dimension of array to be transformed (see notes)
n2 2nd (slow) dimension of array to be transformed (see notes)
rz array of real values (may be equivalenced to cz)
Output:
cz array of complex values (may be equivalenced to rz)
Notes:
Table of valid n and cost for prime factor fft. For each n, cost
was estimated to be the inverse of the number of ffts done in 1 sec
on an IBM RISC System/6000 Model 320H, by Dave Hale, 08/04/91.
691
(Redone by Jack Cohen for 15 sec to rebuild NTAB table on advice of
David and Gregory Chudnovsky, 05/03/94).
Cost estimates are least accurate for very small n. An alternative method
for estimating cost would be to count multiplies and adds, but this
method fails to account for the overlapping of multiplies and adds
that is possible on some computers, such as the IBM RS/6000 family.
npfa:
The returned n will be composed of mutually prime factors from
the set {2,3,4,5,7,8,9,11,13,16}. Because n cannot exceed
720720 = 5*7*9*11*13*16, 720720 is returned if nmin exceeds 720720.
npfao:
The returned n will be composed of mutually prime factors from
the set {2,3,4,5,7,8,9,11,13,16}. Because n cannot exceed
720720 = 5*7*9*11*13*16, 720720 is returned if nmin exceeds 720720.
If nmin does not exceed 720720, then the returned n will not be
less than nmin. The optimal n is chosen to minimize the estimated
cost of performing the fft, while satisfying the constraint, if
possible, that n not exceed nmax.
pfacc:
n must be factorable into mutually prime factors taken
from the set {2,3,4,5,7,8,9,11,13,16}. in other words,
n = 2**p * 3**q * 5**r * 7**s * 11**t * 13**u
where
0 <= p <= 4, 0 <= q <= 2, 0 <= r,s,t,u <= 1
is required for pfa to yield meaningful results. this
restriction implies that n is restricted to the range
1 <= n <= 720720 (= 5*7*9*11*13*16)
pfacr:
Because pfacr uses pfacc to do most of the work, n must be even
and n/2 must be a valid length for pfacc. The simplest way to
obtain a valid n is via n = npfar(nmin). A more optimal n can be
obtained with npfaro.
692
pfarc:
Because pfarc uses pfacc to do most of the work, n must be even
and n/2 must be a valid length for pfacc. The simplest way to
obtain a valid n is via n = npfar(nmin). A more optimal n can be
obtained with npfaro.
pfamcc:
To perform a two-dimensional transform of an n1 by n2 complex array
(assuming that both n1 and n2 are valid "n"), stored with n1 fast
and n2 slow:
pfamcc(isign,n1,n2,1,n1,z); (to transform 1st dimension)
pfamcc(isign,n2,n1,n1,1,z); (to transform 2nd dimension)
pfa2cc:
Only one (either the 1st or 2nd) dimension of the 2-D array is transformed.
pfa2cr:
If idim equals 1, then n2 transforms of n1/2+1 complex elements to n1 real
elements are performed; else, if idim equals 2, then n1 transforms of n2/2+1
complex elements to n2 real elements are performed.
693
obtain a valid n is via n = npfar(nmin). A more optimal n can be
obtained with npfaro.
pfa2rc:
If idim equals 1, then n2 transforms of n1 real elements to n1/2+1 complex
elements are performed; else, if idim equals 2, then n1 transforms of n2
real elements to n2/2+1 complex elements are performed.
References:
Temperton, C., 1985, Implementation of a self-sorting
in-place prime factor fft algorithm: Journal of
Computational Physics, v. 58, p. 283-299.
694
POLAR - Functions to map data in rectangular coordinates to polar and vise versa
Function Prototypes:
void recttopolar ( int nx, float dx, float fx, int ny, float dy, float fy,
float **p, int na, float da, float fa, int nr,
float dr, float fr, float **q);
void polartorect ( int na, float da, float fa, int nr, float dr, float fr,
float **q, int nx, float dx, float fx, int ny,
float dy, float fy, float **p)
recttopolar:
Input:
nx number of x samples
dx x sampling interval
fx first x sample
ny number of y samples
dy y sampling interval
fy first y sample
p array[ny][nx] containing samples of p(x,y)
na number of a samples
da a sampling interval
fa first a sample
nr number of r samples
dr r sampling interval
fr first r sample
Output:
q array[nr][na] containing samples of q(a,r)
polartorect:
Input:
na number of a samples
da a sampling interval
fa first a sample
nr number of r samples
dr r sampling interval
fr first r sample
nx number of x samples
dx x sampling interval
fx first x sample
695
ny number of y samples
dy y sampling interval
fy first y sample
q array[nr][na] containing samples of q(a,r)
Output:
p array[ny][nx] containing samples of p(x,y)
Notes:
The polar angle a is measured in radians,
x = r*cos(a) and y = r*sin(a).
recttopolar:
Linear extrapolation is used to determine the value of p(x,y) for
x and y coordinates not in the range corresponding to nx, dx, ....
polartorect:
Linear extrapolation is used to determine the value of q(a,r) for
a and r coordinates not in the range corresponding to na, da, ....
696
PRINTERPLOT - Functions to make a printer plot of a 1-dimensional array
Function Prototypes:
void pp1d (FILE *fp, char *title, int lx, int ifx, float x[]);
void pplot1 (FILE *fp, char *title, int nx, float ax[]);
pp1d:
Input:
fp file pointer for output (e.g., stdout, stderr, etc.)
title title of plot
lx length of x
ifx index of first x
x array[lx] to be plotted
pplot1:
Input:
fp file pointer for printed output (e.g., stdout, stderr, etc.)
title title of plot
nx number of x values to be plotted
ax array[nx] of x values
Notes:
Are two subroutines to do this really necessary?
697
QUEST - Functions to ESTimate Quantiles:
quest:
Input:
p quantile to be estimated (0.0<=p<=1.0 is required)
n number of samples in array x (n>=5 is required)
x array[n] of floats
questalloc:
Input:
p quantile to be estimated (0.0<=p<=1.0 is required)
n number of samples in array x (n>=5 is required)
x array[n] of floats
questupdate:
Input:
q pointer to quantile estimator (as returned by questalloc)
n number of samples in array x
x array[n] of floats
questfree:
q pointer to quantile estimator (as returned by questalloc)
Notes:
quest:
The estimate should approach the sample quantile in the limit of large n.
698
Jain and Chlamtac (1985).
questalloc:
This function must be called before calling function questupdate.
See also notes in questupdate.
questupdate:
The estimate should approach the sample quantile in the limit of large n.
Reference:
Jain, R. and Chlamtac, I., 1985, The PP algorithm for dynamic
calculation of quantiles and histograms without storing observations:
Comm. ACM, v. 28, n. 10.
699
RESSINC8 - Functions to resample uniformly-sampled data via 8-coefficient sinc
approximations:
Function Prototypes:
void ress8r (int nxin, float dxin, float fxin, float yin[],
float yinl, float yinr,
int nxout, float dxout, float fxout, float yout[]);
void ress8c (int nxin, float dxin, float fxin, complex yin[],
complex yinl, complex yinr,
int nxout, float dxout, float fxout, complex yout[]);
Input:
nxin number of x values at which y(x) is input
dxin x sampling interval for input y(x)
fxin x value of first sample input
yin array[nxin] of input y(x) values: yin[0] = y(fxin), etc.
yinl value used to extrapolate yin values to left of yin[0]
yinr value used to extrapolate yin values to right of yin[nxin-1]
nxout number of x values at which y(x) is output
dxout x sampling interval for output y(x)
fxout x value of first sample output
Output:
yout array[nxout] of output y(x) values: yout[0] = y(fxout), etc.
Notes:
Because extrapolation of the input function y(x) is defined by the
left and right values yinl and yinr, the output x values defined
by nxout, dxout, and fxout are not restricted to lie within the range
of input x values defined by nxin, dxin, and fxin.
700
RFWTVA - Rasterize a Float array as Wiggle-Trace-Variable-Area.
Function Prototype:
void rfwtva (int n, float z[], float zmin, float zmax, float zbase,
int yzmin, int yzmax, int xfirst, int xlast,
int wiggle, int nbpr, unsigned char *bits, int endian);
Input:
n number of samples in array to rasterize
z array[n] to rasterize
zmin z values below zmin will be clipped
zmax z values above zmax will be clipped
zbase z values between zbase and zmax will be filled (see notes)
yzmin horizontal raster coordinate corresponding to zmin
yzmax horizontal raster coordinate corresponding to zmax
xfirst vertical raster coordinate of z[0] (see notes)
xlast vertical raster coordinate of z[n-1] (see notes)
wiggle =0 for no wiggle (VA only); =1 for wiggle (with VA)
wiggle 2<=wiggle<=5 for solid/grey coloring of VA option
shade of grey: wiggle=2 light grey, wiggle=5 black
nbpr number of bytes per row of bits
bits pointer to first (top,left) byte in image
endian byte order =1 big endian =0 little endian
Output:
bits pointer to first (top,left) byte in image
Notes:
The raster coordinate of the (top,left) bit in the image is (0,0).
In other words, x increases downward and y increases to the right.
Raster scan lines run from left to right, and from top to bottom.
Therefore, xfirst, xlast, yzmin, and yzmax should not be less than 0.
Likewise, yzmin and yzmax should not be greater than nbpr*8-1, and
care should be taken to ensure that xfirst and xlast do not cause bits
to be set outside (off the bottom) of the image.
701
The variable "endian" must have a value of 1 or 0. If this is
not a case an error is returned.
702
RFWTVAINT - Rasterize a Float array as Wiggle-Trace-Variable-Area, with
8 point sinc INTerpolation.
Function Prototype:
void rfwtvaint (int n, float z[], float zmin, float zmax, float zbase,
int yzmin, int yzmax, int xfirst, int xlast,
int wiggle, int nbpr, unsigned char *bits, int endian);
Input:
n number of samples in array to rasterize
z array[n] to rasterize
zmin z values below zmin will be clipped
zmax z values above zmax will be clipped
zbase z values between zbase and zmax will be filled (see notes)
yzmin horizontal raster coordinate corresponding to zmin
yzmax horizontal raster coordinate corresponding to zmax
xfirst vertical raster coordinate of z[0] (see notes)
xlast vertical raster coordinate of z[n-1] (see notes)
wiggle =0 for no wiggle (VA only); =1 for wiggle (with VA)
wiggle 2<=wiggle<=5 for solid/grey coloring of VA option
shade of grey: wiggle=2 light grey, wiggle=5 black
nbpr number of bytes per row of bits
bits pointer to first (top,left) byte in image
endian byte order =1 big endian =0 little endian
Output:
bits pointer to first (top,left) byte in image
Notes:
The raster coordinate of the (top,left) bit in the image is (0,0).
In other words, x increases downward and y increases to the right.
Raster scan lines run from left to right, and from top to bottom.
Therefore, xfirst, xlast, yzmin, and yzmax should not be less than 0.
Likewise, yzmin and yzmax should not be greater than nbpr*8-1, and
care should be taken to ensure that xfirst and xlast do not cause bits
to be set outside (off the bottom) of the image.
703
and zmin are filled. Swapping yzmin and yzmax is an easy way to
reverse the polarity of a wiggle.
704
SBLAS - Single precision Basic Linear Algebra Subroutines
(adapted from LINPACK FORTRAN):
Function Prototypes:
int isamax (int n, float *sx, int incx);
float sasum (int n, float *sx, int incx);
void saxpy (int n, float sa, float *sx, int incx, float *sy, int incy);
void scopy (int n, float *sx, int incx, float *sy, int incy);
float sdot (int n, float *sx, int incx, float *sy, int incy);
float snrm2 (int n, float *sx, int incx);
void sscal (int n, float sa, float *sx, int incx);
void sswap (int n, float *sx, int incx, float *sy, int incy);
isamax:
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
sasum:
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
saxpy:
Input:
n number of elements in arrays
sa the scalar multiplier
sx array[n] of elements to be scaled and added
705
incx increment between elements of sx
sy array[n] of elements to be added
incy increment between elements of sy
Output:
sy array[n] of accumulated elements
scopy:
Input:
n number of elements in arrays
sx array[n] of elements to be copied
incx increment between elements of sx
incy increment between elements of sy
Output:
sy array[n] of copied elements
sdot:
Input:
n number of elements in arrays
sx array[n] of elements
incx increment between elements of sx
sy array[n] of elements
incy increment between elements of sy
snrm2
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
sscal:
Input:
n number of elements in array
sa the scalar multiplier
sx array[n] of elements
incx increment between elements
Output:
706
sx array[n] of scaled elements
sswap:
Input:
n number of elements in arrays
sx array[n] of elements
incx increment between elements of sx
sy array[n] of elements
incy increment between elements of sy
Output:
sx array[n] of swapped elements
sy array[n] of swapped elements
Notes:
Adapted from Linpack Fortran.
snrm2:
This simple version may cause overflow or underflow!
707
SCAXIS - compute a readable scale for use in plotting axes
Function Prototype:
void scaxis (float x1, float x2, int *nxnum, float *dxnum, float *fxnum);
Input:
x1 first x value
x2 second x value
nxnum desired number of numbered values
Output:
nxnum number of numbered values
dxnum increment between numbered values (dxnum>0.0)
fxnum first numbered value
Notes:
scaxis attempts to honor the user-specified nxnum. However, nxnum
will be modified if necessary for readability. Also, fxnum and nxnum
will be adjusted to compensate for roundoff error; in particular,
fxnum will not be less than xmin-eps, and fxnum+(nxnum-1)*dxnum
will not be greater than xmax+eps, where eps = 0.0001*(xmax-xmin).
xmin is the minimum of x1 and x2. xmax is the maximum of x1 and x2.
708
SGA - Single precision general matrix functions adapted from LINPACK FORTRAN:
Function Prototypes:
void sgefa (float **a, int n, int *ipvt, int *info);
void sgeco (float **a, int n, int *ipvt, float *rcond, float *z);
void sgesl (float **a, int n, int *ipvt, float *b, int job);
sgefa:
Input:
a matrix[n][n] to be factored (see notes below)
n dimension of a
Output:
a matrix[n][n] factored (see notes below)
ipvt indices of pivot permutations (see notes below)
info index of last zero pivot (or -1 if no zero pivots)
sgeco:
Input:
a matrix[n][n] to be factored (see notes below)
n dimension of a
Output:
a matrix[n][n] factored (see notes below)
ipvt indices of pivot permutations (see notes below)
rcond reciprocal condition number (see notes below)
Workspace:
z array[n]
sgesl
Input:
a matrix[n][n] that has been LU factored (see notes below)
n dimension of a
ipvt indices of pivot permutations (see notes below)
b right-hand-side vector[n]
job =0 to solve Ax = b
=1 to solve A’x = b
709
Output:
b solution vector[n]
Notes:
These functions were adapted from LINPACK FORTRAN. Because two-dimensional
arrays cannot be declared with variable dimensions in C, the matrix a
is actually a pointer to an array of pointers to floats, as declared
above and used below.
Both the factored matrix a and the pivot indices ipvt are required
to solve linear systems of equations via sgesl.
sgeco:
Given the reciprocal of the condition number, rcond, and the float
epsilon, FLT_EPSILON, the number of significant decimal digits, nsdd,
in the solution of a linear system of equations may be estimated by:
nsdd = (int)log10(rcond/FLT_EPSILON)
710
SHFS8R - Shift a uniformly-sampled real-valued function y(x) via
a table of 8-coefficient sinc approximations.
Function Prototypes:
void shfs8r (float dx, int nxin, float fxin, float yin[],
float yinl, float yinr, int nxout, float fxout, float yout[]);
Input:
dx x sampling interval for both input and output y(x)
nxin number of x values at which y(x) is input
fxin x value of first sample input
yin array[nxin] of input y(x) values: yin[0] = y(fxin), etc.
yinl value used to extrapolate yin values to left of yin[0]
yinr value used to extrapolate yin values to right of yin[nxin-1]
nxout number of x values a which y(x) is output
fxout x value of first sample output
Output:
yout array[nxout] of output y(x) values: yout[0] = y(fxout), etc.
Notes:
Because extrapolation of the input function y(x) is defined by the
left and right values yinl and yinr, the output samples defined by
dx, nxout, and fxout are not restricted to lie within the range of
input sample locations defined by dx, nxin, and fxin.
711
SINC - Return SINC(x) for as floats or as doubles
Function Prototype:
float fsinc (float x);
double dsinc (double x);
Input:
x value at which to evaluate sinc(x)
Returned: sinc(x)
Notes:
sinc(x) = sin(PI*x)/(PI*x)
712
SORT - Functions to sort arrays of data or arrays of indices
Function Prototypes:
void hpsort (int n, float a[]);
void qkisort (int n, float a[], int i[]);
void qkifind (int m, int n, float a[], int i[]);
void qksort (int n, float a[]);
void qkfind (int m, int n, float a[]);
hpsort:
Input:
n number of elements in a
a array[n] to be sorted
Output:
a array[n] sorted
qkisort:
Input:
n number of elements in array a
a array[n] elements
i array[n] indices to be sorted
Output:
i array[n] indices sorted
qkifind:
713
Input:
m index of element to be found
n number of elements in array a
a array[n] elements
i array[n] indices to be partially sorted
Output:
i array[n] indices partially sorted sorted
qksort:
Input:
n number of elements in array a
a array[n] containing elements to be sorted
Output:
a array[n] containing sorted elements
qkfind:
Input:
m index of element to be found
n number of elements in array a
a array[n] to be partially sorted
Output:
a array[n] partially sorted
Notes:
hpsort:
The heap sort algorithm is, at worst, N log_2 N, and in most cases
is 20% faster. Adapted from Standish.
qkisort:
This function is adapted from procedure quicksort by
Hoare, C.A.R., 1961, Communications of the ACM, v. 4, p. 321;
the main difference is that recursion is accomplished
explicitly via a stack array for efficiency; also, a simple
insertion sort is used to sort subarrays too small to be
partitioned efficiently.
714
qkifind:
This function is adapted from procedure find by
Hoare, C.A.R., 1961, Communications of the ACM, v. 4, p. 321.
qksort:
This function is adapted from procedure quicksort by
Hoare, C.A.R., 1961, Communications of the ACM, v. 4, p. 321;
the main difference is that recursion is accomplished
explicitly via a stack array for efficiency; also, a simple
insertion sort is used to sort subarrays too small to be
partitioned efficiently.
qkfind:
This function is adapted from procedure find by Hoare 1961.
Reference:
hpsort:
Standish, T. A., Data Structure Techniques, p. 91.
See also Press, W. A., et al., Numerical Recipes in C.
quick sort:
Hoare, C.A.R., 1961, Communications of the ACM, v. 4, p. 321.
715
SQR - Single precision QR decomposition functions adapted from LINPACK FORTRAN:
Function Prototypes:
void sqrdc (float **x, int n, int p, float *qraux, int *jpvt,
float *work, int job);
void sqrsl (float **x, int n, int k, float *qraux,
float *y, float *qy, float *qty,
float *b, float *rsd, float *xb, int job, int *info);
void sqrst (float **x, int n, int p, float *y, float tol,
float *b, float *rsd, int *k,
int *jpvt, float *qraux, float *work);
sqrdc:
Input:
x matrix[p][n] to decompose (see notes below)
n number of rows in the matrix x
p number of columns in the matrix x
jpvt array[p] controlling the pivot columns (see notes below)
job =0 for no pivoting;
=1 for pivoting
Output:
x matrix[p][n] decomposed (see notes below)
qraux array[p] containing information required to recover the
orthogonal part of the decomposition
jpvt array[p] with jpvt[k] containing the index of the original
matrix that has been interchanged into the k-th column, if
pivoting is requested.
Workspace:
work array[p] of workspace
sqrsl:
Input:
x matrix[p][n] containing output of sqrdc.
n number of rows in the matrix xk; same as in sqrdc.
k number of columns in the matrix xk; k must not be greater
716
than MIN(n,p), where p is the same as in sqrdc.
qraux array[p] containing auxiliary output from sqrdc.
y array[n] to be manipulated by sqrsl.
job specifies what is to be computed. job has the decimal
expansion ABCDE, with the following meaning:
if A != 0, compute qy.
if B, C, D, or E != 0, compute qty.
if C != 0, compute b.
if D != 0, compute rsd.
if E != 0, compute xb.
Note that a request to compute b, rsd, or xb automatically
triggers the computation of qty, for which an array must
be provided.
Output:
qy array[n] containing Qy, if its computation has been
requested.
qty array[n] containing Q’y, if its computation has
been requested. Here Q’ denotes the transpose of Q.
b array[k] containing solution of the least squares problem:
minimize norm2(y - xk*b),
if its computation has been requested. (Note that if
pivoting was requested in sqrdc, the j-th component of
b will be associated with column jpvt[j] of the original
matrix x that was input into sqrdc.)
rsd array[n] containing the least squares residual y - xk*b,
if its computation has been requested. rsd is also the
orthogonal projection of y onto the orthogonal complement
of the column space of xk.
xb array[n] containing the least squares approximation xk*b,
if its computation has been requested. xb is also the
orthogonal projection of y onto the column space of x.
info =0 unless the computation of b has been requested and R
is exactly singular. In this case, info is the index of
the first zero diagonal element of R and b is left
unaltered.
sqrst:
Input:
x matrix[p][n] of coefficients (x is destroyed by sqrst.)
n number of rows in the matrix x (number of observations)
p number of columns in the matrix x (number of parameters)
y array[n] containing right-hand-side (observations)
717
tol relative tolerance used to determine the subset of
columns of x included in the solution. If tol is zero,
a full complement of the MIN(n,p) columns is used.
If tol is non-zero, the problem should be scaled so that
all the elements of X have roughly the same absolute
accuracy eps. Then a reasonable value for tol is roughly
eps divided by the magnitude of the largest element.
Output:
x matrix[p][n] containing output of sqrdc
b array[p] containing the solution (parameters); components
corresponding to columns not used are set to zero.
rsd array[n] of residuals y - Xb
k number of columns of x used in the solution
jpvt array[p] containing pivot information from sqrdc.
qraux array[p] containing auxiliary information from sqrdc.
Workspace:
work array[p] of workspace.
Notes:
!!! WARNING !!!
These functions have many options, not all of which have been tested!
(Dave Hale, 12/31/89)
sqrdc:
Uses Householder transformations to compute the QR decomposition of an n by p
718
matrix x. Column pivoting based on the 2-norms of the reduced columns may be
performed at the user’s option.
sqrsl:
Uses the output of sqrdc to compute coordinate transformations, projections,
and least squares solutions. For k <= MIN(n,p), let xk be the matrix
xk = (x[jpvt[0]], x[jpvt[1]], ..., x[jpvt[k-1]])
formed from columns jpvt[0], jpvt[1], ..., jpvt[k-1] of the original
n by p matrix x that was input to sqrdc. (If no pivoting was done, xk
consists of the first k columns of x in their original order.) sqrdc
produces a factored orthogonal matrix Q and an upper triangular matrix R
such that
xk = Q * (R)
(0)
This information is contained in coded form in the arrays x and qraux.
The parameters qy, qty, b, rsd, and xb are not referenced if their
computation is not requested and in this case can be replaced by NULL
pointers in the calling program. To save storage, the user may in
some cases use the same array for different parameters in the calling
sequence. A frequently occuring example is when one wishes to compute
any of b, rsd, or xb and does not need y or qty. In this case one may
equivalence y, qty, and one of b, rsd, or xb, while providing separate
arrays for anything else that is to be computed. Thus the calling
719
sequence
sqrsl(x,n,k,qraux,y,NULL,y,b,y,NULL,110,&info)
will result in the computation of b and rsd, with rsd overwriting y.
More generally, each item in the following list contains groups of
permissible equivalences for a single calling sequence.
1. (y,qty,b) (rsd) (xb) (qy)
2. (y,qty,rsd) (b) (xb) (qy)
3. (y,qty,xb) (b) (rsd) (qy)
4. (y,qy) (qty,b) (rsd) (xb)
5. (y,qy) (qty,rsd) (b) (xb)
6. (y,qy) (qty,xb) (b) (rsd)
In any group the value returned in the array allocated to the group
corresponds to the last member of the group.
sqrst:
Computes least squares solutions to the system
Xb = y
which may be either under-determined or over-determined. The user may
supply a tolerance to limit the columns of X used in computing the solution.
In effect, a set of columns with a condition number approximately bounded
by 1/tol is used, the other components of b being set to zero.
On return, the arrays x, jpvt, and qraux contain the usual output from
sqrdc, so that the QR decomposition of x with pivoting is fully available
to the user. In particular, columns jpvt[0], jpvt[1], ..., jpvt[k-1]
were used in the solution, and the condition number associated with
those columns is estimated by ABS(x[0][0]/x[k-1][k-1]).
720
STOEP - Functions to solve a symmetric Toeplitz linear system of equations
Rf=g for f
Function Prototypes:
void stoepd (int n, double r[], double g[], double f[], double a[]);
void stoepf (int n, float r[], float g[], float f[], float a[]);
Input:
n dimension of system
r array[n] of top row of Toeplitz matrix
g array[n] of right-hand-side column vector
Output:
f array[n] of solution (left-hand-side) column vector
a array[n] of solution to Ra=v (Claerbout, FGDP, p. 57)
Notes:
These routines do NOT solve the case when the main diagonal is zero, it
just silently returns.
The left column of the Toeplitz matrix is assumed to be equal to the top
row (as specified in r); i.e., the Toeplitz matrix is assumed symmetric.
721
STRSTUFF -- STRing manuplation subs
Input:
char *str input string
Output:
none
Returns:
char * duplicated string
Notes:
This local definition of strdup is necessary because some systems
do not have it.
722
SWAPBYTE - Functions to SWAP the BYTE order of binary data
Function Prototypes:
void swap_short_2(short *tni2);
void swap_u_short_2(unsigned short *tni2);
void swap_int_4(int *tni4);
void swap_u_int_4(unsigned int *tni4);
void swap_long_4(long *tni4);
void swap_u_long_4(unsigned long *tni4);
void swap_float_4(float *tnf4);
void swap_double_8(double *tndd8);
Notes:
These routines are necessary for reversing the byte order of binary data
for transportation between big-endian and little-endian machines. Examples
of big-endian machines are IBM RS6000, SUN, NeXT. Examples of little
endian machines are PC’s and DEC.
These routines have been tested with PC data and run on PC’s running
several PC versions of UNIX, but have not been tested on DEC.
Also, the number appended to the name of the routine refers to the
number of bytes that the item is assumed to be.
723
SYMMEIGEN - Functions solving the eigenvalue problem for symmetric matrices
eig_jacobi - find eigenvalues and corresponding eigenvectors via
the jacobi algorithm for symmetric matrices
sort_eigenvalues - sort eigenvalues and corresponding eigenvectors
in descending order
Function Prototypes:
void eig_jacobi(float **a, float d[], float **v, int n);
void sort_eigenvalues(float d[], float **v, int n);
(inspired by Press et. al., 1996)
Function Prototype:
void eig_jacobi(float **a, float d[], float **v, int n);
(inspired by Press et. al., 1996)
{
int j,iq,ip,i;
float tresh,theta,tau,t,sm,s,h,g,c,*b,*z;
724
sm=0.0;
for (ip=1;ip<=n-1;ip++) {
for (iq=ip+1;iq<=n;iq++)
sm += fabs(a[ip][iq]);
}
/* normal return
if (sm == 0.0) {
z+=1; free1float(z);
b+=1; free1float(b);
return;
}
/* tresh values for first 3 sweeps and therafter
if (i < 4)
tresh=0.2*sm/(n*n);
else
tresh=0.0;
for (ip=1;ip<=n-1;ip++) {
for (iq=ip+1;iq<=n;iq++) {
g=100.0*fabs(a[ip][iq]);
if (i > 4 && (float)(fabs(d[ip])+g) == (float)fabs(d[ip])
&& (float)(fabs(d[iq])+g) == (float)fabs(d[iq]))
a[ip][iq]=0.0;
else if (fabs(a[ip][iq]) > tresh) {
h=d[iq]-d[ip];
if ((float)(fabs(h)+g) == (float)fabs(h))
t=(a[ip][iq])/h;
else {
theta=0.5*h/(a[ip][iq]);
t=1.0/(fabs(theta)+sqrt(1.0+theta*theta));
if (theta < 0.0) t = -t;
}
c=1.0/sqrt(1+t*t);
s=t*c;
tau=s/(1.0+c);
h=t*a[ip][iq];
z[ip] -= h;
z[iq] += h;
d[ip] -= h;
d[iq] += h;
a[ip][iq]=0.0;
/* Jacobi rotations
725
for (j=1;j<=ip-1;j++) {
ROTATE(a,j,ip,j,iq)
}
for (j=ip+1;j<=iq-1;j++) {
ROTATE(a,ip,j,j,iq)
}
for (j=iq+1;j<=n;j++) {
ROTATE(a,ip,j,iq,j)
}
for (j=1;j<=n;j++) {
ROTATE(v,j,ip,j,iq)
}
}
}
}
for (ip=1;ip<=n;ip++) {
b[ip] += z[ip];
d[ip]=b[ip];
z[ip]=0.0;
}
}
/* this will not happen, hopefully
fprintf(stderr,"jacobi iteration does not converge\n");
}
Function Prototypes:
void sort_eigenvalues(float d[], float **v, int n);
(inspired by Press et. al., 1996)
{
int k,j,i;
float p;
for (i=1;i<n;i++) {
p=d[k=i];
for (j=i+1;j<=n;j++)
if (d[j] >= p) p=d[k=j];
if (k != i) {
d[k]=d[i];
726
d[i]=p;
for (j=1;j<=n;j++) {
p=v[j][i];
v[j][i]=v[j][k];
v[j][k]=p;
}
}
}
}
727
TEMPORARY_FILENAME - Creates a file name in a user-specified directory.
Function prototype:
char *temporary_filename(char *tempfile);
Input:
tempfile pointer to directory prefix string (eg. /usr/tmp/)
Output:
tempfile pointer to filename string (eg. /usr/tmp/1206aaa)
Notes:
temporary_filename creates a file name by appending a sequence of
numbers and letters (which is created by tmpnam) to the prefix string
passed as its argument. On return the input argument points to the
(now augmented) prefix string.
728
TRIDIAGONAL - Functions to solve tridiagonal systems of equations Tu=r for u.
Function Prototypes:
void tridif (int n, float a[], float b[], float c[], float r[], float u[]);
void tridid (int n, double a[], double b[], double c[], double r[], double u[]);
void tripd (float *d, float *e, float *b, int n);
void tripp(int n, float *d, float *e, float *c, float *b);
tridif, tridid:
Input:
n dimension of system
a array[n] of lower sub-diagonal of T (a[0] ignored)
b array[n] of diagonal of T
c array[n] of upper super-diagonal of T (c[n-1] ignored)
r array[n] of right-hand-side column vector
Output:
u array[n] of solution (left-hand-side) column vector
tripd:
Input:
d array[n], the diagonal of A
e array[n], the superdiagonal of A
b array[n], the rhs column vector of Ax=b
Output:
b b is overwritten with the solution to Ax=b
tripp:
Input:
d diagonal vector of matrix
e upper-diagonal vector of matrix
c lower-diagonal vector of matrix
b right-hand vector
n dimension of matrix
Output:
b solution vector
729
Notes:
For example, a tridiagonal system of dimension 4 is specified as:
tripd:
Given an n-by-n symmetric, tridiagonal, positive definite matrix A and
n-vector b, following algorithm overwrites b with the solution to Ax = b
730
VANDERMONDE - Functions to solve Vandermonde system of equations Vx=b
Function Prototypes:
void vanded (int n, double v[], double b[], double x[]);
void vandef (int n, float v[], float b[], float x[]);
Input:
n dimension of system
v array[n] of 2nd row of Vandermonde matrix (1st row is all ones)
b array[n] of right-hand-side column vector
Output:
x array[n] of solution column vector
Notes:
The arrays b and x may be equivalenced.
Reference:
Adapted from Algorithm 5.6-2 in Golub, G. H., and Van Loan, C. F., 1983,
Matrix Computations, John-Hopkins University Press.
731
WAVEFORMS Subroutines to define some wavelets for modeling of seismic
data
Function Prototypes:
void ricker1_wavelet (int nt, float dt, float fpeak, float *wavelet);
void ricker2_wavelet (int hlw, float dt, float period, float ampl,
float distort, float *wavelet);
void akb_wavelet (int nt, float dt, float fpeak, float *wavelet);
void spike_wavelet (int nt, int tindex, float *wavelet);
void unit_wavelet (int nt, float *wavelet);
void zero_wavelet (int nt, float *wavelet);
void berlage_wavelet (int nt, float dt, float fpeak, float ampl, float tn,
732
float decay, float ipa, float *wavelet);
void gaussian_wavelet (int nt, float dt, float fpeak, float *wavelet);
void gaussderiv_wavelet (int nt, float dt, float fpeak, float *wavelet);
733
XCOR - Compute z = x cross-correlated with y
Function Prototype:
void xcor (int lx, int ifx, float *x, int ly, int ify, float *y ,
int lz, int ifz, float *z);
Input:
lx length of x array
ifx sample index of first x
x array[lx] to be cross-correlated with y
ly length of y array
ify sample index of first y
y array[ly] with which x is to be cross-correlated
lz length of z array
ifz sample index of first z
Output:
z array[lz] containing x cross-correlated with y
Notes:
See notes for convolution function conv().
ifx+lx-1
z[i] = sum x[j]*y[i+j] ; i = ifz,...,ifz+lz-1
j=ifx
734
XINDEX - determine index of x with respect to an array of x values
Input:
nx number of x values in array ax
ax array[nx] of monotonically increasing or decreasing x values
x the value for which index is to be determined
index index determined previously (used to begin search)
Output:
index for monotonically increasing ax values, the largest index
for which ax[index]<=x, except index=0 if ax[0]>x;
for monotonically decreasing ax values, the largest index
for which ax[index]>=x, except index=0 if ax[0]<x
Notes:
This function is designed to be particularly efficient when called
repeatedly for slightly changing x values; in such cases, the index
returned from one call should be used in the next.
735
YCLIP - Clip a function y(x) defined by linear interpolation of the
uniformly sampled values: y(fx), y(fx+dx), ..., y(fx+(nx-1)*dx).
Returns the number of samples in the clipped function.
Function Prototype:
int yclip (int nx, float dx, float fx, float y[], float ymin, float ymax,
float xc[], float yc[]);
Input:
nx number of x (and y) values
dx x sampling interval
fx first x
y array[nx] of uniformly sampled y(x) values
ymin minimum y value; must not be greater than ymax
ymax maximum y value; must not be less than ymin
Output:
xc array[?] of x values for clipped y(x)
yc array[?] of y values for clipped y(x)
Notes:
The output arrays xc and yc should contain space 2*nx values, which
is the maximum possible number (nc) of xc and yc returned.
736
YXTOXY - Compute a regularly-sampled, monotonically increasing function x(y)
from a regularly-sampled, monotonically increasing function y(x) by
inverse linear interpolation.
Function Prototype:
void yxtoxy (int nx, float dx, float fx, float y[],
int ny, float dy, float fy, float xylo, float xyhi, float x[]);
Input:
nx number of samples of y(x)
dx x sampling interval; dx>0.0 is required
fx first x
y array[nx] of y(x) values; y[0] < y[1] < ... < y[nx-1] required
ny number of samples of x(y)
dy y sampling interval; dy>0.0 is required
fy first y
xylo x value assigned to x(y) when y is less than smallest y(x)
xyhi x value assigned to x(y) when y is greater than largest y(x)
Output:
x array[ny] of x(y) values
Notes:
User must ensure that:
(1) dx>0.0 && dy>0.0
(2) y[0] < y[1] < ... < y[nx-1]
737
ZASC - routine to translate ncharacters from ebcdic to ascii
Input:
nchar number of characters to be translated
ainput pointer to input characters
Output:
aoutput pointer to output characters
Function Prototype:
int zasc(char *ainput, char *aoutput, integer nchar);
Notes:
translated by f2c. Horribly inefficient, but little used
738
ZEBC - routine to translate ncharacters from ascii to ebcdic
Input:
nchar number of characters to be translated
ainput pointer to input characters
Output:
aoutput pointer to output characters
Function Prototype:
int zebc(char *ainput, char *aoutput, integer nchar);
Notes:
translated by f2c. Horribly inefficient, but little used
739
CHECK - CHECK triangulated models
Function Prototypes:
void badModel(void);
void checkVertexUse (VertexUse *vu);
void checkEdgeUse (EdgeUse *eu);
void checkFace (Face *f);
void checkModel (Model *m);
checkVertexUse:
Input:
vu Pointer to VertexUse
checkEdgeUse:
Input:
eu pointer to EdgeUse
checkFace:
Input:
f pointer to Face
checkModel:
Input:
m pointer to Model
740
CIRCUM - define CIRCUMcircles for Delaunay triangulation
Function Prototypes:
void circum (float x1, float y1, float x2, float y2, float x3, float y3,
float *xc, float *yc, float *rs);
void circumTri (Tri *t);
circum:
Input:
x1 x-coordinate of first point
y1 y-coordinate of first point
x2 x-coordinate of second point
y2 y-coordinate of second point
x3 x-coordinate of third point
y3 y-coordinate of third point
Output:
xc pointer to x-coordinate of center of circumcircle
yc pointer to y-coordinate of center of circumcircle
rs pointer radius^2 of circumcircle
circumTri:
Input:
t Pointer to Tri
Returns:
xc x-coordinate of circumcircle
yc y-coordinate of circumcircle
rs radius^2 of circumcircle
741
COLINEAR - determine if edges or vertecies are COLINEAR in triangulated
model
edgesColinear see whether or not two edges are colinear
vertexBetweenVertices determine whether or not a vertex is on a line
between two other vertices
Function Prototypes:
int edgesColinear (Edge *e1, Edge *e2);
int vertexBetweenVertices (Vertex *v, Vertex *v1, Vertex *v2);
edgesColinear:
Input:
e1 pointer to first Edge
e2 pointer to second Edge
Returns: (int)
1 if colinear
vertexBetweenVertices:
Input:
v pointer to first Vertex in question
v1 pointer to first reference Vertex
v2 pointer to second reference Vertex
Returns: integer
1 if v=v1 or v=v2 or if v is between v1 and v2
0 otherwise
742
CREATE - create model, boundary edge triangles, edge face, edge vertex, add
a vertex
Function Prototypes:
Model *makeModel (float xmin, float ymin, float xmax, float ymax);
void makeBoundaryEdgeTri (Vertex *v, Edge **enew, Tri **tnew);
void makeEdgeFace (Vertex *v1, Vertex *v2, Edge **enew, Face **fnew);
Vertex* addVertexToModel (Model *m, float x, float y);
Tri* insideTriInModel (Model *m, Tri *start, float x, float y);
makeModel:
Input:
xmin minimum x-coordinate
ymin minimum y-coordinate
xmax maximum x-coordinate
ymax maximum y-coordinate
makeBoundaryEdgeTri:
Input:
v specified boundary Vertex
Output:
enew new boundary Edge
tnew new boundary triangle
Notes:
The specified vertex and the adjacent vertices on the boundary
are assumed to be colinear. Therefore, the resulting
boundary triangle has zero area, and is intended to enable
deletion of the specified vertex from the boundary.
makeEdgeFace:
743
Input:
v1 First Vertex
v2 second Vertex
Output:
enew new Edge
fnew new Face
Notes:
The vertices must be adjacent to a single common face.
This face is closed off by the new edge, and a new edge and
a new face are made and returned.
addVertexToModel:
Input:
m model
x x-coordinate of new vertex
y y-coordinate of new vertex
Notes:
If the new vertex is close to an existing vertex, this function returns NULL.
insideTriInModel:
Input:
m Model
start triangle to look at first (NULL to begin looking anywhere)
x x-coordinate
y y-coordinate
Notes:
Points on an edge of a triangle are assumed to be inside that triangle.
An edge may be used by two triangles, so two triangles may "contain"
a point that lies on an edge. The first triangle found to contain
the specified point is returned.
744
DELETE - DELETE vertex, model, edge, or boundary edge from triangulated model
Function Prototypes:
void deleteVertexFromModel (Model *m, Vertex *v);
void killModel (Model *m);
void killEdge (Edge *e, Face **fs);
void killBoundaryEdge (Edge *e);
deleteVertexFromModel:
Input:
m pointer to Model
v pointer to Vertex to be deleted
killModel:
Input:
m pointer to Model
killEdge:
Input:
e Edge to delete
Output:
fs surviving Face
killBoundaryEdge:
Input:
e boundary Edge
Notes:
Killing a boundary edge is typically done after a new boundary vertex
is inserted on an existing boundary edge.
745
DTE - Distance to Edge
Function Prototype:
float distanceToEdge (Edge *e, float x, float y);
distanceToEdge:
Input:
e edge to which distance is to be computed
x x-coordinate
y y-coordinate
746
FIXEDGES - FIX or unFIX EDGES between verticies
fixEdgesBetweenVertices:
Input:
v1 pointer to first Vertex
v2 pointer to second Vertex
Returns:
0 if unable to fix edges
1 otherwise
unfixEdge:
Input:
e edge to be unfixed
Returns:
0 if unable to unfix edge
1 otherwise
Author: Dave Hale, Colorado School of Mines, 06/04/91
747
INSIDE - Is a vertex or point inside a circum circle, etc. of a triangulated
model
Function Prototypes:
int inCircum (float x, float y, float xc, float yc, float rs);
int inCircumTri (float x, float y, Tri *t);
int in3Vertices (float x, float y, Vertex *v1, Vertex *v2, Vertex *v3);
int inTri (float x, float y, Tri *t);
inCircum:
Input:
x x-coordinate of vertex
y y-coordinate of vertex
xc x-coordinate of center of circumcircle
yc y-coordinate of center of circumcircle
rs radius^2 of circumcircle
Returns:
1 if x,y inside of circumcircle
0 otherwise
Notes:
A vertex exactly on the edge of a circumcircle is taken as being outside
inCircumTri:
Input:
x x-coordinate of vertex
y y-coordinate of vertex
t pointer to Tri
Returns:
1 if x,y inside of circumcircle of a triangle
0 otherwise
Notes:
A vertex exactly on the edge of a circumcircle is taken as being outside
in3Vertices:
748
Input:
x x-coordinate of vertex
y y-coordinate of vertex
v1 pointer to first Vertex
v2 pointer to second Vertex
v3 pointer to third Vertex
Returns:
1 if x,y inside of v1,v2,v3
0 otherwise
Notes:
A vertex exactly on an edge of the triangle is taken as being inside
inTri:
Input:
x x-coordinate of vertex
y y-coordinate of vertex
t pointer to Tri
Returns:
1 if x,y inside a triangle
0 otherwise
Notes:
A vertex exactly on the edge of a triangle is inside
749
NEAREST - NEAREST edge or vertex in triangulated model
Function Prototypes:
Vertex* nearestVertexInModel (Model *m, Vertex *start, float x, float y);
Edge* nearestEdgeInModel (Model *m, Edge *start, float x, float y);
nearestEdgeInModel:
Input:
m model
start edge to look at first (NULL to begin looking anywhere)
x x-coordinate
y y-coordinate
nearestVertexInModel:
Input:
m model
start vertex to look at first (NULL to begin looking anywhere)
x x-coordinate
y y-coordinate
750
PROJECT - project to edge in triangulated model
Input:
e edge to which point is to be projected
x x-coordinate before projection
y y-coordinate before projection
Output:
x x-coordinate after projection
y y-coordinate after projection
751
READWRITE - READ or WRITE a triangulated model
Function Prototypes:
Model *readModel (FILE *fp);
void writeModel (Model *m, FILE *fp);
readModel:
Input:
fp file pointer to file containing model
writeModel:
Input:
m pointer to Model
fp file pointer
752